Two Methods to Create a Hyper-V USB Passthrough

Virtualization allows you to share physical hardware resources between several virtual machines. But what if you need to access a physical device, such as a USB, from your VM? To accomplish this in a Microsoft Hyper-V environment, you need to create a Hyper-V USB passthrough. Let’s review the Hyper-V USB passthrough setup process.

What Is USB Passthrough and Why You Need It

Hyper-V USB passthrough is a mechanism that enables you to access physical resources from within a VM. You can use Hyper-V USB passthrough to copy and paste files to your VM and from your VM. A Hyper-V infrastructure does not offer native support for USB passthrough. However, you can set up a USB passthrough for your environment by using one of the two methods below:

– 1. Enabling Enhanced Session Mode
– 2. Using Remote Desktop Connection

What Are the Prerequisites for Establishing a Hyper-V USB Passthrough?

Depending on the approach you select, you need to fulfill certain prerequisites to get to your local resource from a VM.

For the Enhanced Session Mode method:

– 1. Satisfy Virtual Machine Connection (VMConnect) requirements by running Windows Server 2016, Windows 10, Windows 8.1, Windows Server 2012 R2, Windows Server 2012 or Windows 8 on your computer.
– 2. Ensure that your VM has Windows Server 2016, Windows Server 2012 R2, Windows 10, or Windows 8.1 to be able to connect to the USB drive.
– 3. Activate the Enhanced Session Mode policy
– 4. Enable the Enhanced Session Mode settings

For the Remote Desktop Connection approach:

– 1. Connect to the VM and open Remote System Settings
– 2. Select Allow remote access to enable remote desktop connections

Enabling Enhanced Session Mode

With the help of Enhanced Session Mode and Virtual Machine Connection tool, you can transport local devices and resources to a VM. Setup of the Enhanced Session Mode requires the following:

– 1. For Windows 10 and 8.1 the Enhanced Session Mode is pre-set by default. Check to ensure that it is set.
– 2. For Windows Server 2012 R2 and Window Server 2016 enable the Enhanced Session Mode manually. This method requires you to establish network connectivity to the host.

After ensuring that the mode is on, you can establish Hyper-V passthrough with Enhanced Session Mode by following the steps below:

– 1. Connect to a device that hosts the VM.
– 2. Open Hyper-V manager.
– 3. Right-click the name of the host and choose Hyper-V Settings.
– 4. In the Server panel, choose Enhanced Session Mode Policy and check the box Allow enhanced session mode.
– 5. In the User panel, select Enhanced Session Mode Policy and check the box Use enhanced session mode.
– 6. Click Ok to save the changes

At this point, you have established a Hyper-V passthrough with Enhanced Session Mode. Now it’s time to select a local device for connection. An example of such a local device could be a printer, local drive, audio device or a USB drive. To connect to the device, enter Hyper-V manager. Next, double-click on the VM’s name to start it. You will see a configuration window. Select Show Options to expand your VM’s configuration options and click the Connect button. In the next Window, select the Local Resources option. In the Local devices and resources section, pick a device or resource to use in your remote session (printer or clipboard) and click More.

Next, select two boxes to set up a VM access to your local USB device:

Other supported Plug and Play (PnP) devices
Devices that I plug in later
Click OK. As an option, you can choose Save my settings for future connections to this virtual machine. Then click Connect to apply the changes.

Using Remote Desktop Connection to Create a Hyper-V USB Passthrough

Go through the steps below to establish a USB passthrough by means of Remote Desktop Connection.

– 1. Enable remote desktop connections on your VM. To do so, establish a connection to your VM. Then access Remote System Settings in the Control Panel by clicking Control Panel > System and Security > Allow remote access.

– 2. In the System Properties window check two boxes:
Allow Remote Assistance connections to this computer
Allow remote connections to this computer

Then, click Ok.

– 3. After establishing a remote connection to your machine, enable an RDP session to connect to the USB device.
– 4. Run the mstsc.exe command to open the Remote Desktop Connection window. Then, go to Show Options, click the Local Resources tab and More button to choose your devices and resources.
– 5. Now, you need to select the devices and resources for a remote session. To do so, select the box next to Other supported Plug and Play (PnP) devices and click Ok.
– 6. Finally, to start an RDP session, click Connect. Make sure that the remote computer is secure, then reconfirm your selection by selecting Connect if everything is OK.

Note: You have a computer with a USB device connected to it. At this point, ensure there is a connection between this computer and the VM’s guest OS.

Protecting Your Hyper-V Environment

Before setting up your Hyper-V passthrough, create a solid data protection plan for your Hyper-V infrastructure. Your Hyper-V virtual and physical environment requires protection in case of a malware attack or data loss incident. Backups are the first line of defense when it comes to data loss. A modern third-party backup software offers affordable, reliable and user-friendly data protection for your virtual and physical environments. To learn more about backing up your Hyper-V infrastructure visit here.

Conclusion

If you need to access your USB device from a virtual machine, you need to create a USB passthrough. In this post, we covered two methods for setting up a Hyper-V USB passthrough: Enhanced Session Mode and Remote Desktop Connection. Don’t forget about the importance of protecting your Hyper-V environment from potential data loss. Use modern backup software to ensure the safety of your data at all times.