If you’re interested in virtualization technologies, you’ve heard of Hyper-V.
Hyper-V is a hypervisor (virtualization software) that lets run multiple operating systems on the same physical machine. Every guest OS created with the help of Hyper-V platform gets direct access to the hardware of a physical server (hard drive, memory, processor, etc.) Hyper-V virtualization environment is compatible with Windows and Linux operating systems.
With that, probably the most inconvenient thing about Hyper-V platform for me as well as for many other users is that the virtualization software does not provide USB pass-through support out of the box. Simply put, you cannot access USB peripherals attached to a local PC while working in Hyper-V virtual machine. To resolve this challenge, you need to either resort to the help of some dedicated third-party tools or look for a workaround among features of your host OS.
In this article we will consider two different ways of forwarding USB devices from a host PC to a Hyper-V virtual machine and compare the pros and cons of each method.
Let’s say you have Hyper-V OS installed on your PC. Working in the virtual machine, you realize that a USB dongle plugged into the host computer is not accessible from the guest operating system. You don’t necessarily care how to redirect USB over the network. You just want to connect USB device to Hyper-V VM as though it were connected to the virtual machine physically.
Now, let’s consider another way to provide Hyper-V USB device passthrough. If you connect to your Hyper-V virtual machine from a host PC over Remote Desktop Protocol (RDP), you can virtualize your local resources like hard drives, USB ports, etc. and make them accessible to the guest OS. This option is a good workaround for Windows OS users. The Windows 10 Hyper-V USB passthrough feature is available in the client options of the Remote Desktop Connection.
To forward USB devices to your VM over RDP, you need to follow these simple steps:
As you can see, there are different ways to add USB device to Hyper-V virtual machine. Considering the ease of use and the range of devices supported, it’s easy to see that the software tool, USB Network Gate, is a more convenient and efficient solution.
To connect a USB drive to a virtual machine install it as virtual hard disk in Hyper-V virtual environment. You can do it if you know the size of the drive, to find it out on your host machine click Computer, find your removable disk, right-click to display the context menu and go to Properties. General tab will have information on the size of your hard drive in Bytes and GB.
How to install a USB drive as a virtual hard drive:
If ‘My Computer’ does not show it as a removable storage, it might be because the drive is offline. To check it, go to your VM, right-click Computer, choose ‘Manage’ or ‘Administrative Tools’ and go to Computer Management.
Expand Storage and select Disk Management. Red arrow icon means that the disk is offline, right-click the disk and in the context menu displayed select Online. Once your disk gets Online status, a drive letter will be assigned to it.
There are certain drawbacks to this method: you will have to reproduce the entire actions sequence for each USB drive connected to your Hyper-V virtual environment. As we already mentioned, creating a vhd file might consume some time, it directly depends on the size of your USB disk.