When debugging a Windows GINA, driver, or service it is sometimes necessary to debug a target computer from a second computer via the serial port. Using the same concept, you can debug a target VMWare computer from the host computer using a named pipe.
For this example, I am using VMWare Workstation 5.5.3 build-34685 with a Windows XP Professional SP 2 virtual machine. On the host computer (also Windows XP Professional SP2) I am using WinDbg 6.7.0005.0.
Part 1: Create a named pipe on the VMWare target machine.
- In VMWare Workstation select VM \ Settings from the menu.
- In the Virtual Machine Settings window select the Hardware tab (if not already selected).
- Click the Add button to launch the Add Hardware Wizard.
- In the Add Hardware Wizard Welcome screen click the Next button.
- In the Add Hardware Wizard Hardware Type screen select Serial Port and click the Next button.
- In the Add Hardware Wizard Serial Port Type screen select Output to named pipe and click the Next button.
- In the Add Hardware Wizard Specify Named Pipe screen do the following:
- Use the default pipe name of:
\\.\pipe\com_1
- Select This end is the server.
- Select The other end is an application.
- Tick the Connect at power on check box.
- Click the Advanced button.
- Use the default pipe name of:
- In the Add hardware Wizard Specify Advanced Options screen tick the Yield CPU on poll check box and click the Finish button.
- In the Virtual Machine Settings window click the OK button.
Part 2: Modify the VMWare target machine boot.ini file.
- Boot the VMWare target machine.
- Remove the read-only permissions from c:\boot.ini if they exist.
- Copy an existing Windows line and append the following to the end of it:
/debugport=com1 /baudrate=115200 /break
- Your boot.ini file should look something like this when you are done:
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional - Debug COM1" /fastdetect /debugport=com1 /baudrate=115200 /break
See “Boot INI Options Reference” for more info.
- Restart the virtual machine and select the new Debug boot option.
Part 3: Run WinDbg
- Launch WinDbg.
- Select File \ Kernel Debug from the menu.
- In the Kernel Debugging window do the following:
- Enter 115200 for the Baud Rate.
- Enter the following for the Port.
\\.\pipe\com_1
- Tick the Pipe check box.
- Remove tick from the Reconnect check box.
- Enter 0 for Resets.
- Click the OK button.
- WinDbg should connect and break.
You are ready to debug.