2011-09-18

Connecting a USB device to an ESXi 5.0 VM

This is something we have been asking for years and it was only available up until now in VMware View. We can finally connect a USB device to a VM running on ESXi. No additional licensing required!!!!!

From the What's New in vSphere 5.0

What's New

Could it be that simple? Well actually yes it is.

This is my host (in this case the free vSphere Hypervisor)

image

Here you have a VM Virtual Hardware version 8 (I was not able to test with Version 7 so if you would like to try and add a comment here - that would be great!!)

VM details

Add a USB Controller to the VM

Add Hardware

You can choose either USB 2.0 or USB 3.0

USB 2.0USB 3.0

And here is the VM Configuration after the addition.

VM Config

After adding the USB controller to the VM, these parameters are added to the VM's configuration (.vmx) file.

vmx1 

After the machine has come up it now has a USB controller in its device manager.

Device Manager

In the vSphere Client I can now attach USB devices that are connected to the my computer to the VM running on this ESX host.

connect USB

When I connect the USB device to the VM I get this warning - which is similar to the one you get when doing the same with Workstation

warning

Once connected to the VM - it shows up in the Device manager and in this case also as a local drive.

New Disk

New Disk2

And of course the details are updated in the .vmx itself

vmx2

This opens up a whole new world of connecting peripheral devices to the VM. I do wonder though what it will mean to all of the companies that have created solutions that were able to solve these issues until now with a USB-over-IP solution. (Digi)

It would be interesting to hear what kind of use you could make of this new feature in your environment. Feel free to drop a comment below.

15 comments:

Damian Karlson said...

At my previous employer, we used Digi devices to present USB licensing dongles to VMs. The Digi's were fairly "dumb" devices, but they were useful because it allowed us to virtualize servers & applications requiring USB licensing, and do it in a way that still offered cluster/location flexibility to the VMs.

Guess I said all that to say there's still a place in the datacenter for USB over IP. Hopefully these improvements in USB ~> VM connectivity will force companies like Digi to innovate higher levels of flexibility into their products.

Curtis said...

You have to keep the VM on the same host as the USB device though correct?  So a vMotion to another host would break the USB.  That's where devices like USB Anywhere will continue to have a niche, at least until ESX is able to redirect USB across hosts.

We use USB Anywhere boxes with our 4.1 cloud for licensing dongles as well as a Huawei SMS dongle for NMS notifications.

Maish said...

I am not sure I understand your comment. I had connected the USB stick to my desktop - not the ESX host.
Actually vMotioining the VM would be an interesting one to check

Hayes Whitt said...

hurrah!  now i can get that scanner with the Windows 98 "only" driver working.  which is why i got into vmware, 2 years ago.  and hook up my printer too.  sweet.

Nevrec said...

I always thought pass-through meant from the ESXi host to a VM, not a client using Vsphere passing it's USB connection to another VM running under ESXi.  To me that's pretty much useless.  What I and many others are looking for is passing a USB device connected to the ESXi server through to a VM on that server.  That way we don't need two machines to accomplish the task.

Nevrec said...

Forgot to add, great article though!

Maish said...

 What kind of USB device are you looking to pass from the ESXi Server to the client just as a matter of interest?

I am interesting in understanting why the above solution is not of much use to you?

Nevrec said...

We need a USB modem to communicate and receive faxes that are automatically input to our ERP application which reside on the VM.  Therefore the ESXi host must be able to pass the info through the port to the VM.

Jay said...

This didn't work. My devices were not detected by the VSphere or the VM.

Sebastián Moreno said...

Same problem here, "no usb devices"

Maish said...

 There are no USB devices showing up at all? or is it just not being recognized??

Joel Beaton said...

Maish - I am having trouble with this and am rather hoping you can help as you seem to be quite familiar with this! Where as I am literally just starting and trying to find my feet in virtualization. Rather hoping you still follow this thread too....


For some reason I cannot get USB devices (USB Flash Drives, USB connected printer) to be recognized by my virtual machines. ie those USB devices connected to the client computer which is running XP (XP is needed on the client due to other legacy software it needs to run on netBios).


In vSphere, in the USB connection menu at the top of the console - the USB devices (printer, flash drives) are there but greyed out and unable to be selected.


I have ESXi 5.0 installed on an HP Proliant server box. On this in the same datastore are two VMs which are clones of former systems that were running and which are using Windows 2000.
-For each of the VMs VMWare Tools is installed.
-For each of the VMs, a USB Controller was added to the hardware in the VM settings as you covered above
-In vSphere on the server configuration tab I have set the USB controller to pass through (possibly unneeded as I think I am trying to accomplish USB Redirection from client rather than passthrough from HOST server - like I said though am getting to grips with the terminology).



Any ideas on what could be the issue that I need to correct?

Maish said...

Hi Joel - of course I am monitoring this thread...
You do not need to configure any passthough on the vSphere Configuration tab.


What is the hardware version of the VM's ?


Just make sure I understand correctly.


- vSphere installed on HP Proliant.
- VM's are running Windows 2000 - with up to date tools and a USB controller added to the VM's configuration.
- User is connecting to VM from a Windows XP machine with up-to-date vSphere client.


What happens when you open the vSphere console to the WIN2K VM and connect the USB controller?

Arun said...

Certainly appreciate the info.

Eoin Ryan said...

I wonder, were you ever able to find a way to connect a USB device that is plugged into ESXi host to a VM on that host? I am looking to do that now, and having some trouble.


Any links would be very helpful! thanks