Run the script below inside a folder you create. For example: ~/qemu/arm64
# Install QEMU and the EFI image for QEMU:
sudo apt install qemu qemu-system-arm qemu-efi
# Now you'll need to create pflash volumes for UEFI. Two volumes are required, one static one for the UEFI firmware, and another dynamic one to store variables. Both need to be exactly 64M in size.
dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64
# Download xenial arm64
wget http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img
# Changing the password for image
bzr branch lp:~smoser/+junk/backdoor-image
cd backdoor-image
./backdoor-image --user ubuntu --password ubuntu --password-auth ../xenial-server-cloudimg-arm64-uefi1.img
cd..
# Running with networking. User/password is ubuntu/ubuntu
sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=xenial-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0,mac=$(printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)))