Pages

Sunday, September 8, 2013

Mounting USB drives directly to a virtual machine on an ESXi 5.x host

I’ve been asked several times recently what the process is to mount a USB drive directly to a virtual machine when one is plugged directly to a host and as easy as it really is, I find most people run into problems because they tend to miss the last step so I thought I’d write a blog post for it.

Start by plugging the USB drive into the ESXi host’s USB port and ensure that it’s lit up if there is a LED light somewhere on the drive.

Once the drive is plugged in, proceed with opening the settings of the virtual machine you would like to mount the USB drive and click on the Add button in the settings windows:

image

Select the USB Controller as the device you would like to add and click on Next:

image

Select the Controller type that is supported by the virtual machine operating system (EHCI+UHCI) and click on Next:

image

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Note that I will receive the warning This controller is not supported for this guest operating system. if I change the type to xHCI:

image

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Click on the Finish button to add the device:

image

You should now see a USB controller added to the virtual machine:

image 

I find that this is the point where a lot of clients and colleagues ask me my they don’t see the USB hard drive in the virtual machine.  Some say they’ve fiddled around the USB device button found on the console window but don’t see a way to mount the drive:

image

The reason why the drive isn’t shown is that an important step still needs to be done to actually present the USB drive to the virtual machine so proceed and open up the settings window again and click on the Add button:

image

Notice that the available device types in the list now contains USB Device.  Proceed by select the device and click Next:

image

Notice that the USB drive you plugged into is listed as a host USB device.  Select the device if there is more than 1 and click Next:

image

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Note that if a USB drive is already connected to a virtual machine, the Connection column will indicate which virtual machine it is connected to as shown here:

image

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Click on Finish:

image

You should now see a USB controller and a USB 1 device representing the USB drive in the settings window:

image

Proceed by closing the settings window and you should now see the USB drive in your virtual machine:

image

This is definitely seemingly an easy task but believe me when I say I’ve been asked a lot of times about this.

3 comments:

Anonymous said...

Does the server need to support PCI passthrough in order for this to work?

Cathleen said...

Really nice written! Thanks, it works for me!

P said...

THANK YOU