Changes/Virt ARM on x86

From FedoraProject

< Changes(Difference between revisions)
Jump to: navigation, search
(Change accepted en block on Jul 17 FESCo meeting (#1137))
(Document the current state of affairs)
Line 41: Line 41:
  
 
== Scope ==
 
== Scope ==
 
  
 
* Proposal owners:
 
* Proposal owners:
# Get fixed virt-manager and libvirt packages into Fedora by the feature freeze
+
# Fix issues in libvirt with generating qemu-system-arm command lines:
# Fix issues in libvirt with generating qemu-system-arm command lines
+
#* Fix launching vexpress-a9 (DONE)
#* We may only target a single machine type for this, need to determine
+
#* Support virtio-mmio to enable virtio for vexpress (DONE)
#* https://bugzilla.redhat.com/show_bug.cgi?id=807538
+
#* TODO: vexpress-a15 support? need to figure out the correct qemu+fedora incantation
#* https://bugzilla.redhat.com/show_bug.cgi?id=983306
+
# virt-install support (DONE, see docs)
# Fix virt-manager to not encode incorrect device types like 'ide'
+
# virt-manager support
#* https://bugzilla.redhat.com/show_bug.cgi?id=806105
+
#* Basic setup support (DONE, see docs)
# Consider qemu virtio-mmio for improved performance: https://lists.nongnu.org/archive/html/qemu-devel/2013-06/msg04920.html
+
#* TODO: Improve the 'Create VM' wizard to handle the ARM case better
# Optionally identify any UI defaults that can be improved to handle this case
+
#** Move 'arch' selection to the first screen
 +
#** Allow choosing machine type up front in first screen
 +
#** UI for setting kernel/initrd in create wizard
 +
# Figure out how to actually install a new ARM VM and not depend on pre-installed images.
 +
# Figure out why graphical setup is busted
  
* Other developers: N/A (not a System Wide Change)
 
* Release engineering: N/A (not a System Wide Change)
 
* Policies and guidelines: N/A (not a System Wide Change)
 
  
 
== Upgrade/compatibility impact ==
 
== Upgrade/compatibility impact ==
Line 77: Line 77:
  
 
== Documentation ==
 
== Documentation ==
<!-- N/A (not a System Wide Change)  -->
+
Follow the instructions here to get a pre-installed F19 ARM image, and extract the kernel/initrd/dtb: [[ARMArchitectures/ARM/F19/Installation#For_Versatile_Express_Emulation_with_QEMU]]
* https://fedoraproject.org/wiki/Architectures/ARM/HowToQemu#Using_QEMU_with_libvirt
+
 
* XXX: Should blog about this when it's testable
+
virt-install example:
 +
<pre>
 +
sudo virt-install \
 +
--name armvirtio --ram 1024 \
 +
--arch armv7l --machine vexpress-a9 \
 +
--boot kernel=/var/lib/libvirt/images/vmlinuz-3.9.5-301.fc19.armv7hl,initrd=/var/lib/libvirt/images/initramfs-3.9.5-301.fc19.armv7hl.img,dtb=/var/lib/libvirt/images/dtb-3.9.5-301.fc19.armv7hl,kernel_args="console=ttyAMA0 rw root=/dev/vda3" \
 +
--disk /var/lib/libvirt/images/Fedora-XFCE-armhfp-19-1-sda.raw \
 +
--nographics --os-variant fedora19
 +
</pre>
 +
 
 +
Using virtio requires a dtb to be passed in, but a dtb isn't strictly required otherwise.
 +
 
 +
Creating the VM with virt-manager is a bit more convoluted at the moment, the 'Scope' section details some improvements we can make before F20 GA. Steps:
 +
* 'New VM' wizard
 +
* 'Import existing disk image'
 +
* Point at the above referenced ARM image. Choose Fedora 19 as the OS
 +
* Fill in whatever for RAM and CPU
 +
* On the final page, click customize before install
 +
* Under advanced options, choose virt type 'qemu', arch 'armv7l'
 +
* Click 'finish'
 +
* In the 'customize' wizard, go to 'Overview', change machine type to 'vexpress-a9'
 +
* Go to 'Boot settings', under 'direct kernel boot', specify kernel, initrd, dtb, and kernel args as specified above
 +
* Remove the 'graphics' and 'video' device
 +
* Click 'begin installation'
  
 
== Release Notes ==
 
== Release Notes ==

Revision as of 19:23, 18 August 2013

Contents

ARM on x86 with libvirt/virt-manager

Summary

Fix running ARM VMs on x86 hosts using standard libvirt tools libvirt virsh, virt-manager and virt-install.

Owner

Current status

  • Targeted release: Fedora 20
  • Last updated: 2013-06-11
  • Tracker bug: <will be assigned by the Wrangler>

Detailed Description

qemu has an ARM emulator that works well and is actively used in the Fedora ARM effort. However libvirt and virt-manager currently have issues launching qemu-system-arm VMs, mostly by encoding x86 assumptions in the generated command line that cause qemu-system-arm to fail to start. Let's fix it!

Benefit to Fedora

  • ARM developers can now use virt-manager/libvirt to manage ARM VMs without having to hack around it
  • Fedora QA can use standard tools to test ARM in its bid for Primary Architecture
  • Packagers who want to do ARM work can use standard virt tools to run ARM VMs.
  • Enthusiasts who want to try out the Fedora ARM spin can use standard tools to try it in a VM.

Scope

  • Proposal owners:
  1. Fix issues in libvirt with generating qemu-system-arm command lines:
    • Fix launching vexpress-a9 (DONE)
    • Support virtio-mmio to enable virtio for vexpress (DONE)
    • TODO: vexpress-a15 support? need to figure out the correct qemu+fedora incantation
  2. virt-install support (DONE, see docs)
  3. virt-manager support
    • Basic setup support (DONE, see docs)
    • TODO: Improve the 'Create VM' wizard to handle the ARM case better
      • Move 'arch' selection to the first screen
      • Allow choosing machine type up front in first screen
      • UI for setting kernel/initrd in create wizard
  4. Figure out how to actually install a new ARM VM and not depend on pre-installed images.
  5. Figure out why graphical setup is busted


Upgrade/compatibility impact

N/A (not a System Wide Change)

How To Test

TBD when work is testable.

User Experience

N/A (not a System Wide Change)

Dependencies

N/A (not a System Wide Change)

Contingency Plan

  • Contingency mechanism: N/A (not a System Wide Change)
  • Contingency deadline: N/A (not a System Wide Change)
  • Blocks release? N/A (not a System Wide Change)

Documentation

Follow the instructions here to get a pre-installed F19 ARM image, and extract the kernel/initrd/dtb: ARMArchitectures/ARM/F19/Installation#For_Versatile_Express_Emulation_with_QEMU

virt-install example:

sudo virt-install \
--name armvirtio --ram 1024 \
--arch armv7l --machine vexpress-a9 \
--boot kernel=/var/lib/libvirt/images/vmlinuz-3.9.5-301.fc19.armv7hl,initrd=/var/lib/libvirt/images/initramfs-3.9.5-301.fc19.armv7hl.img,dtb=/var/lib/libvirt/images/dtb-3.9.5-301.fc19.armv7hl,kernel_args="console=ttyAMA0 rw root=/dev/vda3" \
--disk /var/lib/libvirt/images/Fedora-XFCE-armhfp-19-1-sda.raw \
--nographics --os-variant fedora19

Using virtio requires a dtb to be passed in, but a dtb isn't strictly required otherwise.

Creating the VM with virt-manager is a bit more convoluted at the moment, the 'Scope' section details some improvements we can make before F20 GA. Steps:

  • 'New VM' wizard
  • 'Import existing disk image'
  • Point at the above referenced ARM image. Choose Fedora 19 as the OS
  • Fill in whatever for RAM and CPU
  • On the final page, click customize before install
  • Under advanced options, choose virt type 'qemu', arch 'armv7l'
  • Click 'finish'
  • In the 'customize' wizard, go to 'Overview', change machine type to 'vexpress-a9'
  • Go to 'Boot settings', under 'direct kernel boot', specify kernel, initrd, dtb, and kernel args as specified above
  • Remove the 'graphics' and 'video' device
  • Click 'begin installation'

Release Notes

ARM VMs can now be run on x86 hosts using standard libvirt tools like virsh, virt-manager, and virt-install.