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.

Hyper-V Serial Port Configuration: Step-by-Step Instructions

Olga Weis Olga Weis Mar 11, 2024

We’ve already taken the time to go over the ways in which to access COMs in a virtual machine (you can find the article here.) While Serial to Ethernet Connector is a great solution for COM in Hyper-V serial port passthrough, it’s worth checking out a few other options to add COM port to Hyper-V serial port—which we’ll cover below.

How to access Serial port in Hyper-V

If you need to connect to the serial port of a virtual machine, you’ll need the Serial to Ethernet Connector. Follow these steps to learn how to use this tool and use it to access the virtual port:
1
Get Serial to Ethernet Connector on both the virtual machine and the host operating system.
2
Start by opening the app in the VM. Open the “Connections” menu and select “New Server Connection”.
3
Fill in the necessary info about the port you’re going to share, including its number and the TCP port used to connect it.

Note: tick the checkbox to make the port virtual.
 serial to ethernet connector - create server com port
4
Press “Create”.
5
Now, switch to Serial to Ethernet on the host machine. Open “Remote Connections”.
6
If everything was set properly, the virtual machine port should appear on the list. Select it.
7
Set the client connection options, such as the port that will be used to receive the data.
8
Press “Create” once again, and you’re all done.

Video tutorial:

How to connect serial hardware to a virtual machine with PipeDream

For Virtual Machine users who want to add COM port to Hyper-V serial ports, PipeDream is an ideal option. This serial port in Hyper-V tool runs via the same server hosting Hyper-V (which is a virtualization host), bridging the gap between virtual machines and serial ports.

PipeDream works by transmitting data received from the serial hardware (whatever is plugged into the COM port), and helps the Virtual Machine recognize and access it (and vice versa).

Additionally, PipeDream doesn’t need a client-side element to run on a server, which makes Hyper-V serial support passthrough even more convenient. PipeDream doesn’t require any installation (device, software, or otherwise) on the participating virtual machine(s)—thus maximizing legacy OS/software compatibility, and reliable support for XP (and older) operating systems.

Hyper-V serial port access
14-day free trial

PipeDream allows guest virtual machines to control serial ports on the virtualization host (or other machines. This tool functions thanks to Hyper-V's named pipe support, meaning a network connection isn’t necessary for communication. Just create a pipe name in Hyper-V, and PipeDream will connect to the guest VM’s serial device once you start the PipeDream program.

Disclaimer: PipeDream serial port in Hyper-V software is compatible with Microsoft's Hyper-V, but is a 3rd-party tool with no affiliation to Microsoft. Our use of the term “Hyper-V” is not meant to endorse or affiliate with Microsoft Corporation.

For those with a Gen 1 Hyper-V virtual machine

Follow the step-by-step guide below to learn how to add COM port to Hyper-V
1
Run the Hyper-V Manager and open the Guest Machine’s Settings (the VM you want to establish);
2
Choose COM1 or COM2 from the new window (located in the left-hand hardware list);
3
This is the serial port allowing the virtual machine to access the serial device of your choice (AKA the port that appears in the VM may differ from the host’s physical serial port);
4
Connect the pipe named “PipeDream” to the guest’s serial port (do this by clicking on Named pipe, and type “PipeDream” as the name of the pipe—see image below for reference);
5
For those with a serial device on a remote computer, make sure the “Remote computer” checkbox is checked, and enter the machine’s name;
6
Click OK;
 pipe name

How to configure for Gen-2 virtual machines

For those running Gen-2 virtual machines, the pipe settings displayed above aren’t configurable using the GUI, thus, users must implement Powershell commands.
1
Open a Powershell session;
2
Execute Get-VM;
3
Copy the name of the virtual machine with the desired serial port;
4
Execute Set-VMComPort -Number < 1 or 2, for serial port COM1 or COM2 > -Path \.pipePipeDream
5
Use Get-VMComPort to confirm pipe creation (see the screenshot displayed below using a VM named “SillyRabbit” for example purposes).
 confirm pipe creation

But there aren’t COM ports for Gen 2 VMs, right…?

Frankly, the answer is a mix of yes and no (with the “no” mainly centered on default Hyper-V serial port passthrough capabilities.) The exciting news is, this is adjustable!

The screenshots below are from a Windows 8 VM (specifically utilizing media created in the previous section where the driver for the software-based keyboard was added.)

In the below example, you’ll see that settings for a basic gen-2 virtual machine lacks COM port options.

hyper-v settings

The reason being that, regardless whether serial ports are available or not, Gen-2 Hyper-V Manager never displays COM ports.

Below we’ll take a peak inside what PowerShell has to say:

PowerShell

Notice how PowerShell shows two available COM ports? However, if you open the guest machine’s Device Manager, there won’t be any COM ports listed for the VM.

Check out the example below (using COM1) to configure a pipe path for COM ports while a virtual machine is running:

configure a pipe path

As mentioned before, when checking the guest machine’s Device Manager, COM1 isn’t displayed—but once the VM is shut down and restarted, the desired COM port will now be available from the list (see below.)

device manager com port

For those experienced with kernal debugging, the remaining process is fairly simple and straight-forward—with just one minor exception specific to Gen-2 VMs (even more specifically UEFI-based computers using Secure Boot.)

Try Serial to Ethernet Connector
14-day free trial

Via msconfig, we’ve enabled kernel debugging for the VM on COM1. However, once we clicked OK, the following error message appears:

system configuration

Why? Because Window’s policy states that Secure Boot and kernel debugging aren’t compatible. This means that users should turn off the virtual machine, then disable Secure Boot from within the firmware settings.

enable Secure Boot

  1. Utilize msconfig once more to enable kernel debugging (this time will be successful);
  2. Restart the VM;
  3. Connect to the pipe via the parent partition’s windbg;
connect to the pipe
small logo Serial to Ethernet Connector
#1 at Serial Port Software
Serial to Ethernet Connector
Access remote serial port over IP Network
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
Available for: Serial to Ethernet Connector is compatible with Windows, Linux OS and Windows Mobile.

SEC for Windows

SEC for Linux