<

HOW TO: Add and Connect a USB Device to a Virtual Machine, hosted on VMware vSphere Hypervisor ESX 4.1 ESXi 4.1, ESXi 5.0

Published on
171,990 Points
106,590 Views
39 Endorsements
Last Modified:
Approved
Andrew Hancock (VMware vExpert / EE MVE^2)
MVE^2, Expert of the Year 2017-2011, Scribe 2016-2012, Author of the Year 2017-6,2013-2012 VMware vExpert 2018-2011 27 years of experience.
One of the new features of a version 7.0 or later virtual machine, supported in VMware vSphere 4.1, 5.0 or the VMware vSphere Hypervisor ESXi 4.1, ESXi 5.0 often overlooked by VMware Administrators is the ability to add and connect USB devices connected to the VMware host ESXi server to Virtual Machines. VMware refers to this as USB Passthrough.

Virtual Machine Versions 7 and above support USB Passthrough. vMotion is also supported on the virtual machine, and the USB device will stay connected to the original host, with the USB device. VMware ESXi and the Virtual Machine use a "USB over IP" mapping to remain connected, in this way virtual machines are not "locked" to hosts, which is important with load balancing in VMware DRS.

It is now possible to use USB Modems, USB Security Keys, USB Serial Devices, USB VOIP devices, USB flash drives and USB external disks to connect to virtual machines.

USB Passthrough is supported on Windows XP, Windows Vista, Windows 7, Windows 2003, and Windows 2008 and Windows 2008 R2 virtual machines. Also various Linux distributions.

The background to writing this aticle, a physical small server in our office, the VOIP Gateway which handles the VOIP international telephone calls from the UK via SIPPS gateway on the Internet - FAILED. (It is chepaer than BT Business Tariffs!). The VOIP Gateway uses a USB wireless dongle to interface with the DECT ISDN exchange. This is a real time voice and data system, that now has been converted and migrated to a virtual machine hosted on our VMware vSphere Enterprise environment, using vSphere HA and DRS, the virtual machine is vMotioned around the farm of 10 ESXi servers with no issues!

In this tutorial, I've selected Windows 2008 R2 Foundation.

1. Connect to the VMware vSphere Hypervisor (ESX/ESXi) Server using the vSphere Client


Using the VMware vSphere Client, login and connect to the ESX/ESXi server, using the IP address or hostname of the ESX/ESXi server, using the root username and password credentials. If you have a VMware vSphere vCenter server, you could also specify IP address or hostname of the vCenter server which manages your ESX/ESXi servers.

Using the VMware vSphere Client, login and connect to the VMware ESX/ESXi server

2. Select and Edit the Virtual Machine settings


Select the virtual machine, that you would like to add an USB device. Right Click and Select Edit Settings.

 Edit Virtual Machine Settings
The Virtual Machine Properties page will be displayed for the selected virtual machine. Check the Virtual Machine Properties Machine Version is 7.

3. Add a USB Controller to the virtual machine


Click Add, the Add Hardware Wizard will appear. Select a USB Controller followed by Next.

A USB Controller can be added to a "hot" powered-on or "cold" powered-off virtual machine.

Add Hardware Wizard
Select the Controller Type and Click Next

Select USB Controller Type
Review the details and Click Finish to Add the USB Controller to the virtual machine.

Review the details and Click Finish
Check the USB Controller has been added to the virtual machine and Click OK. The USB Controller will be added to the virtual machine.

Check the USB Controller has been added to the virtual machine

5. Add USB Device to virtual machine



Select the virtual machine with the USB Controller, that you would like to add an USB device. Right Click and Select Edit Settings.

Select the virtual machine with the USB Controller
Click Add, the Add Hardware Wizard will be displayed.

Add USB Device Hardware
if the USB Device (unavailable) shows in gray and unavailable, either a USB device is not connected to the server, or the USB device is incompatible. Some host servers do not support USB passthrough. Select Cancel to return.

Select the USB Device and Click Next

Select the USB Device
Select the USB Device to add to the Virtual Machine. If you want the device to support vMotion Tick the Box. You can only add one USB Device at a time. So if you need to add more USB devices, repeat this step. vMotion support enables, the virtual machine to use and remain connected to the USB on the host device, if it is migrated to another host it remains connected via "USB over IP.".

Select the USB Device to add to the Virtual Machine.
In the above screenshot the Siemens and Communication DECT Data device is currently connected to virtual machine VOIP Gateway.

Select the USB Device to Add followed by Next

Select the USB Device to Add followed by Next
Review the selected changes and Click Finish to add to virtual machine. Repeat for other USB devices.

Review the selected changes and Click Finish
Confirm the USB Device has been added and Click OK. You may be required to add the correct Vendor USB drivers in the virtual machine OS.

Confirm the USB Device has been added and Click OK.

6. Inside the Virtual Machine


Once the USB device has been connected to the virtual machine. The virtual machine behaves exactly the same as if a USB device had been connected to a physical computer.

If Windows has drivers included in the OS, it will automatically install the device using Plug 'N' Play. The following graphic appears in Windows 2008 R2 in the System Tray.

Windows Drivers install
You can safely eject the USB device, using the Safely Eject Icon in the System Tray. USB Toshiba 2.5" External disk device in Windows 2008 R2

Toshiba External 2.5" USB disk
If you check in Device Manager you will also see the detected devices

Windows Device Manager
I've added all USB devices connected to the host to this VM, drivers are not available for Security Key and Scanner in Windows 2008 R2, hence the error.

Windows Device Manager
You have successfully added a USB device to your virtual machine.

We have tested LaCie, HP, Sandisk, PNY, Super Talent and Kingston flash drives, Rainbow, Aladdin and Desk Lock security keys, US Robotics USB Modems, USB to Serial and Parallel adaptors, USB flatbed scanners, LaCie, Toshiba, HP, Hitachi, Seagate USB external hard drives, VOIP USB devices and USB Webcams.

*******************************************************************************************************************************************
Thank you for reading my article, please leave valuable feedback. If you liked my VMware article and would like to see more VMware Articles from me, please click the Yes button near the: Was this article helpful? at the Top of this article to the right of the Article title. Thank You.
*******************************************************************************************************************************************
39
Comment
  • 15
  • 3
  • 2
  • +8
29 Comments
 
LVL 17

Expert Comment

by:pjam
Great,
Just what I was looking for.  I am definitely going to check this out.
Thanks hanccoka
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
No problems.
0
 
LVL 1

Expert Comment

by:raja78in
Good info
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Thanks make sure you Voted! Yes!
0
 

Expert Comment

by:IT_Group1
Great info
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
thanks. please Vote Yes!
0
 

Expert Comment

by:IT_Group1
Done
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Thanks, that will prompt me to write some new articles, coming soon...
0
 
LVL 47

Expert Comment

by:noxcho
Good work hanccocka, I had recently the situation where USB connected drive to ESX 4.1 was urgently needed. Had to dig much in google in order to find similar instructions. And now I see all is described here as plain as possible. Thumb up.
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@noxcho Many Thanks, please Vote Yes, if the article was helpful!
0
 
LVL 47

Expert Comment

by:noxcho
That was first think I did before writing my comment! =)
0
 
LVL 47

Expert Comment

by:noxcho
rrrr thinG not thinK =)
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
thanks
0
 

Expert Comment

by:TheHappyTech
Thank you so much Andrew! Got my vote as well.

HappyT
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
A follow-up to this article, with the rise of VMware Administrators trying to connect, USB devices to ESXi host servers, and finding that they are not available for USB passthrough, although they are visible to the ESXi Host Hypervisor, (check with dmesg or cat /var/vmkernel.log | grep usb), so software fudge is not displaying them in the vCenter Server passthrough, we recent issues with USB Passthrough and the following error messages...

When trying to connect two Security Keys (dongles) that have worked for many years to a VM, the following appears:-

Cannot connect "path:1/0/3 host:esxi004..ac.uk deviceLocation:remote-host version:2" to this virtual machine. The device was not found.

Cannot connect "path:2/0/1 version:2" to this virtual machine. The device was not found.

This was working, it does not work across any hosts.

The security keys are Aladdin Knowledge HASP HL 3.25 as available in he devices.

Production is down, because NO body at the university can run the applications, because these network keys are unavailable, as a network license!

We thought we would escalate this to VMware Support and test them, and I'll document here....

Support Request Confirmation Number:157zzzzzz108
Support Request Status:Open (Unassigned)
Date and Time Created:2015-08-04 10:41
Target Response Time: 2015-08-04 14:42 (GMT+00:00) GMT Standard Time

Waiting....

Servers Are:-

ESXi 5.5 Build 2718055 on 8 ESXi Hosts. Running on Dell R710/R720 hardware.

vCenter Server Build 5.5.0 2646482.

HASP keys are:-

2015-08-04T10:01:12.971Z cpu8:33553)<6>usb 1-1.4: new low speed USB device number 9 using ehci_hcd
2015-08-04T10:01:13.095Z cpu15:33553)<6>usb 1-1.4: New USB device found idVendor=0529 idProduct=0001
2015-08-04T10:01:13.095Z cpu15:33553)<6>usb 1-1.4: New USB device strings: Mfr=1 Product=2 SerialNumber=0
2015-08-04T10:01:13.095Z cpu15:33553)<6>usb 1-1.4: Product: HASP HL 3.25
2015-08-04T10:01:13.095Z cpu15:33553)<6>usb 1-1.4: Manufacturer: AKS
2015-08-04T10:01:13.096Z cpu15:33553)<6>usb 1-1.4: usbfs: registered usb0109

2015-08-04T10:06:09.969Z cpu18:33553)<6>usb 2-1.2: new low speed USB device number 8 using ehci_hcd
2015-08-04T10:06:10.090Z cpu18:33553)<6>usb 2-1.2: New USB device found idVendor=0529 idProduct=0001
2015-08-04T10:06:10.090Z cpu18:33553)<6>usb 2-1.2: New USB device strings: Mfr=1 Product=2 SerialNumber=0
2015-08-04T10:06:10.090Z cpu18:33553)<6>usb 2-1.2: Product: HASP HL 3.25
2015-08-04T10:06:10.090Z cpu18:33553)<6>usb 2-1.2: Manufacturer: AKS
2015-08-04T10:06:10.090Z cpu18:33553)<6>usb 2-1.2: usbfs: registered usb0208


We also have a follow-on question related to USB Passthrough.... the following devices do not appear as USB passthrough devices for the virtual machine but they are recognised by the host?

WHY?

2015-08-04T10:17:15.038Z cpu4:33553)<6>usb 1-1.5: new high speed USB device number 11 using ehci_hcd
2015-08-04T10:17:15.155Z cpu4:33553)<6>usb 1-1.5: New USB device found idVendor=19d2 idProduct=0103
2015-08-04T10:17:15.155Z cpu4:33553)<6>usb 1-1.5: New USB device strings: Mfr=3 Product=2 SerialNumber=4
2015-08-04T10:17:15.155Z cpu4:33553)<6>usb 1-1.5: Product: ZTE WCDMA Technologies MSM
2015-08-04T10:17:15.155Z cpu4:33553)<6>usb 1-1.5: Manufacturer: ZTE Incorporated
2015-08-04T10:17:15.155Z cpu4:33553)<6>usb 1-1.5: SerialNumber: P6zzzzzzzz000
2015-08-04T10:17:15.158Z cpu4:33553)<6>usb 1-1.5: Vendor: 0x19d2 Product: 0x0103 Revision: 0x0000
2015-08-04T10:17:15.158Z cpu4:33553)<6>usb 1-1.5: Interface Subclass: 0x06 Protocol: 0x50

2015-08-04T10:04:13.718Z cpu15:33553)<6>usb 1-1.5: new high speed USB device number 10 using ehci_hcd
2015-08-04T10:04:13.836Z cpu15:33553)<6>usb 1-1.5: New USB device found idVendor=2357 idProduct=f000
2015-08-04T10:04:13.836Z cpu15:33553)<6>usb 1-1.5: New USB device strings: Mfr=3 Product=2 SerialNumber=4
2015-08-04T10:04:13.836Z cpu15:33553)<6>usb 1-1.5: Product: TP-LINK HSPA+ Modem
2015-08-04T10:04:13.836Z cpu15:33553)<6>usb 1-1.5: Manufacturer: TP-LINK Incorporated
2015-08-04T10:04:13.836Z cpu15:33553)<6>usb 1-1.5: SerialNumber: 863zzzzzz34668
2015-08-04T10:04:13.903Z cpu15:33553)<6>usb 1-1.5: Vendor: 0x2357 Product: 0xf000 Revision: 0x0000
2015-08-04T10:04:13.903Z cpu15:33553)<6>usb 1-1.5: Interface Subclass: 0x06 Protocol: 0x50

This VMware Support call is flagged as PRODUCTION DOWN!
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
you can read the outcome here....

http://www.experts-exchange.com/discussions/209901/VMware-Support-Test-for-USB-Passthrough-issue.html

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1021345

and basically the support engineer agreed with me on the following points....

IF YOU HAVE A DEVICE WHICH IS NOT ON THE ABOVE LIST DO NOT EXPECT IT TO WORK WITHIN VMWARE VSPHERE IN USB PASSTHROUGH MODE.

he did however, also agree, that it is a very short list, and he thought they must have tested more devices by now!!!!

because although updated in 2015, that was just to add the 6.0 reference!
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Supported USB device models for passthrough from an ESX or ESXi host to a virtual machine (1021345)
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1021345

After discussing these issues, this is the outcome.

The VMware Knowledge base article, maybe updated to reflect that USB Passthrough feature was designed to allow tested and supported Security Keys of "Dongles" to be used with VMware virtual machines.

Any attempt to use any other USB device, which is not on the test list e.g. a security key or "dongle" although which maybe recognised by the hypervisor is NOT SUPPORTED or GUARANTEED TO WORK WITH ESXi 4.1, 5.0, 5.1, 5.5, or 6.0.

So this is the final word from VMware Support.

The current list is useless.

Just because the server has a USB port, VMware ESXi has USB passthrough, does not imply, that your USB device will fucntion correctly in a virtual machine.
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
further digging through the logs I found...


2015-08-03T13:43:22.623Z cpu3:33553)<6>usb 1-1.2: device is not available for passthrough
2015-08-03T14:01:26.111Z cpu19:33553)<6>usb 2-1.2: device is not available for passthrough
2015-08-04T09:42:54.596Z cpu12:33553)<6>usb 1-1.2: device is not available for passthrough
2015-08-04T09:42:54.600Z cpu12:33553)<6>usb 1-1.2: device is not available for passthrough
2015-08-04T09:58:53.656Z cpu14:33553)<6>usb 2-1.2: device is not available for passthrough
2015-08-04T10:04:13.908Z cpu15:33553)<6>usb 1-1.5: device is not available for passthrough
2015-08-04T10:17:15.161Z cpu4:33553)<6>usb 1-1.5: device is not available for passthrough

so if you see the messages in the log, try another USB device!
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Just to finish off this......

Call open with VMware on the 4 August 2015

today I received this

I hope you are well.

I have reviewed the logs that you have uploaded to the case. At this point there is nothing that points out why you ran into this issue.
At this point I have also contacted support to have this KB updated. That is a  work in progress and will be carried out. Please note this will be later rather than sooner at this point.

For now I suggest that we archive this case. To follow the KB updates I would suggest subscribing to the KB for updates.

So if you have no further questions I will proceed to archive the case as resolved later today.

I look forward to hearing from you.

So three weeks later, and we still have no idea, so things happen, with no reason why!

But the KB Article will be updated, we will see.
0
 

Expert Comment

by:Dhirendra R
Thank you very much for the nice article. this helped me connect USB for VM backup
0
 

Expert Comment

by:Mohammad Rajabi
thx alot
0
 

Expert Comment

by:ROBERT FITZGERALD
Thanks for the guide, it's very useful. I am experiencing an issue with USB webcams I was wondering if you may be able to help me with. I am running ESXi 6.5 in a home lab environment (single server) on a Dell PowerEdge 210 II and I'm looking to pass through two (or at least one) USB webcam to the VM. I have set it up exactly how your guide states, no problems with that part, however getting the webcams to work within Windows has been very difficult. My cams are a Logitech C270 and a Microsoft VX-3000 running on a Windows 7 VM. The webcams are detected fine within Windows, I have installed their relevant drivers without a hitch, however when I come to use the webcams no matter what application I use, it says the webcam is already in use and the LED on the front of them is also lit to indicate use however this is not the case and no software apart from their own drivers is installed on the VM. The VM is freshly installed, I have tried it with Windows updates installed and without, I have tried Windows XP, 8.1 and 10 VMs and all seem to have the same issue so I am guessing the passthrough is somehow interfering with operation of the webcam. A google search has not returned any similar cases (very few mentions of webcam passthrough are listed online) but as you stated that you have tested some with success I wonder if you had any issues along the way?
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@Robert Sorry just because VMware vSphere supports USB Passthrough that does not mean that any USB device will work.

If it's not on the USB HCL, it's not supported, and not guaranteed to work!

To be honest with you USB Passthrough is poor, because the I/O is virtualised, USB Passthrough was not design for USB Webcams!
0
 

Expert Comment

by:ROBERT FITZGERALD
I realise this, but as you had mentioned you had tested some webcams I wondered if you had to do anything special to make them work. The HCL only appears to support storage devices and licensing dongles but you had mentioned success when testing many other devices so it gave me hope. I was hoping to migrate my home CCTV system (Milestone XProtect) to a VM, but as I rely on a couple of webcams for some areas it doesn't look like it will be possible sadly
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
and those USB Webcams are no longer manufactured!

This article was written 4 years ago!

If it's not on the HCL its not supported.

VMware vSphere is an enterprise product designed for the datacentre.

You will have to use a USB over IP product.
0
 

Expert Comment

by:Bo Didley
There is no step #4.
3. Add a USB Controller to the virtual machine
5. Add USB Device to virtual machine
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Deliberate Mistake well spotted!!!

Thanks for reading...,  in almost 4 years since publishing, nobody has ever reported it!

Thanks for paying attention!
0
 

Expert Comment

by:Cyrus Dalili
hi
thanks for your guide

i want to know is there any way to do this via excli ?
 i want to attach/deattach a usb disk at schedule.
0
 
LVL 127

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@Cyrus

Please post a question to the VMware topic area, and myself or other experts will be glad to assist.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Join & Write a Comment

Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month