The Recycle Bin

A repository of comments, code, and opinions.

Kernel Debugging: WinDbg and Virtual PC

with 4 comments

My new job has me doing a lot of device driver development, which naturally leads to quite a bit kernel debugging and system crashes.  Thankfully, with WinDbg and Virtual PC it is simple to set up kernel debugging for a virtual machine.  Since I am developing for a Windows environment, I am using Virtual PC 2007 and WinDbg.  This process will also work for Virtual PC 2004.  This is all probably possible with VMWare, Virtual Box, or any other virtual machine program out there, I am just not sure of the steps.  The following steps are all you need to get debugging, assuming that you have a Windows virtual machine already set up:

Step 1:  Edit the settings of you virtual machine to use a named pipe for a COM port  

Named pipe:
Add: \\.\pipe\vpcdebug

Step 2:  Edit boot.ini file on the virtual machine.

Right-click on My Computer
Edit start-up file manually:

I like to add a second line here instead. Copy the last line, and append it with the above line:
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

This will give you two different boot options, one for debugging and the other for normal use.

Step 3: Set up WinDbg for remote debugging over COM1.
This can be done through the File -> Kernel Debug menu, but I prefer to make a shortcut so I can have multiple different types of debugging environments.

Create a shortcut that points to WinDbg.exe and add the the necessary command-line arguments. Your shortcut target should look something like this:
"C:\Program Files\Debugging Tools for Windows\windbg.exe" -k com:pipe,port=\\.\pipe\vpcdebug,resets=10

 This is all you need to do to set up kernel debugging.  Be sure to start the VM before WinDbg so that it has a chance to create the named pipe.  Also, make sure you download the correct symbols for your environment.  For example:


Debugging Tools for Windows
Virtual PC 2007


Written by Nathan

June 11, 2007 at 7:49 pm

Posted in Uncategorized

Tagged with , ,

4 Responses

Subscribe to comments with RSS.

  1. […] The Recycle Bin A repository of comments, code, and opinions. « Kernel Debugging: WinDbg and Virtual PC […]

  2. […] my last post I explained how to set up kernel debugging with WinDbg and a Virtual PC running Windows XP.  I […]

  3. Thanks for the article, this is the 2nd time I’ve needed it!


    July 6, 2009 at 1:47 pm

  4. [url=]trądzik pospolity[/url]


    November 28, 2013 at 2:28 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: