How to debug a virtual machine on a host computer that is running Virtual Server 2005 or Virtual PC 2004, part 1 of 2

Article translations Article translations
Article ID: 871171 - View products that this article applies to.
Expand all | Collapse all

On This Page

INTRODUCTION

This article describes how to debug a virtual machine on a host computer that is running Microsoft Virtual Server 2005 or Microsoft Virtual PC 2004. This article is not a complete description about how to debug a computer. Instead, this article covers only the basic steps and information that you must use to obtain debug output in a virtual machine environment. This article is part 1 of 2 articles. For more information about the other article that is part 2, click the following article number to view the article in the Microsoft Knowledge Base:
871170 How to debug the Virtual Server service on a computer that is running Virtual Server 2005 or Virtual PC 2004, part 2 of 2

MORE INFORMATION

To configure debugging in a virtual machine environment, follow these steps.

Step 1: Configure the virtual machine Boot.ini file

When you debug a virtual machine from a host computer that is running Virtual PC 2004 or Virtual Server 2005, configure the host computer with your debugging tools as you would in a typical debug scenario. However, you can use a higher baud when you debug a virtual machine. The computer that you want to debug is also known as the target computer. To configure the baud on the computer that you want to debug, follow these steps:
  1. Open the Boot.ini file by using a text editor such as Notepad.
  2. Copy the first line under the [operating systems] section, and then paste it under the last line item under this section. Typically, there is only one line item under [operating systems].
  3. Append the following information to the line that you pasted under [operating systems]:
    /DEBUG /DEBUGPORT=COMthe number of the COM port that you want to use for debugging /BAUDRATE=115200
    115,200 is the maximum baud that you can use, and this setting works most of the time. However, if you experience connection problems, reduce this value to one of the following:
    57600
    19200
    9600
    The Boot.ini file looks similar to the following:
    [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="Windows Server 2003, Enterprise" /fastdetect
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /fastdetect/DEBUG /DEBUGPORT=COM2/BAUDRATE=115200
  4. Save your changes to the Boot.ini file, and then quit the text editor program.
For more information about how to configure debugging and generate a memory dump file, click the following article number to view the article in the Microsoft Knowledge Base:
303021 How to generate a memory dump file when a server stops responding (hangs)

Step 2: Obtain and install a kernel debugger

Download a kernel debugger from Microsoft. To do this, visit one of the following Microsoft Web sites:
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx

http://www.microsoft.com/whdc/devtools/debugging/default.mspx
We recommend that you use the latest version of the kernel debugger that is available.

Step 3: Configure a serial port on the virtual machine

Configure a serial port on the virtual machine to connect the host computer to. Note that serial ports are also known as com ports. This serial port will be a named pipe. To configure this serial port, follow these steps.

Virtual PC 2004

  1. Start Virtual PC 2004.
  2. Click the virtual machine that you want to configure, and then click Settings.
  3. In the Setting list, click the serial port that you want to configure, click Physical serial port, and then click to clear the Wait for modem command to open port check box if it is selected.
  4. Click Named pipe, and then type \\.\pipe\name that you want to assign to the named pipe in the Named pipe box. For example, type \\.\pipe\com2.
  5. Click OK.

Virtual Server 2005

  1. Start the Virtual Server Administration Website program. To do this, click Start, point to All Programs, point to Microsoft Virtual Server, and then click Virtual Server Administration Website.
  2. Under Virtual Machines, point to Configure, and then click the virtual machine that you want to modify.
  3. Click the COM ports link.
  4. Under the serial port that you want to configure for debugging, click Physical computer serial port, and then click to clear the Wait for modem command to open port check box.
  5. Click Named pipe, and then type \\.\pipe\name that you want to assign to the named pipe in the Named pipe box. For example, type \\.\pipe\com2.
  6. Click OK.

Step 4: Attach the kernel debugger to the virtual machine com port

Connect the kernel debugger to the com port on the virtual machine that you want to debug.

Local computer

For a local computer, use one of the following commands:
  • kd -k com:port=\\.\pipe\pipe name,pipe,resets=0,reconnect
  • Windbg -y Symbol path -k com:pipe,port=\\VMHost\pipe\pipeName,resets=0,reconnect

Remote computer

For a remote computer, use one of the following commands:
  • kd -k com:port=\\physicalHostComputerName\pipe\pipeName,pipe,resets=0,reconnect
  • Windbg -k com:port=\\physicalHostComputerName\pipe\pipeName,pipe,resets=0,reconnect
The following considerations apply when you debug a virtual machine:
  • The Baudrate option is not used for named pipes.
  • Use the Resets=0 option to specify that an unlimited number of reset packets can be sent to the target computer when the host computer and the target computer are synchronizing. The Resets=0 option is used for Virtual PC virtual machines and for other virtual machines where the named pipes drop excess bytes.
  • The Reconnect option is used to cause the debugger to automatically disconnect the pipe and reconnect the pipe if a read failure or write failure occurs. Additionally, if the named pipe is not detected when the debugger is started, the Reconnect option causes the debugger to wait for the pipe with this name to appear. Use the Reconnect option for Virtual PC 2004 virtual machines and for other virtual machines that remove and then re-create their pipes during a restart operation.

Properties

Article ID: 871171 - Last Review: February 13, 2008 - Revision: 4.0
APPLIES TO
  • Microsoft Virtual Server 2005 Standard Edition
  • Microsoft Virtual PC 2004
Keywords: 
kbhowto kbinfo KB871171

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com