There are multiple ways to do much of this. I'm going to explain some. I'm going to say 'iPhone,' because that is the USB device I'm going to connect. You can do something VERY similar for other USB devices. In these instructions, all commands, editing, files, etc. are on the Linux host, unless specifically designated otherwise.
Note that VID (or vid) is short for Vendor ID, and PID (or pid) is short for Product ID.
The first thing you have to do is to find the necessary information about your USB device. Here are two methods.
- Make sure your VM is running. Plug in your iPhone.
- Using either the VMware menus or the VMware icon for your iPhone, connect your iPhone to your VM manually.
- Open a Terminal session in the folder where your VM's .vmx file lives. Execute this command:
- grep -i usb vmware.log | grep -i device | more
USB: Found device [name:Apple\ iPhone vid:05ac pid:1294 path:2/1/1 speed:high family:vendor,imaging]
Note the values for vid and pid (0x05ac and 0x01294 -- they are hex).
At a bash prompt, run:
You're going to examine the output from lsusb, until you find the information for your iPhone. I found something like:
Bus 002 Device 008: ID 05ac:1294 Apple, Inc. iPhone 3GS
Basically, this tells me that I have an iPhone plugged into a specific USB port (bus 2, device 8). After the "ID" it provides the vid and the pid (0x5ac and 0x1294).
I confirmed that I had the right values by taking the bus number (2) and the device number (8) from the output, and I ran:
lsusb -v -s 2:8 | more
This tells it to tell me all the details about the device on bus 2, device 8. I'm not going to show you all of that output, but the important information was:
idVendor 0x05ac Apple, Inc.
idProduct 0x1294 iPhone 3GS
So my VID is 0x05ac, and my PID is 0x1294.
After Method 1 or Method 2:
Power down the VM, and edit the .vmx file. Add a line which resembles the following. (If you already have usb.autoConnect.device0, use device1; if you have device1, use device2; etc.)
usb.autoConnect.device0 = "0x5ac:0x1294"
Of course, if you're using a different device than my iPhone 3Gs, substitute your vid:pid values.
This is supposed to connect the iPhone when the VM starts, if the iPhone is already plugged into the host. It doesn't do that for me. What it does do is to connect my iPhone to the VM if the VM is running when I plug in the iPhone.