Yesterday's blog prompted some questions about how to set up a debugger for a Windows OS running in a Hyper-V VM. I was surprised that I wasn't able to find good, publicly available, Microsoft issued documentation for this configuration. The first step is to configure the Windows OS in the VM to enable a kernel debugger on COM1. One would use these same steps if you were preparing the OS to be debugged using a null modem cable. Hyper-V will allow us to redirect the COM port so that we don't need such a cable. Start an administrative command prompt.
Turn on debugging with this command: bcdedit /debug on Configure the debugger to use COM1 with this command: bcdedit /dbgsettings SERIAL DEBUGPORT:1 BAUDRATE:115200
Note that these are the default settings and already exist in most bcd stores. However setting them again won't damage anything, and guards against a situation where the dbgsettings have been previously modified. Reboot so that the boot loader can read the new settings and configure the OS for debugging.
Read more: Ntdebugging Blog
QR: