11

I have VMware workstation 9 and 10, and I am wanting to use that to run some integration tests.

Using the vmrun utility, I can copy scripts to and run them on the virtual machine guests. However, some of the integration tests will require interfacing with USB devices.

Is there any way using vmrun, or any of the vmware API's to programmatically control the "Removable Devices" to connect and disconnect USB devices to virtual machines?

I have tried looking at the readVariable and writeVariable commands, however I cannot find any useful information on that subject.

whatsisname
  • 5,872
  • 2
  • 20
  • 27
  • I am running VMware Workstation Player 14 and I have the exact same question.Extension of the question : can it be done from the host and/or from the guest ? – wap26 Nov 22 '17 at 09:06

1 Answers1

0

vmrun has no facility to passthrough USB devices from the host to the guest and vice versa (source, VMware employee). There are though 2 options to achieve this behavir

A) Use autoconnect: look here and here on how to modify the .VMX file to auto connect the USB device to the guest VM. Basically you need to add usb.autoConnect.device0 = "vid:XXXX pid:XXXX" to it.

B) Use askConnection: When you plugged in the device to the host, and the VM is powered on, you can select to connect the device to the VM and remember the choice. Then the next time when you pluggin the device again, the device will be automatically connected to the remembered VM. Also, you can configure in Edit > Preferences > USB for other choices. Currently, this feature only works when you plug in the device.

Gaia
  • 2,872
  • 1
  • 41
  • 59