Skip to content

Instantly share code, notes, and snippets.

@dsaenztagarro
Last active June 30, 2023 08:56
Show Gist options
  • Save dsaenztagarro/b64776857522c8bc44d2 to your computer and use it in GitHub Desktop.
Save dsaenztagarro/b64776857522c8bc44d2 to your computer and use it in GitHub Desktop.
USB devices on VirtualBox
Host commands
VboxManage list usbhost
VBoxManage controlvm usbattach <uuid>|<address>
VBoxManage controlvm usbdetach <uuid>|<address>
Vagrantfile

Arguments vendorid and productid are provided by command VBoxManage list usbhost

 config.vm.provider :virtualbox do |vb|
   vb.customize ['modifyvm', :id, '--usb', 'on']
   vb.customize ['modifyvm', :id, '--usbehci', 'on']
   vb.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'Sony Ericsson', '--vendorid', '0x08e6', '--productid', '0x3438']
 end
Guest commands
lsusb
adb devices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment