Hello everyone!
I recently purchased a Raspberry Pi 4 model B. Unfortunately, I'm not ready to commit the entire device to running OpenWrt, but I have a fully functional QEMU/KVM platform on which I'd like to run OpenWrt whilst also being able to run other services.
I have tried a variation of OpenWrt images and virt-install
options but to no avail. None of them even booted, leaving me in the EFI shell. I even tried to use an Alpine Linux ISO to amend OpenWrt's boot entry, but it was beyond me.
After some intense searching, I came across this guide (https://openwrt.org/docs/guide-user/virtualization/qemu#openwrt_in_qemu_aarch64). In order to test it, I ran a truncated version of the first command with the latest release files, the command being:
$ qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-kernel openwrt-22.03.5-armvirt-64-Image-initramfs
This worked, but it's not being managed by libvirt, so it's not exactly useful to me. In my attempts to translate this command into something virt-install
could understand, I tried all of the following and more (which were just variations on these excluded for brevity):
$ virt-install -n OpenWrt --description "Router VM" --osinfo=linux2022 --ram=512 --vcpus=1 --disk path=/home/noroot/openwrt-22.03.5-armvirt-64-rootfs-ext4.img --graphics none --install kernel=/home/noroot/openwrt-22.03.5-armvirt-64-Image,initrd=/home/noroot/openwrt-22.03.5-armvirt-64-Image-initramfs
$ virt-install -n OpenWrt --description "Router VM" --osinfo=linux2022 --ram=512 --vcpus=1 --disk path=/home/noroot/openwrt-22.03.5-armvirt-64-rootfs-ext4.img --graphics none --import --boot kernel=/home/noroot/openwrt-22.03.5-armvirt-64-Image,initrd=/home/noroot/openwrt-22.03.5-armvirt-64-Image-initramfs
$ virt-install -n OpenWrt --description "Router VM" --osinfo=linux2022 --ram=512 --vcpus=1 --graphics none --import --boot kernel=/home/noroot/openwrt-22.03.5-armvirt-64-Image-initramfs
The issue is that the -kernel
argument to QEMU doesn't exactly translate to virt-install
. Scouting the manpage of virt-install
reveals that there are two ways in which one could pass a kernel, that is, during the installation process only (using --install
), or permanently (using --boot
). The last command listed would logically seem to be the closest to the QEMU command, since we are skipping the installation process and booting directly into the initramfs, as is done in the QEMU command, but the following error occurs:
ERROR unsupported configuration: ACPI requires UEFI on this architecture
I was wondering if anyone could assist me in formulating a virt-install
command such that OpenWrt at least boots.
Thanks in advance,
quickmanjump