On your VMWare ESXi host, you can redirect an attached local USB device/flash drive/disk inside the virtual machine. This technology is called USB Passthrough and available starting from ESXi 4.1.
Suppose, our task is to redirect an external USB 3.0 drive locally connected to the ESXi 6.7 host into a virtual machine. We need to access a drive to quickly copy data directly from the VM to a separate USB drive.
VMWare USB Passthrough
The Passthrough mode allows to redirect a physical device connected to an ESXi host directly to the guest OS of a virtual machine. In the Passthrough mode you can grant a virtual machine the direct access to a USB drive, a modem or a PCI/USB controller.
To redirect a USB device in ESXi, you will need some main components:
- Arbitrator?is a separate service on an ESXi host that scans connected physical USB devices, routes USB device traffic between a host and a VM, and controls access to a device (only one VM may use a connected USB device). A USB arbitrator can track up to 15 USB controllers simultaneously.
- USB controllers — a uSB controller must be installed both on a physical host and on a virtual machine.
To install a USB controller for a VM on VMWare ESXi, open the VM settings and add a new device — a USB controller. When adding a USB controller, select its type:
- USB 2.0 (EHCI+UHCI) – a controller supporting USB 2.0 and USB 1.1 devices;
- USB 3.0 (xHCI) – supports fast USB 3.0 devices, requires virtual hardware version 8 or higher.
Passthrough a USB Device to ESXi VM
In the native USB Passthrough mode, you can connect a physical USB device from a host to a VMWare virtual machine.
The main requirements and restrictions of this redirection method:
- Virtual Hardware 7.0 or newer;
- You can provide direct access to a USB device for one VM only;
- The maximum number of redirected USB devices for a VM is 20;
- A VM boot from the attached USB device is not supported.
After adding a virtual USB controller for a VM, you can redirect a USB drive connected to the host:
- Add a new?Host USB device?in the VM settings and click ?Add;
- Select a connected USB device from a dropdown list to add it;
- To enable vMotion support for a VM with a connected physical USB drive, check the Support vMotion while device is connected option;
- Then the USB drive will appear in the guest OS of the virtual machine.
- You cannot stop or pause a VM. If you turn on the machine, you must manually migrate it to the host the USB device is connected to;
- DPM mode is not supported, since vCenter can shutdown a host with the connected USB device to save power;
- ESXi hosts with the VM and a physical USB device must be accessible via vmk0 over TCP Port 902.
If when adding a new USB device a vSphere client shows a message that no USB devices has been found (No available USB devices), it means that VMWare doesn’t support your USB drive for redirecting in the USB passthrough mode. You can find the list of compatible USB devices on the official VMWare website (the list is not long). Check the “USB Devices tested for Passthrough from an ESXi Host to a Virtual Machine in ESXi 6.7” section in the article?https://kb.vmware.com/s/article/1021345.
In this case you can redirect the whole USB controller to a VM from the ESXi host.
VMware PCI Passthrough (VMDirectPath): Redirect a USB Controller to a VM
Another, less convenient method to provide access to a physical USB device from a VM is to redirect the whole USB controller from the ESXi host. This mode is called?VMDirectPath. To use it, your server chipset must support?Intel Directed I/O?or?AMD I/O Virtualization Technology (AMD IOMMU), and this mode is enabled in the BIOS/UEFI settings.
If only one USB controller is installed on a server and you redirect it to a VM, you won’t be able to use USB devices connected to your host locally (keyboard, mouse). In this case, it is better to add an additional PCI USB controller to the server.
If a host has multiple USB controllers, you can identify a connected USB device and a controller number through the ESXi shell. To display the list of USB devices:
# lsusb -v | grep -e Bus -e iSerial
Find the line related to the USB drive in the output. For example:
Bus 002 Device 003: ID 0280:a00c Toshiba America Info. Systems, Inc.
Then identify a root hub and its iSerial by the controller number (Bus02, in this case):
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 3.0 root hub iSerial???????????????? 1 0000:00:1D.0
So we have got the number of the USB controller to be redirected to the VM.
0000:00:1D| Intel Corporation USB Chipset…
);Warning: The VM will not power on until its memory reservation equals its memory size
”, reserve some RAM for your VM.In the VMDirectPath mode, you can redirect up to two physical PCI devices to a VM.
Hyper-V also supports the redirection of physical USB devices to a VM.
3 comments
I do see my external hard drive under the list of USBs on the server. But when I try to mount it on the VM, I do not see it under the HOST USB device list. I have enabled USB controller 3.0 on the VM. The usbarbitrator service is on. Any clue what I am missing? I am using ESXi 6 and vsphere 6.7
Make sure that your external drive is in VMware’s list of supported USB pass-through devices. https://kb.vmware.com/s/article/1021345
Thank you, Admin. Yes, It is on the supported list. I am using Toshiba HD 3.0 1TB. I plugged it into the 3.0 USB port of the host. I see it under the list of USBs on the server, like when I do lsusb, it shows up. But when I am trying to mount it on a VM on that host, it doesn’t show up in the HOST USB device list. I do see other dongles. I saw in your second example that you are using Toshiba as well and it shows up for you. So, I was hopeful it should work for me.. but it doesn’t. :/ The HD is fine as I verified it by plugging it into an external laptop and no issues there. If you got any clue, please advise. Thanks!