Score:0

QEMU freezes at "Booting from Hard Disk..." with -nographic

ca flag

A QEMU VM, both the host and guest OS being Ubuntu 20.04. QEMU 6.1.0 is compiled without any special parameters. The guest was installed from a downloaded iso image of Ubuntu server.

If I start the VM using

qemu-system-x86_64 -hda ubuntu.qcow -m 4000

, QEMU starts a VNC server and I can view in VNC Viewer that the guest Ubuntu OS is running properly.

But if I start the VM using

qemu-system-x86_64 -hda ubuntu.qcow -m 4000 -nographic

, QEMU prints out the following and freezes.

SeaBIOS (version rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org)
iPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+BFF8F290+BFEEF290 CA00
Booting from Hard Disk...

I can see from top that CPU is 100% busy with qemu-system-x86 at first and turns back to idle after a while. I guess the guest OS has finished booting successfully, but I can see nothing on the screen. What I want is that the guest can take over the console of the host and output to it. I did not find -console parameter, so I guess -nographic would do the job. Did I choose a wrong parameter? If so, how can I see the display of booting procedure and the login prompt of the guest Ubuntu? Thanks.

Score:0
in flag

Since you have no graphics and the OS does output there, then it is much expected that you don't get much.

You could configure bootloader, kernel, and shell to use serial. For the kernel it is something like console=/dev/ttyS0

For ubuntu there seems to be a guide at https://help.ubuntu.com/community/SerialConsoleHowto

ca flag
I have only a downloaded iso image of ubuntu, and installed the guest in a ubuntu.qcow. Do you have a recipe to "configure bootloader, kernel, and shell to use serial"? Do you want me to compile a whole Linux from source?
in flag
There is probably a guide for "Ubuntu on serial console" but that is a different question.
ca flag
PS, I tried `-curses`, but I was shown a blank window except "1024 x 768 Graphic mode" displayed at the center.
ca flag
By "Ubuntu on serial console", do you mean I force qemu to have only a serial console, so that qemu will not simulate a text console on graphics monitor? Do I have to compile Ubuntu from source, or reinstall from the downloaded iso image? Does this link the guide of "Ubuntu on serial console": https://topslakr.com/2021/02/install-ubuntu-20-04-lts-via-serial-console/
in flag
Ubuntu goes into graphic mode early, curses could work if you switch the software that runs inside of qemu to only use text mode. but the best is usually to configure the software that runs INSIDE qemu to use serial IO https://help.ubuntu.com/community/SerialConsoleHowto
djdomi avatar
za flag
most it looks like the question is an end-user question.i would suggest you to install proxmox from rpoxmox.com for easy learning
ca flag
by "software" do you mean the ubuntu guest OS?
ca flag
By "Ubuntu goes into graphic mode early" do you mean Ubuntu was designed to stick to graphics mode when it was developed many years ago?
in flag
I do think that the SerialConsoleHowto will resolve your issue. I do not think trying to explain why and how from the absolute basic level is appropriate here.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.