Quick Bites
- The blog provides an overview of VMware ESXi USB passthrough technology, detailing how physical USB devices can be connected to virtual machines
- It covers key components like the arbitrator, controller, and physical USB device, as well as requirements for USB 3.0
- The article explains the process of enabling USB passthrough, its functionality with vMotion, and discusses common limitations and considerations for effectively using USB passthrough in a virtualized environment
In today’s virtualized world in the enterprise datacenter, often, we no longer think about physical devices. However, there are times when physical devices must be connected to virtual machine guest operating systems. Perhaps one of the most common types of “physical” devices that can be attached to a VMware ESXi host is a USB storage device. There is a mechanism to attach devices such as USB to a virtualized guest operating system running on top of ESXi. This process is known as “Passthrough” and allows passing the physical device from the ESXi host through to the guest operating system running inside a vSphere virtual machine.
Table of Contents
- What is USB Device Passthrough?
- USB Device Passthrough Technology Overview and Limitations
- USB 3.0 Requirements
- Enabling USB Device Passthrough
- USB Device Passthrough and vMotion
- Takeaways
Keeping the discussion in the realm of USB devices, let’s take a look at VMware ESXi USB passthrough to see use cases, features, and configuration of the solution and where this may fit into the enterprise datacenter.
What is USB Device Passthrough?
VMware ESXi hosts can passthrough devices from the host to the guest operating system. This allows making use of the physical hardware inside the guest operating system. This can be done for performance, hardware, or other requirements. Perhaps one of the more common devices to passthrough from the ESXi host to a virtual machine is a USB device.
There are many reasons why you may use passthrough to present a USB device to a guest operating system. You may need to read or write files to a physical USB device from within a guest operating system in a virtual machine. There may be requirements to passthrough a physical USB device to a guest virtual machine to provide licensing information to vendor specific software running in the virtual machine.
USB device passthrough offers the ability to make use of the USB device for a guest virtual machine and can alleviate challenges that exist due to the virtual environment itself by allowing the physical USB devices to be used inside of the guest virtual machine.
How exactly does this technology work from the physical host side to the virtual machine?
What are the disadvantages and gotchas to utilizing the USB device passthrough functionality within a virtual machine that needs to be noted?
USB Device Passthrough Technology Overview and Limitations
Let’s discuss for a moment how the USB passthrough feature works when connecting a physical USB device to the ESXi host.
There are three requirements that make the USB passthrough mechanism possible:
- Arbitrator
- Controller
- Physical USB device
Arbitrator
The Arbitrator is the component that manages connection requests and then routes USB device traffic. This component is installed and enabled by default on the ESXi hosts themselves. This component scans for USB devices and then manages the device connections to the virtual machines. All USB device traffic is correctly routed to the virtual machine the USB physical device is connected to. It also prevents any other VM from using the USB device while it is being used by a particular VM.
Controller
The controller exists in both hardware and software form. First, the ESXi host itself has to have a physical USB hardware controller present to make the USB connection and communication possible. The virtual USB controller is the virtualized counterpart to the physical controller and virtualizes the USB host controller function to the VMs. A total of 8 USB controllers are available to each virtual machine. This controller virtual hardware component must be installed on the virtual machine before you can passthrough USB devices from the ESXi host to the VM.
Physical USB Device
Perhaps this is the most obvious of the components to get the USB device passthrough working, but you need a physical USB device to actually passthrough to the VM. A maximum of 20 USB devices can be attached to a single virtual machine. This is also the maximum number of devices that are supported connected to a single ESXi host.
USB 3.0 Requirements
USB 3.0 support was introduced in vSphere 5.5 patch 3 and higher. The support for USB 3.0 also added the ability to passthrough USB devices from client machines also to the guest virtual machine in addition to the longstanding ability to passthrough USB devices from the host to the guest. There is an additional virtual machine hardware requirement. The virtual machine must be configured with an xHCI controller and use Windows 8/Windows Server 2012 and later, or Linux kernel 2.6.35 and higher operating system.
Enabling USB Device Passthrough
Let’s take a quick look at the process to enable USB Device Passthrough to a virtual machine running on an ESXi host with a USB drive mounted. The process is fairly simple.
Edit the settings of a virtual machine. Choose Add New Device > Host USB Device.
The next step is to choose the New Host USB device you wish to passthrough to the virtual machine. If you have multiple devices connected, these will appear in the dropdown menu and that are already connected will be highlighted in red as you see below.
Select the free device you want to add.
USB Device Passthrough and vMotion
Contrary to what you might think, you can vMotion a virtual machine to another host. This is configured by specifying to support vMotion while device is connected in the settings of the new host USB device.
For this to work:
- Configure the device for vMotion as shown in the following
- Any suspend or power off operation once a VM is migrated to a different host, will result in the USB device being disconnected
- Linux may remount the USB device at a different location on the file system
- If a host is in a DRS cluster with DPM enabled, disable DPM for the particular host presenting the USB device
- For USB devices to be accessed remotely, the hosts must be able to communicate over the management network after a vMotion of the virtual machine. Also, IP address families must match. IPv4 will not be able to talk to IPv6 management IP addresses, etc.
Simply place a check in the checkbox for this setting.
Common limitations:
- A minimum of virtual hardware version 7 is required.
- Only one USB controller of each type can be added to a virtual machine.
- The USB arbitrator can monitor a maximum of 15 USB controllers. If your system includes more than 15 controllers and you connect USB devices to these controllers, the devices are not available to be passed through to a virtual machine.
- You must add a USB controller to a virtual machine before you can add a USB device.
- You must remove all USB devices from a virtual machine before you can remove the controller.
USB devices have these limitations
- A virtual machine may have up to 20 USB devices attached to it, however, each unique USB device can only be attached to one virtual machine at a time.
- Unsupported USB devices may not interact as expected with other ESXi/ESX features. For a list of supported USB devices, see Supported USB device models for passthrough from an ESX or ESXi host to a virtual machine (1021345).
- Before you hot-add memory, CPU, or PCI devices, you must remove any USB devices. Hot adding these resources disconnects USB devices, which may result in data loss.
- When you suspend and resume a virtual machine, USB devices behave as if they have been disconnected, then reconnected.
- The virtual machine cannot boot from the attached USB device.
Takeaways
USB Device Passthrough offers some very interesting possibilities when it comes to passing through USB devices of all types. This can be for storage purposes, licensing devices, or other peripherals that may need to be presented to the guest operating system of the virtual machine. VMware even allows passthrough USB devices to be vMotioned to a different host and remotely access the USB device on the host presenting the device to the VM. USB passthrough certainly has some limitations to be noted such as the inability to boot and various hardware requirements that must be met. Physical hardware is still a necessary evil that must be dealt with from time to time. The pass-through functionality allows gracefully enabling virtual machines to be able to utilize physical devices such as USB.
Related Posts:
Beginners’ Guide for Microsoft Hyper-V: Hyper-V USB Passthrough – Part-54
Beginners’ Guide for Microsoft Hyper-V: Hyper-V GPU Passthrough – Part 61
VMware for Beginners: A Step-by-Step Guide to Learn VMware and Boost Your Career
Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.