From Fedora Project Wiki

(Bunch of updates)
No edit summary
Line 11: Line 11:
=== Get the media ===
=== Get the media ===


This is one way to do it and the paths are only relevant for F22 beta media. For some more info, see: [[Architectures/ARM/F22/Installation#For_Versatile_Express_Emulation_with_QEMU]]
This is one way to do it and the paths are only relevant for F22 beta media. For some more info, see: [[Architectures/ARM/F25/Installation#For_Versatile_Express_Emulation_with_QEMU]]


* Download the latest arm disk image to $HOME: https://dl.fedoraproject.org/pub/alt/stage/22_Beta_RC2/Server/armhfp/Images/Fedora-Server-armhfp-22_Beta-2-sda.raw.xz
* Download the latest arm disk image to $HOME: https://dl.fedoraproject.org/pub/fedora/linux/releases/25/Spins/armhfp/images/Fedora-Minimal-armhfp-25-1.3-sda.raw.xz
* Extract the disk image: <code>unar Fedora-Server-armhfp-22_Beta-2-sda.raw.xz</code>. Delete the original compressed image
* Extract the disk image: <code>unar Fedora-Minimal-armhfp-25-1.3-sda.raw.xz</code>. Delete the original compressed image
* Install virt-builder: <code>sudo yum install libguestfs-tools-c</code>
* Install virt-builder: <code>sudo yum install libguestfs-tools-c</code>
* Extract the kernel/initrd from the disk image: <code>virt-builder --get-kernel Fedora-Server-armhfp-22_Beta-2-sda.raw</code>
* Extract the kernel/initrd from the disk image: <code>virt-builder --get-kernel Fedora-Minimal-armhfp-25-1.3-sda.raw</code>
* Copy the media to the the default libvirt image location: <code>sudo mv Fedora-Server-armhfp-22_Beta-2-sda.raw vmlinuz-*.armv7hl initramfs-*.armv7hl.img /var/lib/libvirt/images</code>
* Copy the media to the the default libvirt image location: <code>sudo mv Fedora-Minimal-armhfp-25-1.3-sda.raw vmlinuz-*.armv7hl initramfs-*.armv7hl.img /var/lib/libvirt/images</code>
* Ensure qemu-system-arm is installed: <code>sudo yum install qemu-system-arm</code>
* Ensure qemu-system-arm is installed: <code>sudo yum install qemu-system-arm</code>


Line 37: Line 37:
<pre>
<pre>
sudo virt-install \
sudo virt-install \
     --name f22-arm32 --ram 1024 --arch armv7l --os-variant fedora21 --import \
     --name f25arm7 --ram 1024 --arch armv7l --os-variant fedora24 --import \
     --disk /var/lib/libvirt/images/Fedora-Server-armhfp-22_Beta-2-sda.raw \
     --disk /var/lib/libvirt/images/Fedora-Server-armhfp-25-1.3-sda.raw \
    --features gic_version=2 \
     --boot kernel=/var/lib/libvirt/images/vmlinuz-4.0.0-0.rc5.git4.1.fc22.armv7hl,initrd=/var/lib/libvirt/images/initramfs-4.0.0-0.rc5.git4.1.fc22.armv7hl.img,kernel_args="console=ttyAMA0 rw root=LABEL=_/ rootwait"
     --boot kernel=/var/lib/libvirt/images/vmlinuz-4.0.0-0.rc5.git4.1.fc22.armv7hl,initrd=/var/lib/libvirt/images/initramfs-4.0.0-0.rc5.git4.1.fc22.armv7hl.img,kernel_args="console=ttyAMA0 rw root=LABEL=_/ rootwait"
</pre>
</pre>

Revision as of 15:56, 1 March 2017

Description

Run Fedora ARM VM on your x86 machine via libvirt + QEMU.

Setup

Functioning Fedora virt host.

How to test

Get the media

This is one way to do it and the paths are only relevant for F22 beta media. For some more info, see: Architectures/ARM/F25/Installation#For_Versatile_Express_Emulation_with_QEMU

  • Download the latest arm disk image to $HOME: https://dl.fedoraproject.org/pub/fedora/linux/releases/25/Spins/armhfp/images/Fedora-Minimal-armhfp-25-1.3-sda.raw.xz
  • Extract the disk image: unar Fedora-Minimal-armhfp-25-1.3-sda.raw.xz. Delete the original compressed image
  • Install virt-builder: sudo yum install libguestfs-tools-c
  • Extract the kernel/initrd from the disk image: virt-builder --get-kernel Fedora-Minimal-armhfp-25-1.3-sda.raw
  • Copy the media to the the default libvirt image location: sudo mv Fedora-Minimal-armhfp-25-1.3-sda.raw vmlinuz-*.armv7hl initramfs-*.armv7hl.img /var/lib/libvirt/images
  • Ensure qemu-system-arm is installed: sudo yum install qemu-system-arm

Create the VM with virt-manager

  • Start virt-manager, connect to 'QEMU', click the 'New VM' icon
  • On the first page, under 'Architecture Options' select 'arm'. The 'virt' machine type should be selected automatically
  • Select the 'Import install' option, go to the next page
  • Browse to the disk image, kernel, and initrd we moved in the previous step.
  • Set kernel args as: console=ttyAMA0 rw root=LABEL=_/ rootwait
  • Set the OS as Fedora 21.
  • Continue with the OS defaults, complete the install.
  • The guest should shortly start booting, and you should see text console output. After a bit of a wait, it should hit a text mode 'initial setup' where you can set a root password.

Create the VM with virt-install

Here's the relevant virt-install command:

sudo virt-install \
    --name f25arm7 --ram 1024 --arch armv7l --os-variant fedora24 --import \
    --disk /var/lib/libvirt/images/Fedora-Server-armhfp-25-1.3-sda.raw \
    --features gic_version=2 \
    --boot kernel=/var/lib/libvirt/images/vmlinuz-4.0.0-0.rc5.git4.1.fc22.armv7hl,initrd=/var/lib/libvirt/images/initramfs-4.0.0-0.rc5.git4.1.fc22.armv7hl.img,kernel_args="console=ttyAMA0 rw root=LABEL=_/ rootwait"

Expected Results

No obvious errors occur.