Keyboard problems using openNX on Mac OS X to connect to a NoMachine NX server running Ubuntu

Long story short:

  1. Go to XQuartz settings > input > enable the second and third checkbox (key mapping with X11)
  2. Export your current keyboard mapping of the client. Open a terminal and enter xmodmap -pke > nxclient.xmodmap
  3. Copy this new file to your NX server, e.g. scp nxclient.xmodmap user@server:
  4. Start a NX session and load the config with xmodmap nxclient.xmodmap

And here is the long version: Recently I received my new MacBook Air running OS X 10.9 (Mavericks). Since NoMachine NX Client version 3.x does not seem to work on Mavericks, I came across openNX. openNX requires an X Server running on the MacBook, so I installed XQuartz. With these tools I was able to connect to my computer at university, which is running Ubuntu and the NoMachine NX server. My MacBook has a US International keyboard and the mapping of the keys was completely messed up. For example pressing „a“ resulted in „l“ and so on. Googling the internets I found out that many people have this problem. But none of the posted solutions worked for me, so I tried my best. I read articles about the basics of keyboard mappings. So my first idea was to compare the keyboard mappings of my MacBook with the NX session: I opened a terminal and typed xmodmap -pke on my mac and in the session. The two outputs were complete different. Then I exported my macbook settings to a file, copied the file to the NX server, started a NX session and loaded the macbook keyboard mapping and it worked 😀