diff options
Diffstat (limited to 'documentation/UEFI general/qemu_kvm_for_debug')
-rw-r--r-- | documentation/UEFI general/qemu_kvm_for_debug | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/documentation/UEFI general/qemu_kvm_for_debug b/documentation/UEFI general/qemu_kvm_for_debug new file mode 100644 index 0000000..e166637 --- /dev/null +++ b/documentation/UEFI general/qemu_kvm_for_debug @@ -0,0 +1,26 @@ +This is how I generally use qemu for debugging: + +sudo qemu-system-x86_64 -L . -serial pty -serial pty -monitor stdio \ + -drive file=/dev/local/virt-ovmf,if=ide,id=drive-ide0-0-0 \ + -nographic -S + +This command: + + Creates two serial ports: one for the OVMF debug output, and one for a usable serial console + + Uses a LVM block device, /dev/local/virt-ovmf as the local storage + Disables graphic output + Starts the qemu monitor prompt on stdio + Tells qemu not to start the machine right away. + +I then: + + start two screen sessions on the PTYs that qemu prints + + start it by typing c at the monitor prompt + +During boot, I get the OVMF debug output on the first screen session, and once the machine is booted, I get a login prompt on the second screen session. For this to work, you'll need to configure init to create a getty session on the serial ports. To do this from within your virtual machine: + +cd /etc/init/ +sed s/tty1/ttyS0 < tty1.conf | sudo dd of=ttyS0.conf +sed s/tty1/ttyS1 < tty1.conf | sudo dd of=ttyS1.conf |