VMware Cloud Community
Disbalance
Contributor
Contributor

USB passthrough via CLI

Hi, i have a unusual task. I wanted to know how i can passthrough USB devices via CLI, while my VM is on.

Basically it always possible and always works fine via UI. 

As of today i can do this by editing .vmx file of my VM, adding path of usb device. But editing .vmx file is only possible when VM is off.

Could anybody help me with that ?

0 Kudos
4 Replies
LucD
Leadership
Leadership

Did you try with the method in vSphere USB Passthru and Autoconnect Devices and PowerCLI


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Disbalance
Contributor
Contributor

No, i didn’t try this method, but actually i need to passthrough USB device by usb path, but before it i should now this path, as that method shows it by VID and PID, unfortunately it doesn’t compatible with my case.

0 Kudos
LucD
Leadership
Leadership

Then you could perhaps show us what you add in the VMX file


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Disbalance
Contributor
Contributor

First of all i need to start the VM and only then i can see all the paths of connected usb devices.

then i should  add new line to .vmx file.

usb.autoConnect.device0 = "path:1/3/0/1 autoclean:1"

But as i said before editing of .vmx file is possible only VM is off, as Vcenter can do the same when VM is on. I’m looking for the same solution but from CLI.

0 Kudos