Hyper-V 2012 R2 guest kernel debugging (UEFI VM)

Hello,

I am trying to debug a driver crash that only reproduces on 2012 R2 Hyper-V, and only on Gen2 (UEFI) VMs.
However, I can’t figure out how to connect a debugger to a Gen2 VM.

It is not possible to add a COM port or a legacy network adapter to a Gen2 VM.

I tried setting up Hyper-V native kernel debugging transport (by setting ‘DebugPort’ and ‘DebugPortEnabled’ properties on the corresponding Msvm_VirtualSystemSettingData WMI instance in the root\virtualization\v2 WMI namespace).

I can confirm that the native debugging transport is enabled for the VM - I see that the ‘vmwp.exe’ process listens on UDP 0.0.0.0:23337, which is the same port that I have configured in WMI.
However, I am stuck at setting up the guest system - there is no ‘kdvm.dll’ present on the guest.

And there seems to be no documentation in the Windows Driver Kit on setting up Hyper-V debug transport in the guest VM.

Does anyone have some suggestions?

Thank you.

Actually, the serial port is there, it just has to be configured from WMI/PowerShell as well (it is missing in the UI).
So, I got it working.

However, I am still curious about the synthetic Hyper-V debugging port - on Win8/2012, there was a ‘kdvm.dll’ module which could be used if the corresponding options were enabled on the VM.