3

Before I launch a virtual machine in VMware, all the modifier keys function properly. Even when I launch VMware, but before I start the virtual machine everything works great.

However once I start a virtual machine my left Ctrl and right Shift keys stop functioning. They simply have no affect.

Here are a few observations that might lead to something:

  • My left Shift still keeps working.
  • I mapped my Caps Lock to Ctrl and it works properly.
  • Executing sudo setxkbmap temporarily sets everything in order. Once VMware gains focus and I type something, problem comes back.
  • Problem persists even after I quit VMware.

This is the first time I'm using Unity (I have been using Gnome for a long time) and I'm suspecting the problem is related to that. Any ideas why this might be happening?

  • I'm seeing almost the exact same symptoms. ubuntu 14.04, Vmware workstation 10.0.3. Except my shift keys still work, both ctrl keys stop working. Caps-lock remapped to ctrl still works (as ctrl). Hardware id Dell xps 15 l521x – Andrew M Sep 15 '14 at 21:20
3

TLDR:

In Gnome Tweak Tool, set "Ctrl key position" to "Caps Lock as Ctrl" and "Caps Lock key behavior" to "Caps Lock is disabled".

Full story:

The problem appears to be how Ubuntu is remapping the CapsLock key. When Gnome Tweak Tool's "Caps Lock key behavior" property is set to "Make Caps an additional Ctrl", xmodmap reports:

xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Caps_Lock (0x42),  Control_R (0x69)
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

The problem appears to be that both lock and control list "Caps_Lock (0x42)". Everything works well until you set focus into a VMWare VM (I tested using VMWare Player). After focusing VMWare's window, xmodmap will report an empty mapping:

xmodmap:  up to 0 keys per modifier, (keycodes in parentheses):

shift     
lock      
control   
mod1      
mod2      
mod3      
mod4      
mod5      

Running setxkbmap resets the keyboard mapping and temporarily resolves the issue. Playing with xmodmap, I found that removing Caps_Lock (0x42) from lock stopped VMWare from flushing the keyboard mappings. But, Ubuntu 14.04 ignores .Xmodmap files, so there was no simple method to use xmodmap.

We can fix the root-cause of this situation by changing two settings in Gnome Tweak Tool, as described at the top of this post. Doing so will properly configure the keyboard mappings so that Caps_Lock (0x42) does not show up in two locations:

xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25),  Control_L (0x42),  Control_R (0x69)
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)
  • That works. Thanks, especially for the great extensive explanation. – Can Bal Nov 7 '14 at 6:57
  • Glad I could help. This plagued me for months. You can find lots of other folks suffering from this by searching for "VMWare keyboard fubar". I've found people having this problem (though perhaps with a different root cause) all the way back to 2008. I'm surprised that, so far as I can tell, this post represents the only documented solution to the CapsLock specific variant of the "VMWare keyboard fubar" bug. – Nathan Nov 7 '14 at 21:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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