How to manage USB devices with VMware vmrun?

950 Views Asked by At

I'm using VMware Fusion 6 to do some integration tests with multiple iOS devices.

When I connect a device to the computer, a dialog appears asking me if I wish to connect to the Mac or to the VM.

enter image description here

Is there a way to do this programmatically? I'm using vmrun to manage the Virtual Machines but I can't find a option to connect/disconnect USB devices.

1

There are 1 best solutions below

0
On

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 behavior, and A is easier to automate.

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.