4

At How to run Ubuntu 16.04 Desktop on QEMU? I have described in detail how to boot and install the desktop Ubuntu image on QEMU.

Now I wanted to do a similar setup for the server image to try keep things more minimal:

wget http://releases.ubuntu.com/18.04/ubuntu-18.04.1.0-live-server-amd64.iso

I have installed the server image with the GUI previously, and the setup seems to be text based, so I thought it might work.

But then, if I just add the usual:

-nographic -serial mon:stdio

as in:

qemu-system-x86_64 -cdrom ubuntu-18.04.1.0-live-server-amd64.iso \
  -drive file=ubuntu-18.04.1.0-live-server-amd64.img.qcow2,format=qcow2 \
  -enable-kvm   -m 2G   -smp 2   -vga virtio -nographic -serial mon:stdio

I just never get anything on the terminal serial.

I also tried to mount the image to see what was inside:

mkdir mydir
sudo mount ubuntu-18.04.1.0-live-server-amd64.iso mydir

to see what was inside, and:

cat mydir/boot/grub/grub.cfg

indicates that there is no console=ttyS0 option on the command line, which might explain why the terminal is empty.

I can't edit the ISO file however without first going into a GUI session, as it is mounted readonly.

I have already used the Cloud image previously, and it is great: Is there any prebuilt QEMU Ubuntu image(32bit) online? but I can't use it this time because I need GRUB for something (edit: nevermind, the cloud image does have GRUB, just it is hidden by default, see: How to get to the GRUB menu at boot-time using serial console? )

Related: How to get to the GRUB menu at boot-time using serial console? I managed to get GRUB to show on the terminal after changing the GRUB configuration with the GUI as shown in that thread.

Tested on an Ubuntu 16.04 host.

Ciro Santilli OurBigBook.com
  • 26,663
  • 14
  • 108
  • 107

1 Answers1

0

There is this option you can give qemu:

-display curses

   Display video output via curses. For graphics device models which support a text mode, QEMU can display this output using a curses/ncurses interface.Nothing is displayed when the graphics device is in graphical mode or if the graphics device does not support a text mode. Generally only the VGA device models support text mode.

source: https://www.qemu.org/docs/master/system/invocation.html?highlight=curses

But im asuming this wont fix the problem or is a solution for your or others problem.

CodeAsm
  • 1
  • 2