Build from the scratch: Build Android Kernel and Run on QEMU with Minimal Environment: Step by Step.vmlinuz (i386): compressed bootable Linux kernel.wheezy.img (i386): non-bootable Debian "Wheezy" image (without kernel) to use with own kernel ( -kernel vmlinuz). Login/password: "root"/"root", and "user"/"user". wheezy.qcow2 (i386): bootable Debian "Wheezy" image a QEMU copy-on-write format.Viola! You don't need the password and you can automate the remote QEMU guest. Restart SSH daemon on the guest: # Guest.Fix the /etc/ssh/sshd_config on the guest: PasswordAuthentication no.ssh directory, and concatenate to authorized_keys. Or mount device locally, put the public key to the. 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 -hda wheezy.img is a raw image which is suitable for booting with vmlinuz binary ( wheezy.qcow2 won't be recognized in the block device).ģ.-kernel vmlinuz loads the kernel from the local "./vmlinuz" file.-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
0 Comments
Leave a Reply. |