Ubuntu – Virtualbox in Ubuntu 16.04 – Unity grabs Alt and Super key

keyboardunityvirtualbox

This is something that was answered in the past already for previous versions, there are bug reports but nothing really solves it and it's still present in 16.04

If you have Ubuntu 16.04 Unity as host and Windows guest in Virtualbox VM, when you are on the Windows guest using Super or Alt keys makes that both the guest and unity capture the key. Super key will open the Dashboard in Unity host and Start menu in Windows Guests and Alt key will open the HUD in Unity and any of the uses of Alt in Windows.

There are several bug reports about this. I.e.:
https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/741869
https://bugs.launchpad.net/unity/+bug/1060225

and the only workaround is this:
How do I prevent Ubuntu from capturing the Alt key to show the HUD?

Which is simply to 'disable' the HUD key in CCSM… not a good solution.

Does someone knows a good workaround or if this is on going to be fixed? This kind of extremely annoying bug, very located, is something that makes me unable to use Ubuntu for work (Yes… I can't be working with VM and having menus of Unity popping up all time)

VirtualBox is widely used, I understand that this is a major issue but in internet I can't find a proper fix. Am I missing anything?

Note 1: I also use Linux Mint 17.3 Cinnamon and this doesn't happen there.
Note 2: This happens (that I have tested) with every version since Ubuntu 14.04
Note 3: Checking similar questions about this and the different bugreports, VMWare and any other application (games, etc) that require to use the or keys, have same issue. And there is no intention to fix it in any bugreport…. it's a shame!!

Best Answer

You can also use CCSM to assign another key to show the HUD when tapped, not only to disable it. You just need to click on the <Alt> button in the same menu -the red arrow- points to in the example image (below), and then click in "Grab key combination" button instead of the "Enabled Box" and select another key combination to show the HUD.

compizconfig settings manager image example

To install CCSM use

sudo apt-get install compizconfig-settings-manager

or you can search for it in "Ubuntu Software" in unity.

Then you can start it from the Dash by searching for CCSM and then click in the "Ubuntu Unity Plugin" button.

Note: Maybe you will also want to assign another key to "Show the menu bar when pressed", because it also uses only <Alt> keystroke to function. The difference between the two is that, to show the HUD, you just need to press the key and then rapidly let go, and to show the menu bar, you need to maintain the key pressed for more than a second. I don't know if the second also affects normal behavior in a Windows VM in Virtualbox.

Note2: The same goes for <Super> key. The only difference is that the option to change this keystroke is in the "Launcher panel" in the same Unity menu in CCSM.