Connect Kernel Debugger to a Virtual PC/Virtual Server virtual machine

Virtual Machine completely changes how people test software (Well, definitely me.). Create a virtual machine, enable undo disk, install your changes, test it. Does not work? Throw away the undo disk, and you have a brand new machine to work with.

For people working on drivers or critical system services, more often than not their test machines are always attached to a kernel debugger. You can also attach the kernel debugger to a virtual machine in a few single steps:

1. Map the COM port of the virtual machine to a named pipe. See the following picture for an example.


2. Enable debugging on the target machine

c:\>more boot.ini

[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /debug /debugport=com1

3. If the virtual machine is hosted on a different machine from where the kernel debugger is launched, make sure the kernel debugger can access the named pipe in the host machine. For the most part this means enable file sharing in the firewall.

4. connect kernel debugger to the target machine

C:\>kd -k com:port=\\MyVirtualServer\pipe\vpcxpcom1,pipe,resets=0,reconnect

Microsoft (R) Windows Debugger Version 6.6.0007.5
Copyright (c) Microsoft Corporation. All rights reserved.

Opened \\MyVirtualServer\pipe\vpcxpcom1
Waiting to reconnect...

Connected to Windows XP 2600 x86 compatible target, ptr64 FALSE
Kernel Debugger connection established.

Comments (1)

  1. J. Spammer says:

    You have no visible e-mail link and your suggestion box is closed, but that doesn’t stop our friends from posting on your old closed articles.  It only stops honest people from reporting by more acceptable means.

    Three friends posted really important links in your article

    Don’t miss them.  Search engines won’t miss them.  They’re still on display for all to enjoy.

Skip to main content