Enabling COM3 and COM4 in a Windows virtual machine
search cancel

Enabling COM3 and COM4 in a Windows virtual machine

book

Article ID: 342734

calendar_today

Updated On:

Products

VMware VMware Desktop Hypervisor VMware vSphere ESXi

Issue/Introduction

VMware documentation indicates that it is possible to use COM3 and COM4 in a virtual machine, however these ports do not appear in the operating system

This article discusses enabling COM3 and COM4 in a Windows virtual machine


Resolution

The VMware virtual BIOS can address two serial ports by default, but allows up to four COM ports total, and also three parallel ports. A similar technique can be used to enable the extra parallel ports, however this article concentrates on the serial ports only.
 
To enable the COM ports:
  1. Make note of the COM port assignments on the host. These are used later to direct the virtual COM ports to the physical COM ports.
  2. Power on the virtual machine and log on as an administrator.
  3. Open a command prompt. For more information, see Opening a command or shell prompt (1003892).
  4. Type set devmgr_show_nonpresent_devices=1 press Enter.
  5. Open the Device Manager.
  6. Click View > Show Hidden Devices.
  7. Uninstall all COM port devices listed.
  8. Make note of free IRQs for use in creating new COM port assignments. The default COM IRQs must be free unless a device has already been forced to an IRQ normally used by the COM ports.
  9. Shut down the virtual machine.
  10. Power on the virtual machine and enter the BIOS setup program.

    Click in the console window to give it focus immediately after powering on, then press F2 repeatedly to enter the virtual BIOS setup program.

    Notes:
    1. If the virtual machine is running under Fusion, click Virtual Machine > Power On To Firmware.
    2. If the virtual machine is running under Workstation Pro, click Virtual Machine > Power > Power On To Firmware.
       
  11. Go to BIOS Advanced settings > I/O Configuration section.
  12. Set Serial Port A and B to Enabled (do not use Auto). Keep the default I/O addresses and IRQ settings.
  13. Press F10 to exit the setup program and the save changes.
  14. Hard power off the virtual machine before the guest operating system loads.
  15. Map the virtual machine's COM port assignments to the COM ports on the host. Edit the .VMX file for the virtual machine, and add the following lines:

    serial0.present = "TRUE"
    serial0.fileName = "COM1"
    serial0.startConnected = "TRUE"
    serial0.irq = 4
    serial0.baseAddr = 0x3f8


    serial1.present = "TRUE"
    serial1.fileName = "COM2"
    serial1.startConnected = "TRUE"
    serial1.irq = 3
    serial1.baseAddr = 0x2f8


    serial2.present = "TRUE"
    serial2.fileName = "COM3"
    serial2.startConnected = "TRUE"
    serial2.irq = 4
    serial2.baseAddr = 0x3e8


    serial3.present = "TRUE"
    serial3.fileName = "COM4"
    serial3.startConnected = "TRUE"
    serial3.irq = 3
    serial3.baseAddr = 0x2e8
     
    If the host is a Linux PC, Edit the .VMX file for the virtual machine, and add the following lines:
     
    serial0.present = "TRUE"
    serial0.fileType = "device"
    serial0.fileName = "/dev/ttyS0 "
    serial0.tryNoRxLoss = "FALSE"
    serial0.autodetect = "FALSE"

    Important: The value listed in serialx.fileName = "COMx" correlate to the hardware ports on the host to rout the serial port traffic. All other lines determine the settings and resources used by the virtual COM ports presented to the virtual machine. Some adjustments may be necessary, use the information from step 1 to assist you.
     
  16. Power on the virtual machine and log on as an Administrator.
  17. Open the Device Manager. Verify that the new COM port devices are listed and have the correct Resource assignments. I f all COM ports do not show up within the guest, run the Add Hardware wizard from the Control Panel to allow Windows Plug & Play to detect the devices and install the drivers.

    Note: An additional COM port does not show up in the Device Manager with the same device name as the other COM ports, you must run update driver through the Device Properties dialog, Driver tab.
Note: This procedure may not work if the COM ports are assigned to files. In that case, the IRQs used cannot be shared. Instead, find unused IRQs in the guest operating system.

For example:
 
COM1 - IRQ4 - 0x3F8
COM2 - IRQ3 - 0X2F8
COM3 - IRQ5 - 0X3E8
COM4 - IRQ7 - 0X2E8
 
If the COM ports are listed in the Device Manager with a yellow exclamation mark, edit the COM ports and manually force the ports to use the IRQs that have been determined to be free in the previous step.