Why the keyboard layout falls back to en_US after upgrade from RHEL 6.3 to 6.4
It has been reported that after uprading RHEL 6.3 to 6.4 the keyboard layout may fall back to en_US in a NX session. NX sessions on CentOS 6.4 are affected as well. When using an SSH client such as putty or plain ssh to connect to the server, the keyboard layout is correct.
This is due to a bug in xorg reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=914760
http://bugs.centos.org/view.php?id=6298&nbn=8
The following workarounds are available:
1) Create this file:
touch /usr/share/X11/xkb/keymap.dir
2) Create a custom script on NX node events that sets the keyboard layout after session start, e.g.
#!/bin/sh
DISPLAY=:$4.0
setxkbmap -layout ch -display $DISPLAY
The display is provided in the variable $4 in the custom script.
The config key to use here is UserScriptAfterSessionStart in the /usr/NX/etc/node.cfg file(s). Uncomment the key and set the script path as key value, e.g.
UserScriptAfterSessionStart = "/tmp/setkeyboardlayout.sh"
Examples for using custom scripts are available here:
For NoMachine 4:
https://www.nomachine.com/AR02L00787
For NX 3.5.0
https://www.nomachine.com/AR01E00441
