Skip to content

Instantly share code, notes, and snippets.

@ambiamber
Created September 6, 2022 22:17
Embed
What would you like to do?
Create 32-bit Fedora armhfp VM
Modernized version of these documenation web pages:
https://fedoraproject.org/wiki/QA:Testcase_Virt_ARM_on_x86
https://michel-slm.name/posts/2020-08-20-fedora-armhfp-vm/
Those depended on this file which no longer exists /etc/extlinux.conf
You will need /etc/qemu-ifup which I could not find using dnf. You can copy it from some tar file see https://www.qemu.org/docs/master/system/devices/net.html or you can copy it from a Debian-based system, it's in the qemu-system-common package.
This is documented, run:
qemu-system-arm --help
The output will include:
qemu -netdev ... [,script=file][,downscript=dfile]
use network scripts 'file' (default=/etc/qemu-ifup)
to configure it and 'dfile' (default=/etc/qemu-ifdown)
wget https://mirror.lstn.net/fedora/releases/36/Spins/armhfp/images/Fedora-Minimal-36-1.5.armhfp.raw.xz
unxz -v Fedora-Minimal-36-1.5.armhfp.raw.xz
virt-get-kernel -a Fedora-Minimal-36-1.5.armhfp.raw
virt-ls -a Fedora-Minimal-36-1.5.armhfp.raw /boot/loader/entries
/boot/loader/entries/b88916309f084030bd266bcd9fe66d1c-5.17.5-300.fc36.armv7hl.conf
virt-cat -a Fedora-Minimal-36-1.5.armhfp.raw /boot/loader/entries/b88916309f084030bd266bcd9fe66d1c-5.17.5-300.fc36.armv7hl.conf
Alternative method
sudo losetup --find --show Fedora-Minimal-36-1.5.armhfp.raw
/dev/loop5
sudo mount -o ro /dev/loop5p3 /mnt
sudo mount -o ro /dev/loop5p2 /mnt/boot
sudo ls mnt/boot/loader/entries
output:
/mnt/boot/loader/entries/b88916309f084030bd266bcd9fe66d1c-5.17.5-300.fc36.armv7hl.conf
sudo cat /mnt/boot/loader/entries/b88916309f084030bd266bcd9fe66d1c-5.17.5-300.fc36.armv7hl.conf
sudo umount /mnt/boot
sudo umount /mnt
sudo losetup -d /dev/loop5
After using either of the methods look in the output for something like
options root=UUID=5780470e-61ea-46ef-bf37-0de8af2e89f2 ro
Add these:
console=ttyAMA0
rootwait
rd.plymouth=0
plymouth.enable=0
Result is:
root=UUID=5780470e-61ea-46ef-bf37-0de8af2e89f2 ro console=ttyAMA0 rootwait rd.plymouth=0 plymouth.enable=0
Boot VM
sudo qemu-system-arm -M virt -kernel ./vmlinuz-5.17.5-300.fc36.armv7hl -initrd ./initramfs-5.17.5-300.fc36.armv7hl.img -nographic -m 4G -append "root=UUID=5780470e-61ea-46ef-bf37-0de8af2e89f2 ro console=ttyAMA0 rootwait rd.plymouth=0 plymouth.enable=0" -netdev tap,id=hostnet0 -device virtio-net-device,netdev=hostnet0,id=net0 -drive file=Fedora-Minimal-36-1.5.armhfp.raw,format=raw,id=hd,if=none -device virtio-blk-device,drive=hd
When the kernel is updated you will need to run
virt-get-kernel -a Fedora-Minimal-36-1.5.armhfp.raw
Then change the -kernel and -initrd files to be the newly extracted ones.
Example
sudo qemu-system-arm -M virt -kernel ./vmlinuz-5.19.6-200.fc36.armv7hl -initrd ./initramfs-5.19.6-200.fc36.armv7hl.img -nographic -m 4G -append "root=UUID=5780470e-61ea-46ef-bf37-0de8af2e89f2 ro console=ttyAMA0 rootwait rd.plymouth=0 plymouth.enable=0" -netdev tap,id=hostnet0 -device virtio-net-device,netdev=hostnet0,id=net0 -drive file=Fedora-Minimal-36-1.5.armhfp.raw,format=raw,id=hd,if=none -device virtio-blk-device,drive=hd
@ambiamber
Copy link
Author

Fedora 36 is the end of the line for armhfp architecture. There will be not Fedora 37 for it unless someone wants to take it over and not use the Fedora koji as they removed support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment