How to start qemu directly in the console (*not* in curses or SDL)

cursesdisplayqemuserialterminal

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. 🙂

Best Answer

Old question, but it might still interest people.

Short anwser :

qemu -nographic -serial mon:stdio -append 'console=ttyS0' binary.img

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.