The need comes up occasionally to attach a USB device to a virtual machine (VM). But with the current iteration of Hyper-V as well as Hyper-V “R3” that is coming with Windows Server 2012, currently in beta, the ability to directly connect a USB device is still a challenge as it is not supported.
To be fair, in my virtualization practice I have little desire to manage USB devices being attached directly to virtual machines, primarily, to ensure the VM can still migrate. There are situations where it is unavoidable. One example is USB license keys. As an administrator, these come up from time to time – but the last thing I want to do is avoid deploying a Hyper-V VM just for a license key. For Hyper-V VMs, we have some tricks that we can’t use in the vSphere world (See my recent post on adding USB devices to vSphere VMs).The options have increased lately, specifically, as the Digi AnywhereUSB line of Ethernet-attached serial devices have added some larger and smaller units. This includes a 2-port as well as a 14-port model and models that provide both USB and serial devices. Figure A below shows the 14-port device:
A USB device server by Digi
The real problem that is being solved here is Live Migration as well as the lack of USB support for Hyper-V. Live Migration would break the access to locally-attached USB devices, should Hyper-V support it. Further, the device servers will also allow multiple systems to connect. This means that the 14-port device pictured above can have up to 14 VMs connect to it for one USB device each. Should a VM need multiple USB ports, that won’t be an issue either.
The guiding principle with these devices is that the USB driver is extended to the Ethernet network, and the Digi device provides the USB port to the VM. In terms of performance, it won’t be as fast as a locally attached device on a physical system. So, this is not a solution to fill up a 2TB drive with data for a backup or such. It may, however, be a great use case for license keys, which some software may require.
Now, just to be clear, Hyper-V VMs can run from USB devices like a hard drive that contains the .VHD or .VHDX file, but the USB device isn’t directly accessible to the Hyper-V VM.
Do you have Hyper-V VMs that need USB devices connected to them? What tricks have you employed? Share your comments below.
Rick Vanover is a software strategy specialist for Veeam Software, based in Columbus, Ohio. Rick has years of IT experience and focuses on virtualization, Windows-based server administration, and system hardware.