How-to add an ESXi connected USB device to a VM

Last time a colleague came to me and ask me how to pass-through a license dongle to a VM. The first thing that came to my mind was “Hm…. haven’t done that before, but should not be so complicated”. I tried it in my home lab and this post is the result.

First of all make sure that the device you wanted to use is supported for pass-through. To validate it check this VMware KB article.

To use USB pass-through the VM must have Virtual Hardware Version 7 or later.

Methode 1

Open the WebClient, select the VM which will use the USB device and click Edit Settings.

add_usb_device_01

Select under New device Host USB device and click add.

This will also add an new USB controller as you can see in the screenshot. If you have more than one USB device attached to the ESX you can select the appropriate one through the drop down menu.

When you switch back to the VM you can see the installation of the new components.

add_usb_device_02

After everything is installed, you can find the device within the device manager or if it’s an USB stick, like in my example, under Computer.

add_usb_device_03

Methode 2

There is also an alternative method, but I would not recommend this. You can also pass-through a whole USB Controller from the ESX.

The use a physical USB controller select the ESX in the Webclient and go to Manage – Settings – PCI Devices

add_usb_device_04

Select Edit… and add the desired USB controller.

add_usb_device_05

After you added the controller you have to restart the ESX server.

You can now add the PCI device (USB controller) through Edit Settings – Add Device – PCI device to the VM.

ATTENTION

You can’t disable the USB controller after that methode when you’re using USB sticks or SD cards to boot your ESX server. This issue occurs when the image is loaded to the memory which includes the esx.conf file. When you enable the USB controller for pass-through, all USB devices are invisible to the kernel. When you deselect the USB controllers from the pass-through list, the change saves to the esx.conf file. The esx.conf file is in the memory during ESXi uptime and when you issue the reboot command, the esx.conf is saved back to the USB device. In this case, the kernel cannot see any USB devices, so the configuration change does not apply.

The only option to disable the pass-through controller is to do a fresh installation of the ESX server according to this KB article.

4 Responses

  1. Alex says:

    Hi Manfred,

    This is the very useful article, but I let me tell you about the third way to use usb dongles inside VM’s.
    We also had used the first way of passing-throug USB-devices and some day all of the USB sockets on ESXi hosts became full. And we bought this device http://www.digi.com/products/usb/anywhereusb
    Now we have more than 20 virtual servers with different types of USB dongles. And our ESXi hosts don’t look like hedgehogs 🙂

    Moreover, as far as I remember, if you use pass-through you won’t be able to use vMotion. In case of using AnywhereUSB you can migrate VM from one host to another.

    Sorry for my English, it’s not my mother tongue.

    • Hi Alex,

      thanks for the hint. I know the Anywhereusb devices and they’re great devices and you are right, when using pass-through you can’t vMotion the VM off the host where the USB device resides.

      Cheers,
      Fred

  2. ElenRey says:

    Hi,
    If it interesting here is an article where AnywhereUSB is compered with a software alternative – flexihub.com/usb-anywhere-alternative.html
    As for me I’ve got some useful tips.

  1. February 22, 2015

    […] از لینک های زیر استفاده کنید. http://www.tinkertry.com/usb3passthru/ How-to add an ESXi connected USB device to a VM | vBrain.info آموزش خصوصی، نصب، راه اندازی، عیب یابی و امن سازی […]

Leave a Reply