Is there a Serial Port Xen/Dom0 Debugging Tutorial?

I want to debug a mysterious hard system crash related to a secondary PCIe GPU. I suspect that Xen or Dom0 is crashing due to a fatal error, and I know it should be possible to obtain the logs via my machine’s physical serial port. But I’m not sure about how and I couldn’t find a document for it. The only document I found was logging into Dom0 via tty (Safe remote dom0 terminals | Qubes OS), but what I want is obtaining low-level logs, not a getty console.

I did a quick search and all the results are about laptop debugging via Intel’s USB 3.0 xHCI’s serial functionality. I need documentation for the plain-old serial port.

How do I specify a logging serial port? How do I obtain raw Xen logs and kernel logs from the port? Could anyone point give me a pointer to the relevant Xen/Linux/Qubes documentation? Thanks!

Add these lines at the end of /etc/default/grub:

GRUB_CMDLINE_XEN_DEFAULT+=“com1=115200,8n1 console=com1,vga loglvl=all guest_loglvl=all sync_console=true sched_debug iommu=verbose apic_verbosity=debug console_timestamps”
GRUB_CMDLINE_LINUX+=“console=hvc0 earlyprintk=xen”

Then update grub:

  • for Legacy BIOS

grub2-mkconfig -o /boot/grub2/grub.cfg

  • for UEFI

grub2-mkconfig -o /boot/efi/EFI/qubes/grubx64.cfg


Thanks! Time to start looking for some jumper cables to plug into the serial header on my motherboard… :wink:

1 Like