there is an arm64 build of the pc-kernel snap (which essentially contains the linux-generic distro kernel) … if you build an image utilizing that kernel you should technically be able to boot it in an arm64 qemu VM … (you would have to craft your own gadget though with an arm64 grub binary and proper uefi setup that you will need to craft yourself)
the raspberry Pi is completely proprietary, as long as:
the bootloader is not open source and
there is no reliable/usable qemu emulation of that hardware,
but it says “ubuntu-boot” not found, did I missing something?
I can see the boot menu but nothing happens, see below:
GNU GRUB version 2.06
/----------------------------------------------------------------------------\
| Recover using 20230504 |
|*Install using 20230504 |
| Factory reset using 20230504 |
| UEFI Firmware Settings |
| |
| |
| |
| |
| |
| |
| |
| |
| |
\----------------------------------------------------------------------------/
Use the ^ and v keys to select which entry is highlighted.
Press enter to boot the selected OS, `e' to edit the commands
before booting or `c' for a command-line.
error: device name already exists.
error: file `/kernel.efi' not found.
The first QEMU command you posted above should work, and does for me. It may of been an issue with the image you created ?
You should be able to eliminate an image issue by using testing with the Canonical provided image. Also, note that you don’t have to sudo that command, and shouldn’t write to to the VARS file in the system installed location in any case [ you are better of keeping that file pristine ].
You should be able to do the following:
# Grab the reference image
wget https://cdimage.ubuntu.com/ubuntu-core/22/stable/current/ubuntu-core-22-arm64.img.xz
# keep the downloaded image for futer tests from scratch
xzcat ubuntu-core-22-arm64.img.xz > ubuntu-core-22-arm64.img
# Copy the VARS file locally for use with this particaulr VM instance
cp /usr/share/AAVMF/AAVMF_VARS.fd .
# run it
qemu-system-aarch64 \
-smp 2 \
-m 2048 \
-machine virt \
-cpu cortex-a57 \
-net nic,model=virtio \
-drive file=/usr/share/AAVMF/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
-drive file=AAVMF_VARS.fd,if=pflash,format=raw,unit=1 \
-drive "file=ubuntu-core-22-arm64.img",if=none,format=raw,id=disk1 \
-device virtio-blk-pci,drive=disk1,bootindex=1 \
-serial mon:stdio \
-nographic
One more thing to note. Performance without KVM is pretty bad, so you can expect the UC bootstrap process to take a while, it will vary depending on hardware but could easily could be 20 mins plus.
If you have ARM hardware available, running on that with the following will help speed things up a lot: