When login screen appears, send a login string: printf "root\n" > /tmp/guest.in Take an output from the guest cat /tmp/guest.out serial pipe:/tmp/guest redirects a guest's output to a /tmp/guest.out and allows to send input from host to guest via /tmp/guest.in. Start QEMU qemu-system-x86_64 -serial pipe:/tmp/guest -kernel vmlinuz -hda wheezy.img -append "root=/dev/sda console=ttyS0" Input/output through a named pipe (file) Create a named pipe mkfifo /tmp/guest.in /tmp/guest.out
Or qemu-system-x86_64 -serial stdio wheezy.qcow2 Or qemu-system-x86_64 -serial stdio -kernel vmlinuz -hda wheezy.img -append "root=/dev/sda console=ttyS0" If you want to see early boot logs, you should pass console=ttyS0 parameter to a Linux kernel command line: qemu-system-x86_64 -nographic -kernel vmlinuz -hda wheezy.img -append "root=/dev/sda console=ttyS0" Early boot messages in the host terminal console=ttyS0