Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I'm running VirtualBox Version 4.2.0 r80737.

I have a USB keyboard that I usually just want filtered to the VirtualBox, but occasionally I want to free it up so that I can use it in the host OS as well. I was looking at VBoxManage in the documentation, and saw the promising looking "usbfilter" option, but when I tried usbfilter add/modify I got the error:

The machine 'your name here' is already locked for a session (or being unlocked)

So it seems that it doesn't affect the running machine (at least not through that option). I really just want to be able to programatically do the same thing as going through the menu to Devices > USB Devices > USB Keyboard [0001].

I don't care whether it's from the host or guest OS that I can access it.

Is this possible, and if so, how can I do it?

share|improve this question
up vote 3 down vote accepted


VBoxManage controlvm usbattach <uuid>|<address>
VBoxManage controlvm usbdetach <uuid>|<address>

as described in manual.

share|improve this answer
That looks more promising. Now I just need to find my UUID/address. So far I've failed to find anything useful. – Wayne Werner Dec 6 '12 at 15:07
And just after I wrote that I discovered VboxManage list usbhost. Hooray! It works! – Wayne Werner Dec 6 '12 at 15:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .