qemu: seabios hangs for 10~15 sec at boot with `-machine q35`
Host environment
- Operating system: Gentoo Linux
- OS/kernel version: Linux x2 6.9.4-gentoo #1 SMP PREEMPT_DYNAMIC Fri Jun 14 23:06:20 CEST 2024 x86_64 AMD Ryzen 9 7950X3D 16-Core Processor AuthenticAMD GNU/Linux
- Architecture: x86_64
- QEMU flavor: qemu-system-x86_64
- QEMU version: QEMU emulator version 9.0.1
- QEMU command line:
qemu-system-x86_64 -machine q35
Emulated/Virtualized environment
- Operating system: Gentoo Linux
- OS/kernel version: Linux vt02 6.7.5-gentoo #2 SMP PREEMPT_DYNAMIC Sat Feb 17 22:14:37 CET 2024 x86_64 AMD Ryzen 9 7950X3D 16-Core Processor AuthenticAMD GNU/Linux
- Architecture: x86_64
Description of problem
Whenever i'm starting a virtual machine i'm having the issue that seabios (or at least that's what i see) hangs for about 10~15 seconds. In that time on of the cpu cores runs at 100%.
This issue isn't new actually. I'm having this already for quite some time and a i think for at least the last 2 major versions. I haven't looked into it since it isn't a big issue, just annoying.
Today i've looked into it and as far as i can see, this issue is always present with the flag -machine q35
, which is the default for my vm's. If i set it to -machine pc
, booting works as expected. However i also found a "workaround" where the vm's starting immediately (with -machine q35
enabled), which is by simply adding a iso image to the command line (via -cdrom) - even though it's not used.
This means:
- 15 sec delay: qemu-system-x86_64 -machine q35
- works immediately: qemu-system-x86_64 -machine q35 -cdrom /mnt/data/vm/isos/openSUSE-Tumbleweed-DVD-x86_64-Snapshot20230303-Media.iso
Please note that most of my vm's usually start booting from a kernel image directly (-kernel /mnt/data/vm/kernel/gentoo-latest -initrd /mnt/data/vm/kernel/initrd-v5.cpio.gz) - but even in that case settings a cdrom (image) would fix the issue. Also, the image needs to be a valid one, if i set an empty file or /dev/null the issue would remain. Further more, i have the same issue on a second computer. This also runs on Gentoo Linux and is also a AMD Ryzen. (in case this is relevant)
Steps to reproduce
- qemu-system-x86_64 -machine q35
- wait about 10-15sec before boot continues
Additional information
I was thinking to add an Screenshot of the hanging boot process, but the only text written there is: SeaBIOS (version 1.16.0-20220807_005459-localhost) with a blinking cursor below