emojifreak / qemu-arm-image-builder

Shell scripts to build Linux images for QEMU ARM emulator
GNU Lesser General Public License v2.1
14 stars 9 forks source link

I get the qemu monitor and nothing else #2

Closed revivalfx closed 3 years ago

revivalfx commented 3 years ago

I was able to get an armel image built using your debian script on a Debian 10 VM with QEMU 6.0 and mmdebstrap 0.7.x (qemu-arm-static had an assert failure during the mmdebstrap execution on a Ubuntu 20.04 VM).

Everything builds nicely and does not complain. I get the recommended invocation to run the newly created image and I only get a message regarding the vnc connection on port 5900. Connecting with VNCViewer, I only see the qemu monitor. Running a few commands (I've never used it before) it identifies as an armel instance.

However, there is no linux bootup visible or linux shell at all. I moved the same image from debian to Windows 10 and it gives the same behavior.

It seems like the script has worked but I think I'm missing something. What do you recommend?

emojifreak commented 3 years ago

No Debian armel kernel image can boot on QEMU. Every Debian armel kernel needs a real hardware to boot. E.g., linux-image-rpi needs Raspberry Pi 0W or 1.

revivalfx commented 3 years ago

Thank you for your response. That explains why I've never seen it referred to anywhere. However, I'm getting the same result with armhf. Is that not supposed to work as well? I've seen claims that it should work with QEMU.

emojifreak commented 3 years ago

Does Debian Installer https://www.debian.org/devel/debian-installer/ work for you? If not, it is a problem in QEMU.

revivalfx commented 3 years ago

Debian installer worked fine with aarch64, but for 32bit arm I ran into an issue of the installer not seeing the right size of the harddrive (only sees MB when I have defined GB).

Virtual disk 1 (vda) - 89.4 MB Virtio Block Device

I have used both mini.iso and the netinst.iso with the same results. The invocation is:

qemu-system-arm -M virt -cpu max -kernel vmlinuz -initrd initrd.gz -drive file=mini.iso,if=none,id=cd,media=cdrom,read-only -device virtio-blk-device,drive=cd -hda /media/debian10.9-arm32/debian-bullseye-armhf.img -device virtio-net-device,netdev=net0 -netdev user,id=net0 -m 1G -serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0

It says:

This probably happened because the selected disk or free space is too small to be automatically partitioned.

And when I choose to manually partition it:

Failed to partition the selected disk

This probably happened because the selected disk or free space is too small to be automatically partitioned.

Maybe you're right. Maybe it is qemu, but I've download very old debian arm32 bit qcow2 files and the work but I want to have something newer.

Where you ever able to get a working image for any 32 arm CPU with your script with an older version of qemu? I was having issues with QEMU 5.0 as I stated before so I compiled the latest 6.0. It was error free while running in your script.

This is the recommended invocation displayed at the end of your script:

qemu-system-arm -net nic,model=virtio -net user -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0,id=rng-device0 -drive if=virtio,file=/var/tmp/debian-bullseye-armhf.img,index=0,format=raw,discard=unmap,detect-zeroes=unmap -drive if=pflash,format=raw,unit=0,file=/usr/share/AAVMF/AAVMF32_CODE.fd,readonly=on -drive if=pflash,format=raw,unit=1,file=/var/tmp/debian-bullseye-armhf-efivars.fd -m 1024 -cpu max -machine virt

In both the armel and armhf case, when I run the image from windows and set the monitor to stdio, I get a pop-up window saying:

Start PXE over IPV4.PX-E18 Server response timeout Start HTTP.....

Then it drops you into the UEFI interactive shell.

This doesn't happen in linux. I've used qemu off and on for over a decade, but not this intimately. So if you can glean anything from all these details, I'd appreciate it.

emojifreak commented 3 years ago

I am not yet able to reproduce the symptom. After qemu-system-arm started, I selected View -> serial0. Then I got the following screenshot. What is your symptom...? Could you show the screenshot of serial0 by the qemu GUI? My qemu is running on Ubuntu 20.04 LTS amd64. Screenshot from 2021-05-27 09-14-29

emojifreak commented 3 years ago

I assume this is not an issue of the software here, and close this. If not, please reopen this and/or send a mention to me.