I seem to recall being able to start qemu with only the terminal emulator output, with the graphic window disabled. And here I don't mean with the ncurses interface, that one is nice, but I want the output to flow directly into my terminal, to make cut and paste easier.
I have tried:
qemu -nographic binary.img # simply no display
qemu -curses binary.img # nice text output, but not directly flowing in the terminal
qemu -noframe -curses binary.img # same as above
qemu -nographic -curses binary.img
I guess an acceptable workaround would be for me to be able to resize the curses console to fit the terminal I am using. Right now it's annoying because it doesn't fit the terminal size...
qemu -curses binary.img
SeaBIOS (version 1.7.0-20120603_194846-gandalf)
iPXE (http://ipxe.org) 00:03.0 C900 PCI2.10 PnP PMM+07FC86A0+07F886A0 C900
Booting from Hard Disk...
[...]
Notice how the display is indented 12 spaces? Annoying. :)
Old question, but it might still interest people.
Short anwser :
ttyS0
valid on most PC. it would be something different on ARM system.Then the serial port and the QEMU are multiplexed on your output. You can switch between them with
ctrl-A + C + ENTER
.Long answer: check this blog, it's awesome.
Install SGABIOS -- ISTR that recent Qemu versions use it automatically when run with
-nographic
.You can update GRUB to pass the required options to the kernel. I'm using Ubuntu 18.04, and I did the following:
Update grub in the guest OS:
sudoedit /etc/default/grub
GRUB_CMDLINE_LINUX=""
toGRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,9600n8"
sudo update-grub
Reboot guest OS using the following:
I recommend adding
-nic user,hostfwd=tcp:127.0.0.1:2222-:22
or similar as an option as well, this will enable ssh connectivity viassh -p 2222 localhost
which gives a slightly nicer interface than the console.The console options are copied from tldp's remote serial HOWTO