I was using this part of the documentation as a starting point: opkg install kmod-tun qemu-bridge-helper qemu-x86_64-softmmu kmod-kvm-intel
Unfortunately it seems that most of those packages aren't available for the ARM target architecture for the 4b. So my next thought was to attempt compiling it following this: https://www.qemu.org/download/#source
Would anyone have any input on how to get this working on a Pi using OpenWRT? My goal was to have OpenWRT using 1 core and 1GB of RAM for the main OS< and then run a ubuntu server on the remaining resources.
[root@dca632 /usbstick/_QEMU-2022 55°]# /usr/bin/qemu-aarch64 --help
usage: qemu-aarch64 [options] program [arguments...]
Linux CPU emulator (compiled for aarch64 emulation)
Options and associated environment variables:
Argument Env-variable Description
-h print this help
-help
-g port QEMU_GDB wait gdb connection to 'port'
[...]
I tried to run that utility and I ran into an error. It installed just fine and ran the help line you did okay. But when I tried to run it on the image, ./usr/bin/qemu-aarch64 ubuntu-20.04.3-preinstalled-server-arm64\+raspi.img.xz it responds with: "./usr/bin/qemu-aarch64 ubuntu-20.04.3-preinstalled-server-arm64+raspi.img.xz "
This could be my own mistake as it's the first time I'm trying qemu from the CLI.
ok... disregard for now then... if you come across a list of needed packages and a nice one liner to fire up from command line let me know an I can test it some more...
I ran through the initial steps on setting up a build system. updated and installed all the feeds. When I run find ./ -name qemu in the working repository it does find it in the following places:
Technically speaking it does not require building a complete firmware image, but doing it that way would still be the easiest approach.
Qemu needs quite a lot of dependencies to be installed (kernel modules in particular), which might not be available (yet) on your desired target architecture, so aside from adding your arch to https://github.com/openwrt/packages/blob/master/utils/qemu/Makefile#L32 (you should be able to mirror the things necessary for sunxi), you might have to fix a number of reverse dependencies as well. Getting this sorted is easier with the full OpenWrt buildroot, selecting everything you need statically for the sysupgrade image, compared to working piecemeal with the SDK.
Success or failure depends on a lot of things in this case, among others if the bootloader leaves the kernel in the correct mode, so while it should be possible, there might by quite a few hurdles in the way.
Sorry if this seems like a noobish way to approach this. I have built my own image only once before and compiled some of my own packages from source on a laptop; this definitely is as in depth as I've gone.
Alrighty, I did try to add my architecture to Line 32 in the Makefile of my working directory. Attempted both aarch64 & ARMv8-A
When using make menuconfig qemu does not appear as long as I have the BCM2711 selected as the target, but it is present if I have x86 as the target for the image.
I think getting this to work is a little over my head. Probably too niche to commit much time to this but it would be neat in the future maybe.
Interesting! I'll give that image a shot, not exactly sure when I'll get that time next but I'm excited to give it a try. Thank you very much for sharing!
I am relatively new to the field of OpenWrt and embedded Linux. I am interested in performing QEMU virtualization on OpenWrt. I have followed the documentation mentioned in this post, but I encountered an issue where three out of the four required packages could not be downloaded and installed using opkg. To address this problem, one of the suggested approaches is to create a new OpenWrt image that includes the necessary virtualization packages. However, this seems to be a challenging task for me as I have never attempted it before.
Another approach is to download and compile the required packages from their source code, which initially appears to be a more reasonable option, and I do have some experience with it.
I would like to know if there is anyone who has successfully installed QEMU and the required packages using any of these methods and managed to run virtualization. If so, could you kindly provide me with detailed information? It would be greatly appreciated as I am a beginner in this area.