Ubuntu – VirtualBox traps CTRL-ALT when focused, interferes with workspace switching

shortcut-keysvirtualboxworkspaces

Setup: I have VirtualBox running, my guest OS is Windows 7. I also have multiple Ubuntu workspaces which I navigate with Ctrl+Alt+Arrow keys.

The problem is that when the virtual machine window gets focus, it traps the Ctrl+Alt keys (actually it traps all keys, which is technically correct behavior), but then those keys no longer perform my host OS workspace switching.

I'd like the workspace switch shortcut key to continue working even if my VM is focused. I suppose I wouldn't mind if both OSes receive the Ctrl+Alt+Arrow and process them (though my VM doesn't use these shortcut keys.)

My current workaround is to click outside (unfocus) the VM, but I don't want to have to do this.

There may be no solution to this, but I thought I'd ask.

Best Answer

At present there is no option to customize the capture behavior of host keystrokes in VirtualBox. It is either always "Auto Capture Keyboard" or never so. This can be defined in the application preferences from Virtual Box Manager preferences dialog.

A convenient way to temporarily toggle host keyboard capturing is pressing the Host-key once. By default this is set to RightCtrl but on my system I set it to RightShift as shown below:

enter image description here

If auto-capture was enabled we can use the host keys until we toggle back.

In case we had used AltTab application switcher the guest restores the default keyboard capture state when the guest windows gets focus again.

Related Question