Gentoo Archives: gentoo-user

From: Oliver Dixon <ash@××××××××××.uk>
To: Gentoo Users <gentoo-user@l.g.o>
Subject: [gentoo-user] QEMU -nographic Option with OVMF
Date: Mon, 24 May 2021 01:04:24
Message-Id: 20210524010115.dnp6lolmpfp55fzh@ad-gentoo-main
1 Hi,
2
3 I decided to bite the bullet yesterday and switch from clunky, and generally
4 untoward, VirtualBox to QEMU/KVM for developing kernel modules. I have a working
5 Gentoo VM with all the bells and whistles I need/want (UEFI booting, NIC
6 passthrough, SSH forwarding, NFSv4 support, etc.), but it's running in an SDL
7 window, which means the guest TTY will become confused and pretty much unusable
8 whenever I change the window size. (Which is rather often since I use a tiling
9 window manager.)
10
11 Since I'll only be using the TTY, the '-nographic' option to QEMU seems
12 appropriate, but this causes the initial bootloader screen (OVMF/EDK-II) and
13 GRUB to hang on stdout (screenshot attached). Here's my QEMU invocation script:
14
15 #!/bin/bash
16
17 exec qemu-system-x86_64 \
18 -enable-kvm \
19 -cpu host \
20 -drive file=Gentoo-VM.img,if=virtio \
21 -nic user,hostfwd=tcp:127.0.0.1:2222-:22 \
22 -m 4G \
23 -smp 12 \
24 -name "Gentoo VM" \
25 -bios /usr/share/edk2-ovmf/OVMF_CODE.fd \
26 -nographic \
27 $@
28
29 I have to spawn another terminal to kill the QEMU process. I can make a bit of
30 progress by telling the kernel to direct early messages to ttyS0, which does
31 display the early bootup messages from Linux, but then hangs just before a login
32 prompt would be shown (screenshot attached).
33
34 console=tty0 console=ttyS0,9600n8
35
36 Again, I can't do anything other than a `pkill qemu` from elsewhere.
37
38 Any ideas from someone more familiar with QEMU hosting Linux guests? I've only
39 been using it for a day, most of which has been trying to fix this annoying
40 behaviour.
41
42 Cheers.
43
44 --
45
46 Oliver Dixon
47 suugaku.co.uk
48
49 FD40 39CD
50 FDEB E22D
51 B265 6DFD
52 A9C4 3889
53 4CA9 3AEC

Attachments

File name MIME type
linux-hang.png image/png
grub-hang.png image/png
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] QEMU -nographic Option with OVMF Michael <confabulate@××××××××.com>