Getting host to capture certain key presses in VirtualBox

I'm using VirtualBox on Ubuntu 9.10 with Windows XP as the guest OS.

It's pretty annoying that when I am in the guest OS - I can't switch virtual desktops (workspaces) on the host (Ubuntu) by pressing Control+Alt+(Left|Right|Up|Down) because VirtualBox captures those key combinations.

Is it possible to disable keyboard capture for some key combinations?


While there are some Host Key shortcuts that activate certain VirtualBox functions (eg, Host Key+P which pauses the Guest), I don't know of any way to configure VirtualBox to send Host Key shortcuts to the Host OS.

However, since VirtualBox has an open source edition, it may be possible to modify the source code to add this feature. You can access the VirtualBox source code at the Download link.

In the meantime, you can use the Host Key to release the keyboard from the VirtualBox Guest's control. By default the Host Key is set to Right Ctrl. You can see the current Host Key in the VM window:

alt text

Just press the Host Key once to release the keyboard capture. After that, your Host OS will see your keypresses. So here's your workflow:

  1. Press and release the Host Key. Your Guest OS no longer captures keypresses.
  2. Press Ctrl+Alt+(Arrow key) to switch workspaces, or any other keys you want to send to the Host OS.

This question is old, but I found a better solution that probably didn't exist back then.

You can disable "Auto capture keyboard" in Manager window -> File menu -> Preferences -> Input:

enter image description here

This disables the automatic keyboard grabbing completely, so window manager keybindings are passed directly to it.

In this mode, the 'host' key has the opposite effect - it enables grabbing instead of disabling it.