From Fedora Project Wiki
(Created page with "= 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 ...")
 
 
Line 22: Line 22:


== Making the Image ==
== Making the Image ==
{{admon/note | Note | In order to run virt-builder in F22, selinux must be set to Permissive or Disabled.  Also, libvirtd must be started.}}


To produce a minimal F22 ARMv7 image called <code>fedora-22.img</code>, use:
To produce a minimal F22 ARMv7 image called <code>fedora-22.img</code>, use:

Latest revision as of 18:09, 19 June 2015

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

Note
In order to run virt-builder in F22, selinux must be set to Permissive or Disabled. Also, libvirtd must be started.

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.