Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Virtualization / VMWare / Configuring USB Devices Passthrough from VMWare ESXi to a Virtual Machine

February 26, 2021 VMWare

Configuring USB Devices Passthrough from VMWare ESXi to a Virtual Machine

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.

Contents:
  • VMWare USB Passthrough
  • Passthrough a USB Device to ESXi VM
  • VMware PCI Passthrough (VMDirectPath): Redirect a USB Controller to a VM

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.
USB 3.0 mode is available starting from vSphere 5.5 patch 3. To support it, an xHCI controller must be running in a guest OS. Windows 8.1/Windows Server 2012 R2 and Linux with the kernel version 2.6.35 or newer are supported as a guest OS.

adding new usb controller to vmware virtual machine

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:

  1. Add a new Host USB device in the VM settings and click  Add;
  2. Select a connected USB device from a dropdown list to add it;
  3. To enable vMotion support for a VM with a connected physical USB drive, check the Support vMotion while device is connected option;Passthrough a USB flash drive to VM from Vmware ESXi host
  4. Then the USB drive will appear in the guest OS of the virtual machine.
There are some vMotion restrictions for VMs with a redirected USB drive:

  • 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.

vmware No available USB devices

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
If you do not see your USB drive, try to disconnect it physically and connect it again. See the vmkernel.log to learn if USB Arbitrator has detected your drive:

tail -f /var/log/vmkernel.log | grep -i USB

cpu0:33271)<6>usb 4-2: new SuperSpeed USB device number 5 using xhci_hcd
cpu0:33271)<6>usb 4-2: New USB device found, idVendor=0480, idProduct=b207
cpu0:33271)<6>usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
cpu0:33271)<6>usb 4-2: Product: External USB 3.0
cpu0:33271)<6>usb 4-2: Manufacturer: TOSHIBA
cpu0:33271)<6>usb 4-2: SerialNumber: 20180528012427F
cpu0:33271)<6>usb 4-2: Vendor: 0x0480, Product: 0xb207, Revision: 0x0315
cpu0:33271)<6>usb 4-2: Interface Subclass: 0x06, Protocol: 0x50
cpu0:33271)WARNING: LinScsiLLD: scsi_add_host:573: vmkAdapter (usb-storage) sgMaxEntries rounded to 255. Reported size was 65535
cpu0:33271)<6>usb-storage 4-2:1.0: interface is claimed by usb-storage
cpu0:33271)<6>usb 4-2: device is not available for passthrough
cpu0:33271)<6>usb 4-2: usbfs: registered usb0405
cpu0:33207)<6>usb-storage 4-2:1.0: suspended

vmkernel.log | grep -i USB device

If the USB drive is not detected by your ESXi host, make sure that the usbarbitrator service is running:

#chkconfig usbarbitrator --list

Stop the usbarbitrator service only if you want to access the USB stick directly from ESXi shell to copy files.

So we have got the number of the USB controller to be redirected to the VM.

  1. To redirect a physical USB controller, select the ESXi host your VM is running on and go to  Manage -> Settings -> PCI Devices -> Edit;
  2. In the list of PCI devices select the required USB controller by its ID (in my example, it is 00:1D.0, the controller is called C610/X99 series chipset USB Enhanced Host Controller #1 Intel Corporation);
  3. The status of the USB controller must change from Unavailable (This device is not currently available for VMs to use) to Available (This device available for VMs to use). Click OK; VMware PCI Passthrough (VMDirectPath) for USB device
  4. To save the changes, restart your ESXi host;
  5. After booting the host, turn your VM off and add a new device (New Device -> PCI Device -> Add). Select your USB controller in the dropdown list (for example, 0000:00:1D| Intel Corporation USB Chipset…);
    If when adding a PCI device the following message appears in the VM settings: “Warning: The VM will not power on until its memory reservation equals its memory size”, reserve some RAM for your VM.
  6. Power on the VM on and make sure that the USB drive has appeared in the guest OS. In my case, the connected USB drive “Toshiba External USB 3.0 USB Device” has appeared in the guest Windows Server 2012 R2. redirect an external usb drive from esxi to VM

In the VMDirectPath mode, you can redirect up to two physical PCI devices to a VM.

There are some restrictions on a VM with a redirected PCI device: you cannot pause a VM (Suspend), perform vMotion to another host (it is logical, since you are bound to a physical controller) or create snapshots.

Hyper-V also supports the redirection of physical USB devices to a VM.

3 comments
1
Facebook Twitter Google + Pinterest
previous post
Managing User Photos in Active Directory Using ThumbnailPhoto Attribute
next post
How to View and Close Open Files in Windows Server SMB Share?

Related Reading

Reset Root Password in VMware ESXi

October 12, 2023

How to Fix ‘An Operating System Wasn’t Found’...

July 14, 2023

Unmounting an NFS Datastore from VMware ESXi

April 21, 2023

How to Increase Virtual Machine Disk Size in...

April 6, 2023

How to Install Free VMware Hypervisor (ESXi)

January 24, 2023

3 comments

Ash IM March 23, 2022 - 8:50 pm

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

Reply
admin March 24, 2022 - 10:28 am

Make sure that your external drive is in VMware’s list of supported USB pass-through devices. https://kb.vmware.com/s/article/1021345

Reply
Ash IM March 24, 2022 - 4:38 pm

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!

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Shrinking VMDK Virtual Disk Size on VMWare ESXi
  • Windows Server Licensing for Virtual Environments
  • Invalid State of a Virtual Machine on VMWare ESXi
  • ESXi: Slow Disk Performance on HPE Gen8
  • Match Windows Disks to VMWare VMDK Files
  • Updating Windows VM Templates on VMWare with PowerShell
  • Accessing USB Flash Drive from VMWare ESXi
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top