Download Qemu Raspberry Pi Fix

0 views
Skip to first unread message

Auden Koenig

unread,
Jan 25, 2024, 8:32:14 PM1/25/24
to plumvascambro

This bit: "-M versatilepb" says "please emulate a VersatilePB development board". (That's a several decades old ARM evaluation board.) "-cpu arm1176" asks for an "arm1176" CPU, which is the ARMv6 CPU that's in the raspberry pi 1. Most userspace code intended for the raspi2 or raspi3 will not run on that (they use a newer ARMv7 CPU). Basically you're trying to use a command line from a tutorial for running a versatilepb kernel on a versatilepb model in order to run raspi 1 userspace images and filesystems. It won't work for raspi2 or raspi3 userspace code.

download qemu raspberry pi


Download ……… https://t.co/LFvNPaNfre



QEMU does not have a model of the raspberry pi 4 at this time (only the 0, 1ap, 2b, 3ap and 3b). If some other machine type that QEMU does support would be good enough for you you could build a kernel for that machine type and use that. (For instance, for a lot of people all they really want is "boots a 64-bit Linux userspace" and they don't need it to really exactly match the Raspberry Pi board hardware; for those people the 'virt' board is usually a good choice.)

Note: qemu only emulates some aspects of the Rapsberry Pi. Linux kernel can be build generic enough to handle the differences on the fly but that depends on what your distribution has configured for the kernel. You might have to get a more generic kernel for it to boot properly.

When I ran it on my MBA M1, the output was a screenful of qemu-system-arm: qemu_mprotect__osdep: mprotect failed: Permission denied, then nothing. QEMU was using 100% of one core, but seemingly not doing anything. I had to kill it.

Curiously, I tried another build of the UBoot kernel, this time from the FreeBSD project: u-boot-qemu-arm-2021.07.txz FreeBSD 13 Download, and got farther with it! QEMU again gave me a screenful of those same errors as above, but proceeded:

hi folks, I'd like to use openwrt as qemu host in rpi3b+ or rpi4b
found this doc ' -user/virtualization/qemu_host'
and tried to follow the instruction but there are no such pkgs in the rpi repos (stable or snapshot).
How can qemu be installed in this case? Will have to compile?
Does anyone have experience running qemu clients in openwrt in rpi?
Please advise.
Thanks!
NB: or suggest any other virtualization solution?
I do not want to install other host OS but openwrt. It would be the default gw for at least 1 client.
Client would be a raspbian desktop btw. I would like to use it as my travel system.
any help, hint are very welcome

found some doc to use lxc rather than qemu and there are pkgs in the stable repo. So I am collecting info and trying to implement this.
well, the big picture is to have an openwrt host as gw; use the wlan0 as wan and eth0 as br-lan; this way I hope I can hook up a thin vnc terminal to physical eth0 (br-lan) on rpi and a lxc rasbian destop client.
So the whole system would be headless and can be connected to external vnc client.
I will update this post as I progress.
Any one has such/similar working implementation on rpi?

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 "

If I were to try this"Getting this sorted is easier with the full OpenWrt buildroot, selecting everything you need statically for the sysupgrade image" am I understanding you correctly that it would attempt to add the qemu package to sysupgrade image found here, -21.02.0-bcm27xx-bcm2711-rpi-4-ext4-sysupgrade.img.gz , or build my own sysupgrade image?

create new vm, Type Linux Version: 5.x - 2.6 Kernel, select as bios OVMF(UEFI) and Machine i440fx, use scsi for HD
before start the vm you must edit the config file, usually in: /etc/pve/qemu-server/VMIDNUMBER.conf

? @Unknown, at first glance, the command line seems fine. Try troubleshooting the options.
Are you able to run the qemu-system-arm.exe by itself - that should print out some help messages. If so, add in more options and run again.

You can see many types of machine that can be emulated. We are going to be using versatilepb. We'll choose this machine because there is a handy repository dhruvvyas90/qemu-rpi-kernel that already contains QEMU kernels that can be used to emulate a Raspberry Pi. We could go the hard way and build the kernel ourselves and also create the DTB (Device Tree Blob, that describes the machine and the supported devices), but I still need to learn more so I can comfortably write about it. So in the meantime, we'll take advantage of the knowledge shared by the authors of qemu-rpi-kernel.

In QEMU, you need to "build" your virtual system by instructing QEMU to add each component of the virtual machine. Let's start by defining a virtual disk image that we'll use to install and run DOS. The qemu-img command lets you create virtual disk images. For FreeDOS, we won't need much room, so I created my virtual disk with 200 megabytes:

I only sort-of got QEMU working with the PiCroft image. I should note that I tried all this in a Windows environment. Perhaps QEMU on Linux would give better results. In any case, I fell back to VirtualBox approximation. Here is a good overview of approach: -a-raspberry-pi-on-virtualbox/
Note that as the author points out, VirtualBox is x86 only, and Pi is ARM. Also GPIO is missing. So this is not a true or complete virtualization. But it should still be useful to perform some general python and shell development. Also note that since the time of writing of that article, RaspberryPi group has started dual-build of Raspbian, one for ARM/pi and one for good old x86! So this brings us a little closer to simulating Mycroft.

df19127ead
Reply all
Reply to author
Forward
0 new messages