Logging and debugging for qemu virtual machines

qemu

I had a qemu virtual-machine which crashed several times because HDD in hypervisor had no space left. This made me wonder is there a possibility to to set up a logging/debugging for quemu virtual-machines. I tried to start virtual-machine with -D /tmp/qemu-debug-log command:

qemu-system-i386 -D /tmp/qemu-debug-log -monitor pty -device e1000,netdev=tap0 -netdev tap,id=tap0 -m 512M -display vnc=:1 -drive file=FreeBSD10.2

..but this did not even create a /tmp/qemu-debug-log file.

In addition, qemu does not seem to write into messages or kernel ring buffer(dmesg). What are the best practices to enable logging for qemu virtual machines?

Best Answer

qemu command accepts a simple -D switch which can create a log file. So for example including -D ./log.txt will create "log.txt" in your working directory.

You can access more logging/debugging options via QEMU Monitor (e.g. qemu -monitor stdio).

Related Question