You can add up to four serial (COM) ports to a virtual machine. Virtual serial ports can output to physical serial ports, files, or named pipes.

You might want to add a virtual serial port to a virtual machine to make devices such as modems and printers available to the virtual machine. You can also use virtual ports to send debugging data from a virtual machine to the host system or to another virtual machine.

Note:

The virtual printer feature configures a serial port to make host printers available to the guest. You do not need to install additional drivers in the virtual machine.

Prerequisites

Power off the virtual machine.

Procedure

  1. Select the virtual machine and select VM > Settings.
  2. On the Hardware tab, click Add.
  3. In the Add Hardware wizard, select Serial Port.
  4. Click Finish to add the virtual serial port to the virtual machine.
  5. Select where the virtual serial port sends output.

    Option

    Description

    Use a physical parallel port

    Send output to a physical serial port on the host system.

    Use output file

    Send output to a file on the host system. Either locate an existing output file or browse to a directory and type a filename to create a new output file.

    Output to named pipe

    Set up a direct connection between two virtual machines, or a connection between a virtual machine and an application on the host system.

  6. If you selected Output to named pipe, configure the named pipe.
    1. (Windows host) Use the default pipe name, or type another pipe name.

      The pipe name must begin with \\.\pipe\ and must be the same on both the server and the client.

      For example: \\.\pipe\namedpipe

    2. (Linux host) Type /tmp/socket or another UNIX socket name in the first text box.

      The pipe name must be the same on both the server and the client.

    3. To send debugging information to an application on the host system, select This end is the server from the first drop-down menu and select The other end is an application from the second drop-down menu.
    4. To send debugging information to another virtual machine, select This end is the server from the first drop-down menu and The other end is a virtual machine from the second drop-down menu.
  7. To connect the port to the virtual machine when the virtual machine powers on, select Connect at power on.
  8. (Optional) On the Hardware tab, select the new serial port, select Yield CPU on poll, and click OK.

    This option is useful if you are using debugging tools that communicate over a serial connection. If the serial port in the guest operating system is being used in polled mode rather than interrupt mode, you might notice performance issues. This option forces the virtual machine to yield processor time if the only task it is trying to do is poll the virtual serial port.

What to do next

If you set up a connection between two virtual machines, the first virtual machine is set up as the server. Repeat this procedure for the second virtual machine, but set it up as the client by selecting This end is the client when you configure the named pipe.