Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I restrict a VirtualBox guest from accessing certain USB ports/devices on my host machine? I have some theories on how I might do this, but I really can only guess.

For further clarification, let's say a USB device was causing issues on my guest machine in VirtualBox, but that USB device is critical to my host machine. I need to blacklist VirtualBox from using certain USB devices.

The host being Ubuntu and the guest being Windows.

Update: I disabled the USB controller, uninstalled the extension pack, and even set mouse and keyboard to PS/2. Guest is still able to access my USB ports even though I have done no configuration to allow it to do so.

share|improve this question
    
You have to explicitly allow access to host USB ports. – Daniel Feb 27 at 16:44
    
I wish that was so, unfortunately Windows has access to some USB ports that I did not even realize. Such as webcam, microphone, gamepad, etc. It's really quite strange. – ctrev Feb 27 at 16:45
    
Do you need any USB ports at all with the guest? – Daniel Feb 27 at 16:45
    
If not then you can just disable the USB controller. – Daniel Feb 27 at 16:45
2  
Mouse and Keyboard don't require USB access. It's all handled implicitly. – Daniel Feb 27 at 16:48
up vote 5 down vote accepted

From what you've told me in comments, you don't need USB support at all. Just disable the USB controller:

Screenshot

Set these checkboxes to disabled.

share|improve this answer
    
USB controller has been off =(. – ctrev Feb 27 at 16:51
    
So the controller is off, and you're still getting USB devices showing up? This shouldn't be possible. – Daniel Feb 27 at 16:52
    
In the guest window, go to the Devices menu tab and make sure that no USB devices are enabled. – Daniel Feb 27 at 16:52
1  
Thanks for the accept! – Daniel Feb 27 at 17:02
2  
@ctrev you can disable audio in the vm settings which should disable the microphone if you don't require sound in the vm. – Elder Geek Feb 27 at 17:20

You can use usbfilter (global/local) to explicitly forbid acces to all VMs/single VM to specific USB device. See man page for details: http://www.virtualbox.org/manual/ch08.html#idp46730496651168

share|improve this answer
    
I heard about someone using usbfilter before in the past but I do not know how to use it myself. – ctrev Feb 27 at 16:52
    
Looking more into it, this might be a fix. It says "Global filters are applied before machine-specific filters, and may be used to prevent devices from being captured by any virtual machine" In my case that is precisely what I need. But I do not see any examples of how to use the command. – ctrev Feb 27 at 16:57
2  
It needs to be done from command line using VBoxManage usbfilter with option --action ignore. – Takkat Feb 27 at 17:00
1  
and to list all devices run this command: VBoxManage list usbhost – Ivan Temchenko Feb 27 at 17:02
1  
It would be cool if you could edit your answer to include all this, preferably with an example syntax line ;) – Takkat Feb 27 at 17:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.