Ubuntu VMware Console: Arrow keys not working, bad key mapping, strange behaviour | Zenware Blog!

Ubuntu VMware Console: Arrow keys not working, bad key mapping, strange behaviour

This applies for Vmware Console Server 2.0 2.x, all Linux distros, Ubuntu, Ubuntu Server & Desktop, and others.

So… are you trying to press an arrow key in order to move between characters, and the Start menu opens up? Or are you trying to delete a char with the delete key and another strange character emerges? Is it scrolling with Page Up (PgUp) or Page Down (PgDown) keys what is driven you insane?

Then you have a keyboard mapping error, and here it’s the solution:

The Zen Solution


zenware@zenware-mobile:~$ echo “xkeymap.nokeycodeMap = true” >> /etc/vmware/config

For current user:

zenware@zenware-mobile:~$ echo “xkeymap.nokeycodeMap = true” >> ~/.vmware/config

(Yes, create the file if it doesn’t exist)

If that doesn’t work, try:

Adding KeyCodes

Use your favorite text editor (mcedit, vi, vim, gedit) and open ~/.vmware/config

And add the following lines:

xkeymap.keycode.108 = 0×138 # Alt_R
xkeymap.keycode.106 = 0×135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0×148 # Up
xkeymap.keycode.116 = 0×150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0×152 # Insert
xkeymap.keycode.119 = 0×153 # Delete
xkeymap.keycode.110 = 0×147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0×149 # Prior
xkeymap.keycode.117 = 0×151 # Next
xkeymap.keycode.78 = 0×46 # Scroll_Lock
xkeymap.keycode.127 = 0×100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
xkeymap.keycode.135 = 0x15d # Menu

Getting Keycodes

So how do you get the correct Key Code? What happens if you are using another type of keyboard, or input device? Then you have two choices in Linux: xev and xmodmap.

zenware@zenware-mobile:~$ xmodmap
xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0×32),  Shift_R (0x3e)
lock        Caps_Lock (0×42)
control     Control_L (0×25),  Control_R (0×69)
mod1        Alt_L (0×40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod4        Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

To print the current keymap table, use: xmodmap -pk

The xev command, instead, will display a graphical window, and scan for all input events. That includes mouse, and any other input device, so keep the cursor outside the window and don’t move it. Pressing Right Alt, for example, brings us the following:

KeyRelease event, serial 33, synthetic NO, window 0×5400001,
root 0xb4, subw 0×0, time 18913986, (1263,378), root:(1273,475),
state 0×90, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
XKeysymToKeycode returns keycode: 92
XLookupString gives 0 bytes:
XFilterEvent returns: False

So the keycode will give you a hint.

More resources




bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark


  1. Wayprorodeelo Says:

    Awesome, I didn’t know about that until now. Thx!

  2. evisheree Says:

    polite answers i like it

  3. Yahoo_uj Says:

    Really good work about this website was done. Keep trying more – thanks!


RSS feed for comments on this post. TrackBack URL

Leave a comment