Cookie
Electronic Team, Inc. uses cookies to personalize your experience on our website. By continuing to use this site, you agree to our cookie policy. Click here to learn more.

A comprehensive guide to VirtualBox serial ports

Olga Weis Olga Weis Mar 28, 2024
VirtualBox COM port

VirtualBox: establishing and configuring virtual serial ports

Virtual serial ports created in VirtualBox are recognized by the operating system as a standard 16550A compatible UART device by default. The VBoxManage modifyvm command enables the port to replicate other types of UART devices. Virtual serial ports support data reception and transmission for two-way communication. Connectivity to the host machine is customized using the capabilities of its operating system.

Users set up virtual serial ports with the VirtualBox Settings tab or using the VBoxManage command. Up to four virtual serial ports can be configured for each virtual machine. Port numbers are assigned during configuration and typically replicate standard values such as COM1, COM2, etc. User-defined names are also an option when establishing virtual serial ports.

serial ports in vitrualbox settings

Port mode options and communication techniques in VirtualBox

Multiple choices are available when selecting the port mode which affects the virtual port’s connection. Your choices are:

  • Disconnected - The guest OS recognizes the device but treats it as if it is not connected to the port.
  • Host Device - This option links the virtual serial port to the host computer’s physical serial port. Paths reflect the format of the host OS. For example, /dev/ttyS0 is used for Linux and COM1 for Windows systems.
  • Host Pipe - This option creates a named pipe on Windows systems or employs a local domain socket on Mac, Linux, or Oracle Solaris. This is the preferred setup for creating pipe connections from software to the host OS.
  • Raw File - This mode saves the output of the virtual serial port to a file where it can be used to gather diagnostic data from the guest operating system.
  • TCP Socket - Using this mode establishes VirtualBox serial port passthrough and allows the serial data to be forwarded over TCP/IP networks. VMs can act as either a server or a client.

When multiple virtual serial ports are created, interrupt sharing should not be implemented if the ports use the same interrupt level to avoid communication conflict.

Users can establish communication between virtual machines with a null-modem connection. One of the VMs is configured as a pipe or socket that the second VM uses to connect to the first machine.

The TCP socket mode supports the creation of external connections to a guest machine’s serial port over TCP. VirtualBox supports both TCP server mode which is accessible with tools like telnet, and TCP client mode, suitable for virtual null-modem cables.

A knowledge of VirtualBox serial ports provides developers and system programmers with a valuable tool to extend the functionality of their VMs. The ports can be used for device sharing, kernel debugging, or establishing network bridges without requiring physical serial interfaces.

Setting up COM ports in VirtualBox

The following steps demonstrate how to establish and share virtual serial ports with your virtual machines.
1
Download and install Serial to Ethernet Connector on the computer that will share a physical serial port.
2
Launch the program and open the Server connection tab.
3
Provide the host machine’s COM port name and the TCP port that will monitor communication.
4
Select Create server connection.
5
Connect the serial port to the virtual machine in the Client connection tab on the guest operating system that will access the shared physical port.
6
Supply the TCP port name defined during server creation and the IP address of the host computer.
 Serial to Ethernet Connector
7
Select a name for the virtual machine’s serial port.
8
Choose Create client connection.

Video tutorial

VirtualBox enables you to access serial ports in virtual machine environments. After establishing a client connection, Serial to Ethernet Connector provides the guest VM with the same level of functionality when using connected devices as with a direct physical connection.

small logo Serial to Ethernet Connector
#1 at Serial Port Software
Serial to Ethernet Connector
Access remote serial port over IP Network for Windows
4.7 rank based on 243 + users
Get a download link for your desktop
Submit your email address to get a link for quick download on your desktop and get started!
or
Also Available:

Serial to Ethernet Connector [Linux]

Requirements: Linux 32-bit or 64-bit
Version 8.0.822 (25 May, 2021) Download the trial version →