Booting a 32-Bit guest on an AArch64 host using a QEMU/KVM VM
A 32-bit ARMv7 guest may be run on an AArch64 host using the qemu-system-arm command, however this does not take advantage of KVM. The qemu-system-aarch64 command may be used (with special options) to obtain significant performance improvements when running an ARMv7 guest on AArch64.
Setting up the host
First get virt-builder (if not already installed), in order to make a 32-bit (ARMv7l) F22 image for QEMU:
$ sudo yum -y install libguestfs-tools-c
libvirt and QEMU will also be needed to boot the image:
$ sudo yum -y install \ libvirt libvirt-client libvirt-daemon \ libvirt-daemon-kvm libvirt-daemon-config-network libvirt-daemon-driver-qemu \ virt-install \ qemu-img qemu-kvm qemu-system-aarch64 qemu-system-arm
Making the Image
To produce a minimal F22 ARMv7 image called fedora-22.img
, use:
$ virt-builder \ --verbose \ --arch armv7l \ --root-password password:fedora \ fedora-22
The kernel and initrd may be extracted from the image using:
$ virt-builder --get-kernel fedora-22.img download: /boot/vmlinuz-4.0.4-301.fc22.armv7hl+lpae -> ./vmlinuz-4.0.4-301.fc22.armv7hl+lpae download: /boot/initramfs-4.0.4-301.fc22.armv7hl+lpae.img -> ./initramfs-4.0.4-301.fc22.armv7hl+lpae.img
Booting the Image
To use KVM with the 32-bit image, the AArch64 system QEMU command should be used with the option "-cpu host,aarch64=off
", i.e.,
$ qemu-system-aarch64 \ -cpu host,aarch64=off -M virt \ -smp cpus=4 \ -m 4096 \ -nographic \ -enable-kvm \ -netdev user,id=user0 -device virtio-net-device,netdev=user0 \ -append "console=ttyAMA0,115200 ro root=/dev/vda3 rd_NO_PLYMOUTH LANG=en_US.UTF-8" \ -initrd ./initramfs-4.0.4-301.fc22.armv7hl+lpae.img \ -kernel ./vmlinuz-4.0.4-301.fc22.armv7hl+lpae \ -drive file=fedora-22.img,format=raw,if=none,id=hd0 \ -device virtio-blk-device,drive=hd0
This should boot to the ARMv7 guest and display a login prompt.