Loading

×Sorry to interrupt
Uncaught ReferenceError: addCTracking is not defined
throws at https://kb.vmware.com/resource/KM_TealiumTrackingJS?v=0.5:100:1

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

My Subscriptions

Loading

Knowledge Base

Automatically connecting USB devices at virtual machine power on (1648)

Last Updated: 7/9/2019Categories: InformationalTotal Views: 45276Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

80 like this article

Subscribe to get an email
newsletter with new updates

80 people found this helpful Please provide article feedback:

Details

This article provides steps to configure a particular USB device to automatically connect to a virtual machine while the virtual machine starts.

Solution

This article provides a workaround that lets you automatically connect a USB device if you do not have access to the host that runs the guest operating system, and therefore cannot manually connect the device using the VM > Removable Devices menu. For more information about the preferred way to connect USB devices through the menu, see Connecting USB Devices to Virtual Machine section in the Using VMware Workstation Guide.

Note:

Workstation 5.5 and later enhances the auto connect feature to include support for name, path, and new PID/VID syntax. See the last section in this article, New Autoconnect Options for Workstation 5.5.

For a USB device that has configured with the autoconnect option in a specific VM 's configuration file (.vmx), it is not recommended to connect the device to other virtual machines.

To automatically connect a particular USB device:

Identify and obtain the USB device's vendor ID and product ID as reported by the host operating system.

Edit the virtual machine's configuration file (.vmx) to contain an autoConnect entry for the USB device.

Caution: Be aware that you may break the USB functionality for your virtual machine if you configure conflicting autoconnect settings.

Identifying and Obtaining the USB Device's Vendor ID and Product ID

On a Linux host, after you connect the USB device, you can find the vendor and product ID in the /proc/bus/usb/devices file.

For example:

more /proc/bus/usb/devices
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0529 ProdID=0001 Rev= 2.15
S: Manufacturer=AKS
S: Product=HASP HL 2.15

Here, 529 is the vendor ID and 1 is the product ID for the HASP HL device.

On a Windows host, you may find the vendor and product IDs in the registry.

Note: This procedure involves accessing the registry. Incorrect changes to the registry can leave your system unstable or unable to run. Always back up the registry before you edit it, and exercise caution in making changes to the registry. VMware takes no responsibility for problems that may arise.

Select Start > Run and type regedit, and click OK. The Registry Editor window opens.

Search for your USB device's name or brand in this registry path:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\

For example: This output is a result of searching for a Cruzer Mini USB key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_0781&Pid_7101\00526174
HardwareID: USB\Vid_0781&Pid_7101&Rev_0102
USB\Vid_0781&Pid_7101
LocationInformation: Cruzer Mini
Mfg: Compatible USB storage device

Here, the vendor ID is 781 and the product ID is 7101.

Editing the Virtual Machine's Configuration File

The configuration (.vmx) file is located in the same directory in which the virtual machine was created. Ensure that the virtual machine is powered off before you edit this file.

To autoconnect the HASP HL device from the previous example, add this line in the .vmx file of the virtual machine:

usb.autoConnect.device0 = "0x529:0x1"

Or, for the Cruzer Mini device, add:

usb.autoConnect.device0 = "0x781:0x7101"

Note: Prepend 0x to each value — it must be in hex format.

You can specify multiple devices for autoconnect, provided that there are not more than two USB devices available to the host at the same time. You can see multiple entries for autoConnect in this example. An ellipsis [...] indicates the omission of an actual vendor or product ID. You need to include a specific value, as shown for device0 and device1.

usb.autoConnect.device0 = "0x529:0x1"
usb.autoConnect.device1 = "0x781:0x7101"
usb.autoConnect.device2 = ....
usb.autoConnect.device3 = ....

You can use the auto clean option in usb.autoconnect:

autoclean:1 - autoconnect if a device matches the pattern, removed if the VM is powered on and no device matches the pattern, removed if disconnected through the UI.

autoclean:0, no autoclean - autoconnect if a device matches the pattern, not removed if the VM is powered on and no device matches the pattern, not removed if disconnected through UI. Although the autoconnect entries are not removed, the device will not autoconnect again after the user disconnects the device using the UI for that session of the VM. The same device will autoconnect when the VM is restarted or when the device is physically unplugged and replugged into the same port on the host.

For example, you may enter this option at the end of the autoconnect line:

usb.autoConnect.device0 = "vid:0x781 pid:0x7101 autoclean:1"

For more information about using USB devices in Workstation, see Using Removable Devices in Virtual Machines section in the Using VMware Workstation Guide.

Autoconnect Options for Workstation 5.5, Fusion 3.x and later

The parameters for autoconnecting USB devices are expanded to include the USB device name and path, in addition to the already supported PID and VID syntax. Workstation also makes extra information available in the vmware.log file, located in the virtual machine directory, to make entering these parameters easier.

When a device is connected to the host, the virtual machine discovers the device and adds an entry to vmware.log. The virtual machine also discovers all devices attached to the host when the virtual machine is powered on, resumed, or reverted, and adds an entry for each device. For example, consider this vmware.log entry:
XXX XX XX:XX:XX: vmx| USB: Found device [name:SomeCompany\ USB device vid:0123 pid:abcd path:1/2/1]

There are four space-separated parameters available: name, vid, pid, and path.

The name Parameter

The name parameter is the string that describes the USB device. You may add the complete string of the USB device as a parameter, or a partial string if you want to match multiple USB devices for a specific word. Note that the string is not case sensitive and that spaces must be escaped with a backslash [ \ ] as they are in the vmware.log string.

To match the whole string from the example, use:

usb.autoConnect.device0 = "name:SomeCompany\ USB device"

To match all USB devices with SomeCompany in their names, use:

usb.autoConnect.device0 = "name:SomeCompany"

The vid and pid Parameters

The vid and pid parameters do the same thing as the previous autoconnect entry. To match the SomeCompany USB device in the preceding example, use:

usb.autoConnect.device0 = "vid:0123 pid:abcd"

To match any device that has the Vendor ID (VID) of SomeCompany, use:

usb.autoConnect.device0 = "vid:0123"

The path Parameter

The path parameter in vmware.log provides the path to the specific port on the host where the USB device is attached. Using autoconnect with the path entry binds a specific host port to that virtual machine. If the path parameter is used exclusively, any device that is attached to that host port automatically connects to that virtual machine.

To always connect any device attached to the host port in the above example, use:

usb.autoConnect.device0 = "path:1/2/1"

You can use the name, vid, pid, and path parameters in any combination. For the autoconnect to succeed, each parameter you enter must match.

To autoconnect the USB device in the example when connected to the same host port, use:

usb.autoConnect.device0 = "name:SomeCompany\ USB\ device vid:0123 pid:abcd path:1/2/1"

To autoconnect the USB device in the example, regardless of the host port to which it is connected, use:

usb.autoConnect.device0 = "name:SomeCompany\ USB\ device vid:0123 pid:abcd"

Additional Information

For translated versions of this article, see:

Español: Conectar dispositivos USB de forma automática cuando se enciende la máquina virtual (2034901)

Português: Conectar automaticamente dispositivos USB na máquina virtual ao inicializar (2036597)

日本語: 仮想マシンのパワーオン時に自動的に USB デバイスに接続する (2078406)

简体中文: 在虚拟机打开电源时自动连接 USB 设备 (2085977)

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

Result 1 of 1

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware Workstation Pro

VMware Workstation Player

VMware Workstation

VMware Server

VMware Player

VMware Fusion Pro

VMware Fusion

Related Versions:

VMware Workstation Pro 15.x (Windows)

VMware Workstation Pro 15.x (Linux)

VMware Workstation Pro 14.x (for Windows)

VMware Workstation Pro 14.x (for Linux)

VMware Workstation Player 15.x (Windows)

VMware Workstation Player 15.x (Linux)

VMware Workstation Player 14.x (Windows)

VMware Workstation Player 14.x (Linux)

VMware Workstation Player 12.x (Windows)

VMware Workstation Player 12.x (Linux)

VMware Workstation 9.x (Windows)

VMware Workstation 9.x (Linux)

VMware Workstation 8.x (Windows)

VMware Workstation 8.x (Linux)

VMware Workstation 7.x (Windows)

VMware Workstation 7.x (Linux)

VMware Workstation 6.x (Windows)

VMware Workstation 6.x (Linux)

VMware Workstation 5.x (Windows)

VMware Workstation 5.x (Linux)

VMware Workstation 11.x (for Windows)

VMware Workstation 11.x (for Linux)

VMware Workstation 10.x (Windows)

VMware Workstation 10.x (Linux)

VMware Server 1.0.x (Windows)

VMware Server 1.0.x (Linux)

VMware Player Pro 7.x (Windows)

VMware Player Pro 7.x (Linux)

VMware Player 7.x (Windows)

VMware Player 7.x (Linux)

VMware Player 6.x (Windows)

VMware Player 6.x (Linux)

VMware Player 5.x (Windows)

VMware Player 5.x (Linux)

VMware Player 4.x (Windows)

VMware Player 4.x (Linux)

VMware Player 3.x (Windows )

VMware Player 3.x (Linux)

VMware Player 2.x (Windows)

VMware Player 2.x (Linux)

VMware Player 1.x (Windows)

VMware Player 1.x (Linux)

VMware Fusion Pro 8.x

VMware Fusion Pro 11.x

VMware Fusion Pro 10.x

VMware Fusion 8.x

VMware Fusion 7.x

VMware Fusion 6.x

VMware Fusion 5.x

VMware Fusion 4.x

VMware Fusion 3.x

VMware Fusion 2.x

VMware Fusion 11.x

VMware Fusion 10.x

VMware Fusion 1.x

view all

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant