VMware Communities
Jake1042
Enthusiast
Enthusiast
Jump to solution

Make sure Touch-USB connects to VMware at startup

I have a user interface application running in a VMware run by a VMware Player on a stand-alone PC.

Input is generated by user through a Touch-screen with USB-touch.

It works very well when the USB-touch is connected to the VMware, The problem is that when the VMware restarts the USB-touch is connected to the host-PC.

If I unplug the USB and re-inserts a pop-up is displayed on the VMware - asking if it should connect to host or VMware. I select VMware and check the box "remember choice and dont ask again". But next time the VMware starts, the USB-touch is again connected to the host...

In the VMware I can open the menu and select "Removable Devices" and disconnect from host - then it is directly connected to the VMware - and it works as intended.

How do I make sure this is permanently set to always connect to the VMware upon startup of the VMware?

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
bluefirestorm
Champion
Champion
Jump to solution

The autoconnect problem that I was referring to is Workstation/Player failing to insert automatically the autoconnect by path when the VM is shut down while the USB device is attached to it. I haven't encountered that problem. I wasn't expecting the removing allowHID entries to fix that. I don't know why the Player software you have right now is not inserting the autoconnect string automatically on your behalf.

Note that the other thread you referred to only has the word usb instead usb_xhci that is why I suspect the KB text is not up to date. XHCI refers to USB 3.0.

Notice the path is also indicated is also in the vmware.log entry

So what I'd suggest you try is (using the SanDisk Ultra vmware.log entry as example)

#vid pid for SanDisk Ultra

usb_xhci.autoconnect.device0 = "vid:0781 pid:5581"

or using by path

#autoconnect using path

usb_xhci.autoconnect.device0 = "path:1/0/0/13"

Or you straight away do this with the USB Touch device.

View solution in original post

Reply
0 Kudos
13 Replies
scott28tt
VMware Employee
VMware Employee
Jump to solution

Moderator: Two things to note:

1. VMware is a company, the product you are using is Workstation - there is no such thing as “the VMware”, there is a “VM” though.

2. Please start threads in the area for the product you are using.

Thread moved to the Workstation Player area.


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

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
Jake1042
Enthusiast
Enthusiast
Jump to solution

I can see in this forum, that the "Autoconnect" feature should connect previously connected USB-devices when the VM is started.

My host-PC is running Win10-64

It autostarts Workstation Player 15.1.0 opening the VM (running Win10-64).

When that happens the list of Removable Devices shows the "Elo TouchSystems 2700 INtelliTouch(r) USB" -> "Connect (Disconnect from host)

I.e. the USB-device is not connected when starting up the VM. I connect it - but next time it is again not connected.

How do I make this Autoconnect work?

Do I have to specify it somewhere in a setup file so it is done at start of the VM?

On other installations I use Workstation Player 15.5.6 - and soon newer versions... I would expect this to be a simple feature that works the same way across versions.

Reply
0 Kudos
bluefirestorm
Champion
Champion
Jump to solution

Most of the time, USB devices that were connected to VM when the VM was powered off will automatically reconnect. The USB autoconnect string (by path) is added into the vmx on your behalf.

This KB article is about adding USB autoconnect string manually inside the vmx https://kb.vmware.com/s/article/1648

although I don't think it appears to be updated. If the USB is version 3.0 the string added automatically is usb_xhci.autoConnect.device

You can see for yourself the autoconnect string by trying out using a USB thumb drive.

The device is considered a Human Interface Device (HID), the same category as keyboards/mice.

Try adding/modifying the following inside the vmx configuration

usb.generic.allowHID = "TRUE"

usb.generic.allowlastHID = "TRUE"

Just be careful once these entries are in, the USB keyboard and mouse of the host will appear in the "Removable Devices" and connecting these to the VM will make your host lose its keyboard and/or mouse. That might be why the autoconnect is not being added as the device is a HID.

Reply
0 Kudos
Jake1042
Enthusiast
Enthusiast
Jump to solution

Thanks.

However - I cant locate the relevant file:

"configuration (.vmx) file is located in the same directory in which the virtual machine was created".

I have the following files:

IMG_1039.jpg

I have tried adding a USB-drive to see if that is then reflected in this file. But it is not. The date of the VMXF File is also 7/30/2019 - i.e. not current.

I left the USB-drive inserted during the rebooting of the VM - but it did not Autoconnect after reboot of the VM.

Any suggestions?

Reply
0 Kudos
bluefirestorm
Champion
Champion
Jump to solution

You can show extensions for all types in Explorer options.

The .vmx file is the one from the .vmxf in the picture you pasted. If you look at the type of the file above the .vmxf it should show VMware virtual machine configuration. Make sure you right click and open with Notepad. If you doubleclick this file, it will open with VMware Player.

You can make a copy of this vmx file before editing for fallback purposes.

As for the USB thumb drive. You should see the autoconnect string after you power off the VM without disconnect the USB thumb drive from the VM.

Reply
0 Kudos
Jake1042
Enthusiast
Enthusiast
Jump to solution

I have now looked into the "VMware virtual machine configuration" file.

I can't get an entry from a USB-drive - no matter how I add it and leave it in when shutting down...

It shows the following at the end:

sata0:1.startConnected = "FALSE"

usb_xhci:6.speed = "2"

usb_xhci:6.present = "TRUE"

usb_xhci:6.deviceType = "hub"

usb_xhci:6.port = "6"

usb_xhci:6.parent = "-1"

usb_xhci:7.speed = "4"

usb_xhci:7.present = "TRUE"

usb_xhci:7.deviceType = "hub"

usb_xhci:7.port = "7"

usb_xhci:7.parent = "-1"

svga.vramSize = "268435456"

checkpoint.vmState = ""

floppy0.present = "FALSE"

tools.upgrade.policy = "useGlobal"

usb_xhci:4.present = "TRUE"

usb_xhci:4.deviceType = "hid"

usb_xhci:4.port = "4"

usb_xhci:4.parent = "-1"

The entry

usb_xhci:4.deviceType = "hid"

is maybe the touch-panel.... (but there is also a USB-Mouse at present).

I tried adding at the end:

usb_xhci:4.startConnected = "TRUE"

But that did not have any effect - and the line was in fact gone after the VM was shut down…

So I am a little stuck at the moment.

Reply
0 Kudos
Jake1042
Enthusiast
Enthusiast
Jump to solution

Tried adding the statements:

usb.generic.allowHID = "TRUE"

usb.generic.allowlastHID = "TRUE"

That just made the mouse and keyboard appear in the list of removable devices - along with the USB-Touchscreen. But all were connected to host.

Connected the Touchscreen to the VM and shut down. When starting again it was connected to the host.

Reply
0 Kudos
bluefirestorm
Champion
Champion
Jump to solution

Looks like the problem is that it is not setting the auto connect for any USB device.

Please don't simply add any vmx entries unless you know what they mean.

What version of Player are you using?

On Player 16, go to Player -> File -> Preferences

There is a choice on what to do for new USB. You can set it to any of the two other than "Ask me what to do".

Assuming if this preference setting resolves the problem of USB thumb drive autoconnecting to the VM. One trick is to connect the USB thumb drive to where you want to connect the USB touch device.

Plug USB thumb drive to port where you want to connect the USB touch device

Connect USB thumb drive to VM.

Shut down the VM without disconnecting the USB thumb drive

Power up VM again

If USB thumb drive automatically connect to VM, that means the autoconnect entry by path is there.

Shut down the VM again without disconnect USB thumb drive

Unplug USB thumb drive from the host and replace with USB touch device.

Since the auto connect is by path, it should try to auto connect the USB touch device without having to edit the vmx configuration file

Reply
0 Kudos
Jake1042
Enthusiast
Enthusiast
Jump to solution

Thank you for your patience...

I am using version 15.1.0 of the Workstation Player.

I opened preferences and have now selected "Connect the device to the running virtual machine". So when I plug in the Touchscreen - it connects to the VM without any question.

I tried adding a USB-drive - leaving it in while shutting down and starting up the VM again.

It does not autoconnect. It is listed in Removable Devices - but connected to host.

So clearly - the autoconnect seems not to work.

I have seen in this newsgroup that autoconnect did not work on player 15.5 - but maybe it does also not work for the version I am using...?

Is there a patch, I can try?

Reply
0 Kudos
bluefirestorm
Champion
Champion
Jump to solution

You can take out the

usb.generic.allowHID = "TRUE"

usb.generic.allowlastHID = "TRUE"

At first I thought that might be stopping the autoconnect string generation. I just tried with a Wacom tablet (which is also a HID) and it didn't require those entries and it created the autoconnect strings if I leave it connected to the VM upon shutting down.

You could try with using the VID:PID method specified in the KB. If the VM is using USB 3.0 just use

usb_xhci.autoConnect.device0 =

The VID:PID should also be visible in the vmware.log file if the USB devices are plugged to the host.

Reply
0 Kudos
Jake1042
Enthusiast
Enthusiast
Jump to solution

I took out:

usb.generic.allowHID = "TRUE"

usb.generic.allowlastHID = "TRUE"

Still the USB-drive does not autoconnect. After being connected a reboot of the VM will leave it connected to the host in Removable Devices - and I cant find any entry in the configuration file.

I am considering trying a different version of the player - to see if that changes anything. I have version 15.5.0 and 15.5.6

I believe now the latest version in 16 - I could download a free testversion.

Do you think there is something to the "autoconnect not working" error? Autoconnecting USB devices stopped working

I dont quite understand "try with using the VID:PID method specified in the KB"..?

What is KB? I looked in the VMware log file but cant find the word "VID:PID" - I can find:

2020-10-07T17:15:40.898+02:00| vmx| I125: USB: Found device [name:SanDisk\ Ultra vid:0781 pid:5581 path:1/0/0/13 speed:super family:storage,storage-bulk virtPath:usb_xhci:0 instanceId:USB\\VID_0781&PID_5581\\4C530001121011123024 serialnum:4C530001121011123024 arbRuntimeKey:d ownerdisplay:052_TestC1\ HMI\ HostPC version:3], connected to usb_xhci port 0.

Mybe that is what you are referring to? It may also indicate a USB-3.0 connection..? ("HostPC version:3")

Reply
0 Kudos
bluefirestorm
Champion
Champion
Jump to solution

The autoconnect problem that I was referring to is Workstation/Player failing to insert automatically the autoconnect by path when the VM is shut down while the USB device is attached to it. I haven't encountered that problem. I wasn't expecting the removing allowHID entries to fix that. I don't know why the Player software you have right now is not inserting the autoconnect string automatically on your behalf.

Note that the other thread you referred to only has the word usb instead usb_xhci that is why I suspect the KB text is not up to date. XHCI refers to USB 3.0.

Notice the path is also indicated is also in the vmware.log entry

So what I'd suggest you try is (using the SanDisk Ultra vmware.log entry as example)

#vid pid for SanDisk Ultra

usb_xhci.autoconnect.device0 = "vid:0781 pid:5581"

or using by path

#autoconnect using path

usb_xhci.autoconnect.device0 = "path:1/0/0/13"

Or you straight away do this with the USB Touch device.

Reply
0 Kudos
Jake1042
Enthusiast
Enthusiast
Jump to solution

Now it works.

I inserted the line

usb_xhci.autoconnect.device0 = "vid:04e7 pid:0020"

where the proper "vid:04e7 pid:0020" was identified for the ELO-screen in the logfile "vmware".

The PC has four USB-ports - and this statement works for all four ports - i.e. no matter which one I use for the touchscreen, then it autoconnects.

I find that a little strange - but very convenient, though...

I thought the "vid:04e7 pid:0020" was some kind of MAC-ID - but I can see that it is the same on all (at least two...) of the same Touchscreens.

Thank you for your help bluefirestorm.

Reply
0 Kudos