Running qemu VMs on a Raspberry Pi 4B 8GB

These are random things I encountered while running qemu VMs on a Raspberry Pi 4B 8GB.

  • Contrary to x86 or AMD64 processors, it is not possible to ‘enable’ virtualization in a BIOS. Qemu VMs will still run,
  • Oracle VirtualBox will not run on a R.Pi 4B. The ARM architecture is not supported.
  • x86 and AMD64 versions of operating systems will not run on qemu on the R.Pi 4B. For your VMs, use the ARM version.

Qemu internal snapshots not working on the Raspberry Pi 4B

# virsh snapshot-create webserver
error: Operation not supported: internal snapshots of a VM with pflash based firmware are not supported

# virsh shutdown webserver

# virsh edit webserver
<loader readonly="yes" type="pflash">
<loader readonly="yes" type="rom">

<acpi/> <---------- remove this line
<gic version='2'>

IRQ guessed as class 0 spammed to /var/log/syslog

In /etc/systemd/journald.conf change




Not sure what’s going on.

Installing Debian 10 ‘Buster’ arm64 on qemu on the Raspberry Pi 4B

# virt-install -n debian --description "debian" --os-type=linux --os-variant=debian10 --ram=2048 --vcpus=2 --disk path=/var/lib/libvirt/images/debian.img,bus=virtio,size=40 --network bridge:br0 --graphics none --console pty,target_type=serial --location --extra-args 'console=ttyS0,115200n8 serial' --force

Installing Ubuntu 21.04 arm64 on qemu on the Raspberry Pi 4B

I’m not sure why most howtos insist you dd iso files to pflash files, create several 64MB boot devices and run VMs on the fly instead of just installing the OS directly using virt-install, but in any case, this worked for me:

Download the Ubuntu 21.04 ARM64 iso:

# cd /var/lib/libvirt/boot
# wget wget
# virt-install -n test --description "test" --os-type=linux --os-variant=ubuntu20.10 --ram=2048 --vcpus=2 --disk path=/var/lib/libvirt/images/test.img,bus=virtio,size=20 --network bridge:br0 --graphics none --cdrom /var/lib/libvirt/boot/ubuntu-21.04-live-server-arm64.iso

Choose the ssh install option. Bonus hint: give the VM a static IP address to prevent it from getting a different IP. It will save you some time troubleshooting connectivity after rebooting.

I guess older versions wouldn’t install properly this way, but 21.04 will. –os-variant ubuntu20.10 works fine.

$ osinfo-query os | grep ubuntu

to check if newer versions are available. At the time of writing there weren’t.

One comment

Leave a Reply to Ronald Geerligs Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Top