summaryrefslogtreecommitdiffstats
path: root/documentation/UEFI general/qemu_kvm_for_debug
blob: e166637294fa1aa06140deb1c5a3ecda6d496287 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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