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.

VirtualBox Serial Port Setup: an Extended Guide

Editorial Team Editorial Team
Updated: Jan 15, 2025

Leveraging serial devices can be difficult when working in a virtual environment. Some virtualization platforms do not provide native support for serial communication. For example, third-party solutions are necessary to create virtual COM ports in VirtualBox so virtual machines can access local serial peripheral devices.

Our extended guide discusses how to configure VirtualBox COM ports.
We will show you how to use TCP sockets and connect devices over a network to increase productivity and maximize the value of your serial devices.

Establishing VirtualBox COM Port Passthrough With Serial to Ethernet Connector

Serial to Ethernet Connector is a software solution designed to implement VirtualBox serial port passthrough, allowing you to connect a VirtualBox VM to a serial device. The software creates virtual serial ports inside the virtual machine that emulate the local computer’s physical serial interfaces. This solution enables a VirtualBox VM to access the serial ports and devices of network-connected Windows hosts.
logo
Serial to Ethernet Connector
4.9 Rank based on 372+ users reviews
Try for Free Free Trial available for 14 days
usb to remote desktop
This affords remote capabilities that increase the value of your company’s serial peripheral devices. Devices connected through virtual ports provide the VMs full control over the peripherals, just as if a direct physical connection had been established. Simply unplugging and connecting a different device to the local machine makes it available to any network-connected virtual session.

Connecting VBox VM to Host Serial Port via Serial to Ethernet Connector

1
Install Serial to Ethernet Connector on both the host (with the physical serial port) and the VBox VM.
Select your OS on the website, download the installer and run it
2
Set Up TCP Server on the host using Telnet in Serial to Ethernet Connector.
Select “Server connection” and choose Telnet in “Network settings”
3
Connect VM to Host Serial Port by opening "Remote connections" in the VM’s Serial to Ethernet Connector. Locate the host server, click "Connect," and create the virtual port.
Choose “Client connection” on the remote machine
4
Access Device on the VM through the virtual port, as if it were directly connected.
Your new connection can be seen in the list on the left
VirtualBox Serial Port Passthrough
14-day free trial

Video Tutorial to Work with Serial Port in VirtualBox

The following video illustrates how to use Serial to Ethernet Connector in VirtualBox.

Native VirtualBox Serial Port Setup

VirtualBox provide guest machines with support for virtual serial ports. When the port is enabled, a standard UART-compatible device is furnished to the guest machine’s operating system so data can be sent and received. Based on the host OS, there may be different setup and configuration procedures.

Virtual machines can be configured with up to four virtual serial ports. Users have control over parameters such as Port Number and Mode.

How to Set Up Serial Ports in Oracle VM VirtualBox

Creating Oracle VM VirtualBox serial ports can be valuable in multiple scenarios. This capability can streamline kernel debugging and allow you to connect to serial devices from your virtual machine. Following is a simple guide to configuring and utilizing COM ports in VirtualBox.

Step 1: Access the settings

You can access the VirtualBox setting in two ways.

  • In the VirtualBox GUI, navigate to the Serial Ports tab.

  • Use the command line and enter the VBoxManage modifyvm command. Section 7.8 of the VirtualBox user manual provides detailed information about this command.

Step 2: Configure the serial ports

  • Up to four serial ports can be configured in VirtualBox for each virtual machine.

A. Port Numbers must be assigned to each of the virtual ports. You need to assign port numbers with specific IO bases and IRQs. For example:

COM1: I/O base 0x3F8, IRQ 4
COM2: I/O base 0x2F8, IRQ 3
COM3: I/O base 0x3E8, IRQ 4
COM4: I/O base 0x2E8, IRQ 3
NOTE:
Custom I/O bases and IRQs can be specified if necessary to address particular usage scenarios.
B. Port Mode determines how the virtual serial port connects to the host machine or other VMs. The possible values are:

Disconnected - the port acts as if it is unplugged.
Host Device - links the virtual port to a physical serial port on the host computer.

  • Host Pipe varies based on operating system.

    Windows systems use a named pipe such as \\.\pipe\name.

    Linux and macOS systems will use a local domain socket in /tmp.

  • Raw File - selecting this option writes the serial data from the virtual ports to a file on the host machine.

  • TCP Socket determines how the virtual port will be used.

TCP Server - enables remote clients to connect to the interface over the network.
TCP Client - configures the port to connect to another network-attached server.

Step 3: Implement the configuration

Each port can be configured according to your requirements through VBoxManage command or the VirtualBox GUI. Following are examples of setting up the port as a server or client.

  • To set COM1 as a TCP Server, enter this command:

    VBoxManage modifyvm "VM name" --uart1 0x3F8 4 --uartmode1 tcpserver 2023

  • To connect COM2 on a client to COM1 on a Windows host, use this command:

    VBoxManage modifyvm "VM name" --uart2 0x2F8 3 --uartmode2 hostdevice "\\.\COM1"

Step 4: Verify the setup

Launch your virtual machine to verify the ports are configured correctly and that they are recognized by the operating system.
Serial to Ethernet Connector
Access remote serial port over IP Network for Windows
14-day Free Trial available
License price starts at $259.95
Available for