Category Archives: USB Devices

Notes on USB Devices–Virtual Machine Admin Guide

USB Configuration from an ESXi Host to a Virtual Machine

You can add multiple USB devices to a virtual machine when the physical devices are connected to an ESXi host. USB passthrough technology supports adding USB devices, such as security dongles and mass storage devices to virtual machines that reside on the host to which the devices are connected.

How USB Device Passthrough Technology Works

When you attach a USB device to a physical host, the device is available only to virtual machines that reside on that host. The device cannot connect to virtual machines that reside on another host in the datacenter. A USB device is available to only one virtual machine at a time. When a device is connected to a powered-on virtual machine, it is not available to connect to other virtual machines that run on the host. When you remove the active connection of a USB device from a virtual machine, it becomes available to connect to other virtual machines that run on the host.

Connecting a USB passthrough device to a virtual machine that runs on the ESXi host to which the device is physically attached requires an arbitrator, a controller, and a physical USB device or device hub.

Arbitrator

Manages connection requests and routes USB device traffic. The arbitrator is installed and enabled by default on ESXi hosts. It routes device traffic to the correct virtual machine instance for delivery to the guest operating system. The arbitrator monitors the USB device and prevents other virtual machines from using it until you release it from the virtual machine it is connected to.


USB Controller

The USB hardware chip that provides USB function to the USB ports that it manages. The virtual USB Controller is the software virtualization of the USB host controller function in the virtual machine. USB controller hardware and modules that support USB 2.0 and USB 1.1 devices must exist on the host. Two virtual USB controllers are available to each virtual machine. A controller must be present before you can add USB devices to the virtual computer. The USB arbitrator can monitor a maximum of 15 USB controllers. Devices connected to controllers numbered 16 or greater are not available to the virtual machine.

USB Devices

You can add up to 20 USB devices to a virtual machine. This is the maximum number of devices supported for simultaneous connection to one virtual machine. The maximum number of USB devices supported on a single ESXi host for simultaneous connection to one or more virtual machines is also 20.

For a list of supported USB devices, see the VMware knowledge base article at http://kb.vmware.com/kb/1021345.

USB Autoconnect Feature

When you add a USB device connection from an ESXi host to a virtual machine, the autoconnect feature is enabled for the device connection. It is not disabled until you remove the device connection from the virtual machine.

With autoconnect enabled, the device connection re-establishes in the following cases:

· The virtual machine is cycling through power operations, such as Power Off/Power On, Reset, Pause/Resume.

· The device is unplugged from the host then plugged back in to the same USB port.

· The device is power cycled but has not changed its physical connection path.

· The device is mutating identity during usage.

The USB passthrough autoconnect feature identifies the device by using the USB path of the device on the host. It uses the physical topology and port location, rather than the device identity.

If the same device is plugged back in to the host through a different USB port, it cannot re-establish connection with the virtual machine. If you unplug the device from the host and plug in a different device to the same USB path, the new device appears and is connected to the virtual machine by the autoconnect feature that the previous device connection enabled.

Autoconnect is useful in cases where devices mutate during usage. For example, for iPhones and other such devices, the device VID:PID changes during software or firmware upgrades. The upgrade process disconnects and reconnects the devices to the USB port.

The USB port is speed-specific. The autoconnect feature assumes that devices do not transition from USB 1.1 (low-full speed) to USB 2.0 (high speed) or the reverse. For example, you might connect a USB 2.0 high-speed device to a port and connect that device to the virtual machine. If you unplug the device from the host and plug a USB 1.1 device into the same port, the device does not connect to the virtual machine.



Configuring USB Devices for vMotion

With USB passthrough from a host to a virtual machine, you can migrate a virtual machine to another ESXi host in the same datacenter and maintain the USB passthrough device connections to the original host.

For a successful migration, review the following conditions:

ü You must configure all USB passthrough devices connected to a virtual machine for vMotion. If one or more devices is not configured for vMotion, the migration cannot proceed.

ü When you migrate a virtual machine with attached USB devices away from the host to which the devices are connected, the devices remain connected to the virtual machine. However, if you suspend or power off the virtual machine, the USB devices are disconnected and cannot reconnect when the virtual machine is resumed. The device connections can be restored only if you move the virtual machine back to the host to which the devices are attached.

ü If you resume a suspended virtual machine that has a Linux guest operating system, the resume process might mount the USB devices at a different location on the file system.

ü If a host with attached USB devices resides in a DRS cluster with distributed power management (DPM) enabled, disable DPM for that host. Otherwise DPM might turn off the host with the attached device. This action disconnects the device from the virtual machine because the virtual machine migrated to another host.

clip_image002


Avoiding Data Loss with USB Devices

Virtual machine functions can affect USB device behavior and connections.

ü Before you hot add memory, CPU, or PCI devices, you must remove any USB devices. Hot adding these resources disconnects USB devices, which might result in data loss.

ü Before you suspend a virtual machine, make sure that a data transfer is not in progress. During the suspend or resume process, USB devices behave as if they have been disconnected, then reconnected.

ü Before you change the state of the arbitrator, make sure that USB devices residing on the host are not attached to a virtual machine. If USB devices become unavailable to a virtual machine, a host administrator might have disabled the arbitrator. If a data transfer is taking place at this time, you might lose the data. To reestablish the arbitrator, you must reboot the host.

You can connect multiple USB devices to ESXi hosts so that virtual machines that run on the hosts can access the devices. The number of devices that you can connect depends on several factors, such as how the devices and hubs chain together and the device type. Each ESXi host has several USB ports. The number of ports on each host depends on the physical setup of the host. When you calculate the depth of hub chaining, remember that on a typical server the front ports connect to an internal hub.

The host treats USB CD/DVD-ROM devices as SCSI devices. Hot adding and removing these devices is not supported.

 

USB 3.0 Device Limitations

USB 3.0 devices have the following requirements and limitations:

ü The virtual machine that you connect the USB 3.0 device to must be configured with an xHCI controller and have a Linux guest operating system with a 2.6.35 or later kernel.

ü You can connect only one USB 3.0 device operating at superspeed to a virtual machine at a time.

USB 3.0 devices are available only for passthrough from a client computer to a virtual machine. They are not available for passthrough from an ESXi host to a virtual machine.

 

vSphere Features Available with USB Passthrough from a Client Computer

Migration with vMotion, DRS, and DPM are supported with USB device passthrough from a client computer to a virtual machine.

clip_image002[6]

Add USB Devices From a Client Computer

Add USB Devices From a Client Computer to a Virtual Machine in the vSphere Web Client

You can add one or more USB passthrough devices from a client computer to a virtual machine on the virtual machine Summary page in the vSphere Web Client. The devices must be connected to a client computer that connects to the ESXi host on which the virtual machine resides. The devices maintain their virtual machine connections in S1 standby, if the vSphere Client is running and connected.

FT is not supported with USB passthrough from a client computer to a virtual machine.

Prerequisites

ü Verify that a USB Controller is present.

ü Verify that the vSphere Web Client has access to the ESXi host on which the virtual machines are running.

ü Required Privilege: Virtual Machine.Interaction.Add or Remove Device

Procedure

1. Select a virtual machine in the inventory and click the Summary tab.

2. Click the USB icon to the right of USB Devices under VM Hardware and select an available device from the drop-down menu.

image

3. A Connecting label and a spinner appear, which indicates that a connection is in progress. When the device has successfully connected and the Summary tab refreshes, the device is connected and the device name appears next to USB Devices.

image

 

Add USB Devices From a Client Computer to a Virtual Machine in the vSphere Client

Procedure

1. Select the virtual machine in the vSphere Client inventory.

2. Click the USB icon on the virtual machine toolbar.

3. Select an available device from the Connect to USB Devices drop-down menu.

The status of the device appears as Connecting. The device appears in the USB Connections drop-down menu and is ready to use. The device remains connected until you power off the virtual machine or disconnect the vSphere Client from the ESXi host

SNAGHTML1367df7b

When you remove device from Virtual Machine you will get below warning

SNAGHTML1368c20c

 

 

Add a USB Controller to a Virtual Machine in the vSphere Web Client

You can add two USB controllers to a virtual machine. The xHCI controller, available for Linux guest operating systems only, supports USB 3.0 superspeed, 2.0, and 1.1 devices. The EHCI+UHCI controller supports USB 2.0 and 1.1 devices.

imagePrerequisites

ü ESXi hosts must have USB controller hardware and modules that support USB 2.0 and 1.1 devices present.

ü Client computers must have USB controller hardware and modules that support USB 3.0, 2.0, and 1.1 devices present.

ü To use the xHCI controller on a Linux guest, ensure that the Linux kernel version is 2.6.35 or later.

ü Verify that the virtual machine is powered on.

ü Required Privilege (ESXi host passthrough): Virtual Machine.Configuration.Add or Remove Device

For virtual machines with Linux guests, you can add one or both controllers, but 3.0 superspeed devices are not supported for passthrough from an ESXi host to a virtual machine. You cannot add two controllers of the same type.

clip_image002 Procedure

1. Select a virtual machine.

2. In the VM Hardware panel, click Edit Settings.

3. Click Virtual Hardware.

4. From the Add a device drop-down menu, select USB Controller and click Add device.

The USB controller appears in the virtual device list above.

image

5. Click the USB controller triangle to expand the USB controller options.

6. Select the type of USB controller.

SNAGHTML133ffbe0

7. Click OK

NOTE In vSphere client, when you reopen the Properties Editor, the xHCI controller appears on the Hardware tab as USB xHCI controller. The EHCI+UHCI controller appears as USB controller.



Add USB Devices from an ESXi Host to a Virtual Machine in the vSphere Web Client

clip_image004 Prerequisites

1. Verify that the virtual machine is using hardware version 7 or later.

2. Verify that a USB controller is present.

3. To use vMotion to migrate a virtual machine with multiple USB devices, you must enable all attached USB devices for vMotion. You cannot migrate individual USB devices

4. Required privileges: Virtual Machine.Configuration.HostUSBDevice

clip_image005 Procedure

1. Select a virtual machine.

2. In the VM Hardware panel, click Edit Settings.

3. Click Virtual Hardware.

4. From the Add a device drop-down menu, select USB Device and click Add device.

The USB device appears in the virtual device list above.

5. Click the USB device triangle to expand the USB device options.

6. Select the device to add.

7. If you do not plan to migrate a virtual machine with USB devices attached, deselect the Support vMotion option. This reduces migration complexity, which results in better performance and stability.

8. Click OK.

 

image

You can add multiple USB devices, but only one device at a time.

 

image