8.31. VBoxManage usbfilter add/modify/remove

Oracle VM VirtualBox

8.31. VBoxManage usbfilter add/modify/remove

VBoxManage usbfilter        add <index,0-N>
                          --target <uuid|vmname>global
                          --name <string>
                          --action ignore|hold (global filters only)
                         [--active yes|no (yes)]
                         [--vendorid <XXXX> (null)]
                         [--productid <XXXX> (null)]
                         [--revision <IIFF> (null)]
                         [--manufacturer <string> (null)]
                         [--product <string> (null)]
                         [--remote yes|no (null, VM filters only)]
                         [--serialnumber <string> (null)]
                         [--maskedinterfaces <XXXXXXXX>]
    
VBoxManage usbfilter        modify <index,0-N>
                          --target <uuid|vmname>global
                         [--name <string>]
                         [--action ignore|hold (global filters only)]
                         [--active yes|no]
                         [--vendorid <XXXX>]
                         [--productid <XXXX>]
                         [--revision <IIFF>]
                         [--manufacturer <string>]
                         [--product <string>]
                         [--remote yes|no (null, VM filters only)]
                         [--serialnumber <string>]
                         [--maskedinterfaces <XXXXXXXX>]
    
VBoxManage usbfilter        remove <index,0-N>
                          --target <uuid|vmname>global
    

The usbfilter commands are used for working with USB filters in virtual machines, or global filters which affect the whole VirtualBox setup. Global filters are applied before machine-specific filters, and may be used to prevent devices from being captured by any virtual machine. Global filters are always applied in a particular order, and only the first filter which fits a device is applied. So for example, if the first global filter says to hold (make available) a particular Kingston memory stick device and the second to ignore all Kingston devices, that memory stick will be available to any machine with an appropriate filter, but no other Kingston device will.

When creating a USB filter using usbfilter add, you must supply three or four mandatory parameters. The index specifies the position in the list at which the filter should be placed. If there is already a filter at that position, then it and the following ones will be shifted back one place. Otherwise the new filter will be added onto the end of the list. The target parameter selects the virtual machine that the filter should be attached to or use "global" to apply it to all virtual machines. name is a name for the new filter and for global filters, action says whether to allow VMs access to devices that fit the filter description ("hold") or not to give them access ("ignore"). In addition, you should specify parameters to filter by. You can find the parameters for devices attached to your system using VBoxManage list usbhost. Finally, you can specify whether the filter should be active, and for local filters, whether they are for local devices, remote (over an RDP connection) or either.

When you modify a USB filter using usbfilter modify, you must specify the filter by index (see the output of VBoxManage list usbfilters to find global filter indexes and that of VBoxManage showvminfo to find indexes for individual machines) and by target, which is either a virtual machine or "global". The properties which can be changed are the same as for usbfilter add. To remove a filter, use usbfilter remove and specify the index and the target.

The following is a list of the additional usbfilter add and usbfilter modify options, with detailed explanations on how to use them.

  • --action ignore|holdSpecifies whether devices that fit the filter description are allowed access by machines ("hold"), or have access denied ("ignore"). Applies to global filters only.

  • --active yes|noSpecifies whether the USB Filter is active or temporarily disabled. For usbfilter create the default is active.

  • --vendorid <XXXX>|""Specifies a vendor ID filter - the string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes).

  • --productid <XXXX>|""Specifies a product ID filter - The string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes).

  • --revision <IIFF>|""Specifies a revision ID filter - the string representation for the exact matching has the form IIFF, where I is the decimal digit of the integer part of the revision, and F is the decimal digit of its fractional part (including leading and trailing zeros). Note that for interval filters, it's best to use the hex form, because the revision is stored as a 16 bit packed BCD value; so the expression int:0x0100-0x0199 will match any revision from 1.0 to 1.99 inclusive.

  • --manufacturer <string>|""Specifies a manufacturer ID filter, as a string.

  • --product <string>|""Specifies a product ID filter, as a string.

  • --remote yes|no""Specifies a remote filter - indicating whether the device is physically connected to a remote VRDE client or to a local host machine. Applies to VM filters only.

  • --serialnumber <string>|""Specifies a serial number filter, as a string.

  • --maskedinterfaces <XXXXXXXX>Specifies a masked interface filter, for hiding one or more USB interfaces from the guest. The value is a bit mask where the set bits correspond to the USB interfaces that should be hidden, or masked off. This feature only works on Linux hosts.