Features | Documentation | Knowledge Base | Discussion Forums
![]()
Adding a serial port (named pipe) to your virtual machine. Make sure the machine is switched off. Right click on the virtual machine and select edit settings. Under the Hardware tab select add. Select Serial Port then Next. Select Named Pipe and enter a Pipe name (we will change the near end and far end in a mo) Click next and finish.
Using Serial Ports
The following sections describe how to use serial ports with VMware Workstation:
A VMware Workstation virtual machine can use up to four virtual serial ports. The virtual serial ports can be configured in several ways.
You can also select whether to connect the virtual serial port when you power on the virtual machine.
Using a Serial Port on the Host Computer
You can set up the virtual serial port in a virtual machine to use a physical serial port on the host computer. This is useful, for example, if you want to use an external modem or a hand-held device in your virtual machine.
To install a virtual serial port that connects to a physical serial port on the host computer, take the following steps:
You can set up the virtual serial port in a virtual machine to send its output to a file on the host computer. This is useful, for example, if you want to capture the data a program running in the virtual machine sends to the virtual serial port or if you need a quick way to transfer a file from the guest to the host.
To install a virtual serial port that connects to a file on the host computer, take the following steps:
You can set up the virtual serial port in a virtual machine to connect to an application on the host computer. This is useful, for example, if you want to use an application on the host to capture debugging information sent from the virtual machine's serial port.
To install a direct serial connection between an application on the host and a virtual machine, take the following steps:
Windows Host
![]()
You can set up the virtual serial ports in two virtual machines to connect to each other. This is useful, for example, if you want to use an application in one virtual machine to capture debugging information sent from the other virtual machine's serial port.
To install a direct serial connection between two virtual machines (a server and a client), take the following steps:
Windows Host In the server virtual machine
Two special configuration options are available for serial connections between a virtual machine and the host or between two virtual machines. These options are of interest primarily to developers who are using debugging tools that communicate over a serial connection.
Improving CPU Performance when Debugging
The first option must be set in the virtual machine settings editor. This option is useful when the serial port is being used by the guest operating system in polled mode as opposed to interrupt mode. Polled mode causes the virtual machine to consume a disproportionate share of CPU time. This makes the host and other guests run sluggishly.
To restore performance for applications on the host, in the virtual machine settings editor, select the virtual serial port, and check the Yield CPU on poll check box. This configuration option forces the affected virtual machine to yield processor time if the only task it is trying to do is poll the virtual serial port.
Changing the Input Speed of the Serial Connection
To use the second option, power off the virtual machine and close the VMware Workstation window, then use a text editor to add the following line to your virtual machine's configuration file:
serial<n>.pipe.charTimePercent = <x>
This option is useful if you want to squeeze every possible bit of speed from your serial connection over a pipe to the virtual machine. In principle, there is no limit on the output speed — the speed at which the virtual machine sends data through the virtual serial port. In practice, the output speed depends on how fast the application at the other end of the pipe reads data inbound to it.
<n> is the number of the serial port, starting from 0. So the first serial port is serial0.
<x> is any positive integer. It specifies the time taken to transmit a character, expressed as a percentage of the default speed set for the serial port in the guest operating system. For example, a setting of 200 forces the port to take twice as long per character, or send data at half the default speed. A setting of 50 forces the port to take only half as long per character, or send data at twice the default speed.
You should first use the guest operating system to configure the serial port for the highest setting supported by the application you are running in the virtual machine.
Once the serial port speed is set appropriately in the guest operating system, experiment with this setting. Start with a value of 100 and gradually decrease it until you find the highest speed at which your connection works reliably.
Examples: Debugging over a Virtual Serial Port
You can use Debugging Tools for Windows (WinDbg) or Kernel Debugger (KD) to debug kernel code in a virtual machine over a virtual serial port. You can download Debugging Tools for Windows from the Windows DDK Web site atwww.microsoft.com/whdc/devtools/debugging/default.mspx.
The following two examples illustrate how to use a virtual serial port to debug kernel code in a virtual machine:
Using either of these methods lets you debug kernel code on one system, without the need for two physical computers, a modem or serial cable.
Debugging an Application in a Virtual Machine from the Windows Host
![]()
In this example, you have kernel code to debug in a virtual machine (called the target virtual machine) and are running WinDbg or KD on your Windows host.
To prepare the target virtual machine, follow the steps for a Windows host in Connecting an Application on the Host to a Virtual Machine. Make sure you configure the virtual machine's virtual serial port as follows:
To prepare the host, make sure you have a recent version of Debugging Tools for Windows — one that supports debugging over a pipe. You need version 4.0.18.0 or higher.
When you are ready to begin, complete the following steps:
kd -k com:port=.pipe<namedpipe>,pipe
Then press Enter to start debugging.
Debugging an Application in a Virtual Machine from another Virtual Machine
In this situation, you have kernel code to debug in a virtual machine (called the target virtual machine) and are running Debugging Tools for Windows (WinDbg) or Kernel Debugger (KD) in another virtual machine (called the debugger virtual machine) on the same host.
This is useful if you are running VMware Workstation on a Linux host. The debugger virtual machine must be running Debugging Tools for Windows (WinDbg) or Kernel Debugger (KD) in a Windows guest operating system.
To prepare the target virtual machine, follow the steps for the server virtual machine for the appropriate host in Connecting Two Virtual Machines. Make sure when you configure the target virtual machine's virtual serial port that you select the Yield CPU on poll check box, as the kernel in the target virtual machine uses the virtual serial port in polled mode, not interrupt mode.
To prepare the debugger virtual machine, make sure you have downloaded Debugging Tools for Windows. Then follow the steps for the client virtual machine in Connecting Two Virtual Machines.
When you are ready to begin, complete the following steps:
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |