JB's Homepage

One man on one island.

HowTo add a USB device permanently with VirtualBox 3.0+

Comments

So I was having a little trouble adding a USB device permanently to a Virtual Machine guest with VirtualBox. The trick is to use the VBoxManage command to add a USB filter into the Machine’s configuration which will automagically attach whenever the VM is run.

First, find a list of all usb devices on the host, remembering to run these commands as the user your VirtualBox machine is under. In this example we’ll be using a Canon MX7600 printer as a test USB device.

$ VBoxManage list usbhost

UUID:               6bac41f4-cc44-40e4-a726-4d9655a49f63
VendorId:           0x04a9 (04A9)
ProductId:          0x171c (171C)
Revision:           1.3 (0103)
Manufacturer:       Canon
Product:            MX7600 series
SerialNumber:       102787
Address:            /proc/bus/usb/007/004
Current State:      Captured

Now we use the details of the USB device to filter adding into our VirtualBox machine. In this case our VirtualMachine name is winxp.

The usbfilter command requires four options at a minimum.

VBoxManage usbfilter        add
--target ||global
--name
--action ignore|hold (global filters only)
[--active yes|no] (yes)
[--vendorid ] (null)
[--productid ] (null)
[--revision ] (null)
[--manufacturer ] (null)
[--product ] (null)
[--remote yes|no] (null, VM filters only)
[--serialnumber ] (null)
[--maskedinterfaces ]

So armed with this info let’s add our device.

VBoxManage usbfilter add 0 –target winxp –name canonmx7600 –action hold –active yes –vendorid 04A9 –productid 171C –revision 0103 –manufacturer Canon –product “MX7600 series” –serialnumber 102787

Written by Blade

January 27th, 2010 at 11:39 am

Viewing 4 Comments

 
close Reblog this comment
blog comments powered by Disqus