Nx Client from Mac to Ubuntu – Alt Key

If you’re here, you probably already know the problem. If you use intellij like I do, I hope this helps with your imports.
Given Mac OSX connecting to Ubuntu over NoMachine’s nx client

1. Create and/or or place this in your ~/.Xmodmap on your mac

keycode 66 = Alt_L
clear Mod1
add Mod1 = Alt_L Alt_R

2. Start/Restart X11 on mac from Utilities>X11.app
3. Do *Not* start NxClient via Mac GUI. (If you are starting NxClient by clicking on the red NxClient icon with the mouse, this isn’t going to work.)
Instead, create an X11 terminal window. (Make sure the top left icon says X11, to know you are usings the correct terminal app.)
and start NxClient from that terminal’s command line:

/Applications/NX Client for OSX.app/Contents/MacOS/nxclient

4. If you are in Intellij, your Alt-Enter key combo will be this on a macbook pro:
alt/option + the small ‘enter’ key next to the right Apple key.
It will Not work with the usual alt/option + the big enter/return key.



This entry was posted in Tips and tagged , , , , , , , . Bookmark the permalink.

6 Responses to Nx Client from Mac to Ubuntu – Alt Key

  1. Luisa says:

    What is the small enter key you are refering to? I have MacBookPro, at the bottom of the keyboard to the right of the space bar, I have apple key, alt-option key, and the arrow buttons.

  2. Scott says:

    I don’t know what the “small” enter key piece is referring to, but this technique worked well for me to get IntelliJ imports working with IDEA running on Linux connected to the X server on my Mac (OS X 10.6.4).

    On my Macbook Pro, all I need to do is simply press Option-Enter, so long as I use the Option key to the left of the space bar. Nothing more. The Xmodmap makes it look like it may be trying to reconfigure the right Option key too, although that doesn’t work for me for whatever reason. But the imports are now working so I’m happy!

    Note that this technique is not particular to NX or anything else. If you connect to your Linux machine via SSH and tunnel X over that, it works. It also works if IDEA is configured to talk directly to the Mac’s X server over TCP without SSH.

  3. Rich says:

    Thanks for the tip! Works like a charm — what a relief. I created a shortcut in X11: Applications -> Customize:
    name: nx
    command: “/Applications/NX Client for OSX.app/Contents/MacOS/nxclient”
    shortcut: x

    …so I just have to launch X11 and hit command-X.

    Thanks again.

  4. Bryan says:

    I’ve implemented the above solution but Alt + Enter still doesn’t work for me. I’m using a macbook air (10.5) with nx client (invoked from the xterm terminal) to connect to a remote ubuntu 10.10 VM. Could the problem be my macbook air keyboard? Is the another way to test that alt + enter setting is correct besides it working in IntelliJ ? Thanks!

  5. Sanjeev Chopra says:

    Thanks! I can do Alt+Up in eclipse and Alt+Tab to switch windows when using NX Machine.

  6. Abhishek says:

    I created xmodmap file only as per your instructions on os x 10.8 and I am using open nx client. I am launching it by GUI only and its working fine. Thanks a lot 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *