1
votes

So I'm using this site to setup Qemu on my Lubuntu VM.

https://azeria-labs.com/emulate-raspberry-pi-with-qemu/

My errors happen when im trying to run the Qemu but the screen appears as black and it says "Guest has not initialized the display (yet)."

Looking at the error it says:

Error: invalid dtb and unrecognized/unsupported machine ID

r1=0x00000183 r2=0x00000100

r2[]=05 00 00 00 01 00 41 54 01 00 00 00 00 10 00 00

Available machine support:

ID (hex) NAME

ffffffff Generic DT based system

ffffffff ARM-Versatile (Device Tree Support)

Please check your kernel config and/or bootloader.

As you can see I used the latest kernel and raspberry image (Buster), so I'm not exactly sure if that's contributing to the error, because the source im using is pretty outdated.

$ qemu-system-arm -kernel ~/qemu_vms/kernel-qemu4.19.50-buster -cpu arm1176 -m 256 -M versatilepb -serial stdio -append "root=/dev/sda2 rootfstype=ext4 rw" -hda ~/qemu_vms/2019-09-26-raspbian-buster.img

I couldn't do the redir part from the online example because for some reason it kept saying -redir: invalid option

Here is the visual output that it's giving me:

https://ibb.co/xDmj7D7 https://ibb.co/9YrmD2M

If anyone can tell me what I did wrong, the output should be something similar to the source im using thanks! : https://azeria-labs.com/emulate-raspberry-pi-with-qemu/

EDIT: Alright i've made some progress since the last time. So i forgot to include the dtb because buster needs this as well.

-dtb /.../versatile-pb.dtb \

https://github.com/dhruvvyas90/qemu-rpi-kernel Used the command format from there, but i encountered that my file was raw so i did a drive command to format=raw

Then another error popped up: vpb_sic_write: Bad register offset 0x2c

Solved with adding: -serial stdio source: https://github.com/dhruvvyas90/qemu-rpi-kernel/issues/75

It looks like im in the raspberry, but my Qemu still has a black screen saying: Guest has not initialized the display (yet)

2
I get the same when trying buster, it boots, but everything happens in the console where you launch qemu. Qemu creates a window, but it remains empty except for "guest hasn't initialized the display (yet)". However, when I try the same with an old Jessie kernel and image, it works as expected: the image boots in the qemu window. Maybe the dtb file that takes things differently? -- BTW, both images are raspbian lite, no GUI. - Luc VdV
As to my previous comment, this could be it too: I wasn't booting image files, but actual SD devices connected through USB, the image 'file' I used was /dev/sdb. The difference is that the Jessie image is one that was originally used in a Raspberry 2, while the Buster one comes from a Raspberry 3. - Luc VdV
-dtb /.../versatile-pb.dtb is what I needed to make it work. I renamed my img file to make it nicer: qemu-system-arm -kernel kernel-qemu-4.19.50-buster -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -drive file=rasp.img,format=raw,index=0,media=disk -dtb versatile-pb-buster.dtb - Seansms

2 Answers

2
votes

I had the same situation as described above with Raspbian Buster image and kernel. But when I switched to 2019-04-08-raspbian-stretch-full.img and kernel-qemu-4.14.79-stretch without any other changes, then I was able to get graphics (I mean mouse cursor, desktop, etc.) in QEMU. Looks like versatile-pb.dtb has to be corrected for Raspbian Buster.

Raspbian Stretch in QEMU

0
votes

I use the buster img and with the parameter -dtb versatile-pb-buster.dtb(you can download it from https://github.com/dhruvvyas90/qemu-rpi-kernel), then it works.