The QEMU PC System emulator simulates the following peripherals: Tldr.sh Synopsis qemu-system-x86_64 Description from USB to test bootable medium): qemu-system-i386 -hda /dev/ storage_device Specify amount of RAM for instance: qemu-system-i386 -m 256 -hda image_name.img -cdrom os-image.iso -boot d.Boot QEMU instance with a live ISO image: qemu-system-i386 -hda image_name.img -cdrom os_image.iso -boot d.Boot from image emulating 圆4 architecture: qemu-system-x86_64 -hda image_name.img.Boot from image emulating i386 architecture: qemu-system-i386 -hda image_name.img.
Debian's vmlinuz doesn't have prebuilt drivers to load a raw image from /dev/sda device. WARNING! Ubuntu's vmlinuz doesn't contain drivers for QEMU emulated network card devices (NIC).
Build from the scratch: Build Android Kernel and Run on QEMU with Minimal Environment: Step by Step.
Viola! You don't need the password and you can automate the remote QEMU guest.
-append "root=/dev/sda console=ttyS0": console=ttyS0 forces the guest kernel to send output to the first UART serial port ttyS0, which is redirected to the host by the -serial stdio option, and root=/dev/sda points the kernel to use a /dev/sda device to load the wheezy.img.-serial stdio or -nographic redirects input/output to the current terminal.Qemu-system-x86_64 -serial stdio -kernel vmlinuz -hda wheezy.img -append "root=/dev/sda console=ttyS0": 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
Now I've got a pretty decent collection of working recipes to tune up a QEMU guest, so I decided to organize all that stuff here, and it could be definitely useful for anyone else. While struggling to automate QEMU guest (communicate and control with the shell scripts), I faced with a lot of incomplete, partially working solutions around the internet.