qemu with serial output
Problem: You want to run a virtual machine in a terminal, tmux or screen.
Solution:
- Disable graphics
- Have a serial console in virtual machine
- Use the serial console from host terminal
Enabling serial console in Debian
vm$ vi /etc/default/grub
- add
console=ttyS0
toGRUB_CMDLINE_LINUX_DEFAULT
vm$ sudo update-grub
Starting qemu/kvm with serial console
$ kvm -nographic -serial mon:stdio -hda yourimage.img -smp 2 -m 1G
- kernel messages and login appear to terminal after a few seconds