Here’s all you need to do to enable VMware ESXi USB passthrough:
- Download USB Network Gate and install it on the computer where the required USB device is connected physically.
- Start the software and share the peripheral in the app’s interface.
- Install the program on a VM, launch it and connect to the shared device in the “Remote USB devices” tab.
USB Network Gate is cross-platform, so you can establish network communications between Windows, Linux and Mac machines in different combinations.
5. The native method to connect USB to VMware
- Following is the description of how to connect USB to VMware virtual machine running on VMware Workstation:
When you attach a USB device to a host PC, the device by default connects to the VM instead of the host computer. If it doesn’t, you’ll need to manually redirect the device to the virtual machine. If the device is connected to the guest OS, Workstation retains the connection to the host system’s USB port. In case you suspend the VM, power it off or unplug the device and then plug it again or resume the guest operating system, Workstation reconnects the device. If the device is not reconnected by Workstation but is still available, you can redirect it manually.
To do this: Choose VM > Removable Devices > Device Name > Connect (Disconnect from host).
- To redirect USB devices to VMware ESXi you should follow these steps:
- Log into your VMware vSphere Web Client and access your Inventory.
- Open the list of Virtual Machines and choose the one to which needs to access the USB device. Right-click and select the “Edit” settings.
- Then, go to the “New device” menu, choose “Host USB device” and hit “Add”.
- In the drop-down menu, select the USB device that will be added to the virtual machine.
6. Connect USB device to a virtual machine
If you plug in a device into the host computer when a virtual machine is running and its window is active, the device automatically gets connected to the guest system instead of the host. You can disable the autoconnect feature in the USB Controller panel accessible via Virtual Machine Settings Editor.
If a USB device is attached when all the USB ports of the virtual machine are already occupied, a dialog box will be displayed. It will give you options either to disconnect one of the already connected devices so you can free up a port for a newly inserted device or ignore a new device. If you choose the latter, the device will be connected to the host.
If you would like to specify what USB devices are to be connected to a virtual machine, go to VM > Removable Devices. The max number of USB devices you can connect at a time is two. If a hub is used for connecting devices to the host, you will not see the hub, only the virtual devices.
Each of the USB ports has a menu item, hover over them to display a cascading menu of devices plugged into your host computer and available for use on your virtual machine. Clicking the name of a device will connect it to the virtual machine. If a device is already connected to that port, click the name of a newly attached device to release the first device and connect the new one.
To release a device, find a port to which it is connected and choose None in its cascading menu.
If a device is connected to the host machine, e.g. you plugged it into the computer while the autoconnect feature was disabled, you can connect it to the virtual machine manually via VM > Removable Devices menu.
7. How to mount USB drive to Hyper-V
To connect a USB drive to a virtual machine install it as virtual hard disk in Hyper-V virtual environment. You can do it if you know the size of the drive, to find it out on your host machine click Computer, find your removable disk, right-click to display the context menu and go to Properties. General tab will have information on the size of your hard drive in Bytes and GB.
How to install a USB drive as a virtual hard drive:
- Right-click on your Hyper-V server, choose New > Hard Disk, or do the same from Actions menu; follow the instructions.
- When prompted enter a name for your drive, click Next.
- Choose ‘Copy the content of the specified physical disk’ and enter the details to identify the disk.
Copying the content of the removable storage and creating the USB.vhd file might take a while, it depends on its size. The amount of free space does not matter, a vhd file is created with the entire size of the removable storage.
- Choose Settings on your virtual machine, select SCSI Controller – see the left pane; select Hard drive – see the right pane, click Add.
- Click Browse and choose to open the vhd file to which you mounted your removable storage. Your removable storage should be displayed as a drive.
If ‘My Computer’ does not show it as a removable storage, it might be because the drive is offline. To check it, go to your VM, right-click Computer, choose ‘Manage’ or ‘Administrative Tools’ and go to Computer Management.
Expand Storage and select Disk Management. Red arrow icon means that the disk is offline, right-click the disk and in the context menu displayed select Online. Once your disk gets Online status, a drive letter will be assigned to it.
There are certain drawbacks to this method: you will have to reproduce the entire actions sequence for each USB drive connected to your Hyper-V virtual environment. As we already mentioned, creating a vhd file might consume some time, it directly depends on the size of your USB disk.