Hyper V Serial Port Redirector


Links a serial COM port to a named pipe. This command-line utility was developed to allow Hyper-V virtual machines to use the host machine's COM ports. It currently runs in the console on Windows only, and has been tested on Windows 10 Pro. A compiled executable can be found in bin Release. Feel free to modify the source code and use as desired. Once the USB storage device is offline, open the Hyper-V Manager, right-click on the VM that needs access to the USB device, and then choose the Settings command from the shortcut menu. Summary: Learn how to attach a device from your Hyper-V host to your VM by using a new feature of Windows Server 2016. Today we have a guest blogger, Rudolf Vesely, who has blogged here on previous occasions. Here is a link to his previous posts if you would like to read them.

Accessing USB devices from virtual environments such as VMware and Hyper-V is useful in many situations. In this article, we are going to show you how to make a USB recognizable in Hyper-V either as a host or client.

I ran into an issue where I virtualized a Win2K3R2 server onto a Hyper-V on 2K8R2 where I needed to share the COM1 port. Hyper-V does NOT support COM port sharing, unlike Virtual Server or Virtual PC. After much searching on the internet I came across this website that gives a how to on sharing a COM port over TCP/IP, and it works like a charm! Start the Hyper-V Manager and bring-up the Settings for the guest vm where you want to connect the serial port. In the new window, select COM1 or COM2 from the hardware list on the left. This is the serial port where the virtual machine will be able to access your serial device. In other words, this port appears in the virtual machine and may. To perform Hyper-V USB passthrough with Enhanced Session Mode, you need to take the following steps: Connect to a computer hosting the VM. Open Hyper-V Manager. Right-click the host’s name and select Hyper-V Settings. In the Server section, click Enhanced Session Mode Policy and check the box Allow enhanced session mode.

Hyper-V USB Passthrough is the ability to access USB devices from within Hyper-V (formerly known as Windows Server Virtualization)

Table of contents:

All you need to do is specify the pipe name in Hyper-V and use PipeDream to redirect a serial device to your guest OS. Open Hyper-V Manager, go to Settings of the required virtual machine and choose COM1 or COM2 from the list of available hardware.

Access USB in Hyper-V in 3 clicks


USB over Network (aka USB Network Gate) provides a solution to the question of how to access a USB in Hyper-V. The specialized communication software enables you to attach USB devices in Hyper-V by sharing USB devices across a network.

14-day free trial

USB Network Gate is a client-server solution, meaning that its server-side gives access to USB devices to other computers on the network or to Virtual Machines, and client-side allows using them as local resources. You can use any computer connected to the network as a server, either Windows 10, Mac or Linux one.

Here’s how to access USB in Hyper-V by employing the dedicated software solution of USB Network Gate.


This solution requires just a few easy steps to implement Hyper-V USB passthrough. No additional hardware or configuration is required.

  1. Install the software on the host and guest operating systems.

  2. Share a device that is physically attached to the host over your network.

  3. On the client VM locate the USB peripheral in the application and click ‘Connect’.

That’s how to mount a USB flash drive in Hyper-V. It really is that easy. You will see the peripheral in your VM’s Device Manager and be able to access it as if it was directly connected to your machine.


Pros and cons to access USB in Hyper-V with USB Network Gate


Pros

  • Virtually all USB devices are supported.
  • Simple configuration to implement USB access across the network.
  • USB Network Gate is compatible with the Linux, Mac and Windows operating systems including Windows 10.
  • Creates secure USB connections.

Cons

  • USB Network Gate is commercial software and has a financial cost.
  • Network connectivity is needed to redirect USB traffic.

Related Articles

How to get Hyper-V to recognize USB


Hyper-V USB passthrough can be performed at the client Hyper-V level or at the host level if you are connecting to USB devices.

Server-side USB passthrough in Hyper-V


It is not as easy to implement Hyper-V USB passthrough as it is to set it up in VMware. Let’s take a look at how it’s done in the following step-by-step demonstration.

  1. We will attach a 32GB USB flash drive into a Hyper-V server and designate it as Drive E. The host operating system immediately sees the drive as available system storage.

Note: A potential issue is that direct access to the USB device is limited to one operating system at a time. In order to make the device available to the Hyper-V clients we need to take it offline and remove the logical connection to the host OS.

  1. We do this by opening the machine’s Run prompt and executing the DISKMGMT.MSC command. This starts the Disk Management console. Locate the entry for your USB disk and right-click on the disk. You need to use the actual disk, not the drive letter or volume name.
    There is an Offline option in the shortcut menu which will be used to take the disk offline.
Hyper V Serial Port Redirector

Note: The Disk Management Console might not offer the Offline option for small USB storage devices. If that is the case, passthrough for USB in Hyper-V will not be able to be implemented.

  1. Open the Hyper-V Manager after you have successfully taken the USB device offline.

  2. Select the VM that requires access to the device. Right-click on it and select Settings from the shortcut menu which opens the VM settings screen.

  3. Next, you need to select the Hard Disk option for the SCSI controller and click the Add button.

  4. When the next screen displays, select the Physical Hard Disk option and use the drop-down menu to select your USB storage device.

Now the Virtual Machine should be able to recognize and access the USB device. You may need to use the VM’s Disk Management Console to add a drive letter if the device is not immediately visible.

Related Articles

Hyper V Enhance session mode - access USB with RDP client


To copy files between virtual machines in earlier versions of Hyper-V you employed a network file copy or Remote Desktop Connection session. Both of these options entail having an operational network connection. Using the Virtual Machine Connection limited the amount of data that could be sent to the VM.

A similar method is used in enhanced session mode but the requirement to connect to the VM over the network is eliminated. All that is needed is a network connection to the Hyper-V host where the VM is running.

This feature of enhanced session mode can be instrumental in cases where a VM needs to interact with local devices but may not be able to achieve network connectivity. Here are some examples:

Hyper
  • Printing to a local printer from a VM
  • Using a USB-attached reader to log into a VM using a smart card
  • Debugging issues encountered with a VM without requiring it to be network connected

Developers can make use of Microsoft Hyper-V USB passthrough to test and debug USB applications from within a VM without relying on Remote Desktop Connection.

Hyper-v Com Port Redirection

  1. Hyper-V Manager is used to configure enhanced sessions. Simply select the Hyper-V server to be configured and click on ‘Hyper-V Settings’.
  2. Enable server settings in the Enhanced Session Mode Policy which will be used for all VMs running under the Hyper-V host. Enabling the allow enhanced session mode setting determines if the guest VMs can make use of enhanced sessions.
  3. When enabled, enhanced session mode connections are allowed by Hyper-V if certain conditions are met. They are:
    • ✔ The OS of the virtual machine supports enhanced session mode.

    • ✔ The VM is running Remote Desktop Service.

    • ✔ The Virtual Machine Connection tools requested an enhanced session mode connection.

Disabling the allow enhanced session mode setting forces the Virtual Machine Connection tool to use the methods previously seen in pre-R2 Hyper-V releases.

Enabling User Settings


Enhanced session mode is used to configure user settings. Enabling this setting allows the Virtual Machine Connection tool to use enhanced session mode if it is available in the guest VM. The following conditions must be met for enhanced session mode to be used:

  • The OS of the guest VM supports enhanced session mode.
  • Remote Desktop Service is running on the guest.
  • Allow enhanced session mode is enabled on the Hyper-V host.

Bottom Line


So, does Hyper-V support USB devices? As we have demonstrated, the answer is yes. You can enable USB support in a few different ways, but we believe that using the USB Network Gate application is the easiest and most effective solution. It will save time when compared to using Hyper-V enhanced session mode and any other solution.


It can be extremely useful to be able to access a USB dongle when working in virtual environments such as Hyper-V and VMware. This article intends to show you how to implement Hyper-V USB dongle passthrough so your device can be recognized by a Hyper-V host or client.

USB passthrough is the terminology used to describe the process of enabling a virtual machine (VM) to access a USB dongle. This can be done with a Hyper-V USB license dongle or by implementing passthrough at the Hyper-V host level.

14-day free trial

The Problem of Hyper-V USB Dongle Redirection


When you are in the active window of a running virtual machine, you cannot access USB devices that are connected to the host computer. In order for Hyper-V to connect to a USB dongle you need to redirect its traffic away from the host to the guest VM. This may not be possible due to the limited number of USB ports on the virtual machine. There may not be any ports available.

Solution:

USB Redirector software solves this issue and allows you to redirect a USB dongle to Hyper-V virtual machines. With this utility, you can access any network-attached USB device in your virtual machine. This allows you to work with USB dongles that are not in physical proximity to your VM. Just follow this simple procedure to make this possible.

Steps for Hyper-V USB Dongle Redirection

Install the USB Network Gate application on the physical and virtual machines
Share a USB dongle that is attached to a physical server. This can be any computer that is attached to your network.
After the USB dongle has been shared from a server it can be accessed by a virtual client machine. Use USB Network Gate on the VM to establish communication with the USB device.

Hyper-v Serial Port Redirection

Your Hyper-V Device Manager will display the shared USB dongle. At this point, the virtual machine can use the dongle just as if it had a direct physical connection to the equipment.
14-day free trial

Related Articles

The pros and cons of using USB Redirector to enable Hyper-V USB Dongle support:

Pros


  • Cross-Platform compatibility supporting the Windows, Linux, and Mac operating systems
  • Minimal network configuration is required.
  • Support for a wide variety of USB devices
  • Stable USB connections

Cons


  • Network connectivity is required to implement USB dongle redirection.
  • The software is a paid, commercial application.