Adding USB Support to Hyper-V with Help of USB Redirector
Lack of USB support in Hyper-V is a major concern for many users who want to be able to access USB devices in their virtual machines. This greatly limits useability for solutions based on Hyper-V.
Many commercial software products use USB dongles for their licensing needs. They won't even start if dongle is not plugged. Thus you can not use them on Virtual Machine running as guest on Hyper-V host. There are many other softwares that require specific USB devices for their operation.
There are two posible solutions that allow to overcome this problem:
- Buy a separate hardware Network USB Hub, which is not really a scalable solution.
- Use software solution to pass-through USB devices from Hyper-V host to virtual machines.
USB Redirector is a software solution that allows to pass-through USB devices to virtual machines running on Hyper-V Host. And it not only redirects USB devices connected to Hyper-V host machine, but also devices connected to any computer on your LAN or Internet.
Sometimes it is quite tricky task to install additional software on Microsoft Hyper-V Server, as it is based on Windows Server Core that does not provide any interface for a user, except command line. Below we will provide instructions on how to install USB Redirector using a command line interface of Hyper-V Server. Here are the steps that need to be accomplished:
Before You Begin
You need to have a second PC which will be used to prepare a USB Redirector installer for running on Hyper-V host machine.
So, let's start! At first you should logon to your Hyper-V Server locally or through Remote Desktop and switch to Console window.
Installing USB Redirector on Hyper-V Server
Before you can install USB Redirector, you must extract usbredirector_setup64.exe installer file from USB Redirector package. And then start it on Hyper-V Server using one of the ways listed below:
- Burn the installer to CD or DVD disk, insert it into your Hyper-V Server and start installer from CD.
- Write installer to USB Flash Drive, attach it to the Hyper-V Server and start the installer from flash.
- Put installer to the network share and access it from your Hyper-V Server.
Installing From CD or DVD Disk
Use your favorite disk burning tool to burn the usbredirector_setup64.exe file to a disk. Insert this disk into CD/DVD drive on your Hyper-V Server and execute the following command in console:
Where D: is your CD/DVD drive letter. If you do not know exactly what is your CD/DVD drive letter, it would be a good choice to try several letters starting from A or type wmic logicaldisk get caption,description command to display all drives.
Installing From USB Flash
On another computer, write usbredirector_setup64.exe file to USB Flash drive. Insert the USB Flash into USB port on your Hyper-V Server and execute the following command in console:
Where E: is your USB Flash drive letter. If you do not know exactly which letter is used for your USB Flash, it would be a good choice to try several letters starting from A or type wmic logicaldisk get caption,description command to display all drives.
Installing From Network Share
Put usbredirector_setup64.exe to a shared folder on your computer. Then connect this share as network drive on Hyper-V Server with help of NET USE command:
NET USE X: \\MY-WORK-PC\Share
Where \\MY-WORK-PC\Share is a shared folder path in your LAN. This command will attach your shared folder as a network drive X: on Hyper-V Server. You may be prompted to enter a password to access the share.
To start installer, type the folowing command in console and press Enter:
Starting USB Redirector
After you finished installing USB Redirector, type the following command in console and press Enter to start it:
"C:\Program Files\USB Redirector\usbredirector.exe"
Assuming that USB redirector was installed in "C:\Program Files\USB Redirector".
Setting up Windows Firewall
Normally, USB Redirector would automatically set up firewall rules during installation. If for some reason it did not do this, please use the following command on Hyper-V Server host:
netsh advfirewall firewall add rule name="Allow incoming USB Redirector connections" dir=in protocol=tcp localport=32032 action=allow
This command will allow USB Redirector to accept connections from virtual machines. For more advanced firewall configuration see Netsh command documentation.
Installing USB Redirector Client on Virtual Machines
Installation of USB Redirector Client on virtual machines is no different from installing it on a normal computer. You just have to upload an installation package to VM and start the installer.