NX / NoMachine¶
NX (aka NoMachine) is a computer program that handles remote X Window System connections which offers several benefits over traditional X forwarding.
NX can greatly improve the performance of X Windows, allowing users with slow, high latency connections (e.g. on cell phone network, traveling in Africa) to use complex X Windows programs (such as rotating a plot in Matlab).
NX provides functionality that allow a user to disconnect from the session and reconnect to it at a later time while keeping the state of all running applications inside the session.
Download latest NX Client¶
Configuring and Connecting¶
The NX Client requires a one-time configuration to set it up to connect to the NERSC NX service. After that you can connect to the NX service via the NX Client or by pointing your browser at nxcloud01.
The browser interface is still experimental and can sometimes be slower than connecting via the client.
Connecting with MFA via sshproxy¶
If you don't wish to re-authenticate with your password and a new one-time password every time the NX Client is disconnected (e.g. if you close your laptop), you can connect with an ssh key generated by sshproxy. You will need to regenerate the ssh key with sshproxy once a day, but otherwise the NX Client will automatically reconnect.
- Install sshproxy on your laptop and generate an SSH key (instructions are here). Note that you must do this once every day to generate a new key.
- Open the NX client and click the "New" box in the upper right corner of the menu.
- Choose "SSH" for protocol and click Continue.
- Type in "nxcloud01.nersc.gov" for Host (leave the port set to 22) and click Continue.
- Choose "Private Key: use key-based authentication with a key you provide" and click Continue. DO NOT check import private key or forward authentication.
- Fill in the path to the ssh key you generated in step 1 (usually ~/.ssh/nersc) and click Continue. Note that you may need to specify the full path to your ssh key rather than using the tilde (~).
- Select "Don't use a proxy" and click Continue.
- Choose the name you'd like to call this connection and click done. To make reconnecting easier you may elect to create a desktop icon ("Name of your connection.nxs") which will automatically load your NERSC connection settings. If you do not create a desktop icon, you can just click the NoMachine icon and then select the name of your connection.
To configure without using sshproxy, choose "Password" for step 5 (which skips step 6), otherwise all other steps are the same. Please note that choosing this option will mean you will need to reauthenticate every time the NX Client is disconnected. You will need to enter your NERSC password plus the one time numerical password for MFA into the "Password" field with no spaces between them.
Connecting to NX¶
If you are having trouble connecting to NX, please try these steps:
- Log into NIM to clear any login failures. Access to NX uses your NERSC user name and password. If your password is mistyped five times, NERSC will lock you out of their systems. Logging into NIM will automatically clear these failures. This will also let you know if your password is expired (which would prevent you from accessing NX, among many other things).
- Re-download the NX configuration file. NX will often "update" the configuration file to try to save your settings and sometimes this file can get some bad settings. You must have the new NX player AND the new configuration file to connect to the NX service.
- Try to ssh directly to the NX server. You can do this with the command
ssh <nersc_username>@nxcloud01.nersc.govand your NERSC user name and password+one-time MFA password (with no spaces in between). If your access to the NX server is blocked by a local firewall or something else and you can't connect via ssh, you will also not be able to connect with the NX client.
If you've tried these steps and still cannot connect, please open a help ticket. In this ticket, please include the following information:
- The type of system you're trying to connect from (i.e. Mac, Windows, Linux, etc.).
- A screen capture of the error you get (if possible).
- A tarball of the NX logs. You can find instructions for how to bundle your NX logs on the NoMachine website.
Configuring the NX Environment¶
Font size is too big or too small¶
To change the font size inside your terminal: In the menu of Konsole Application, choose "Settings"->"Manage Profiles", then click "Edit Profile...", now you can change the font size in the "Appearance" tab, after changing, click "OK" until you are back to the terminal. Now every new terminal window you open will have the new font size.
To change the font size of your menu bars/window titles: Right click on an empty desktop then choose "Konsole", inside the Konsole, type "kcmshell4 fonts". Then you have a dialog box to change your font size.
Resizing the NX screen¶
With the latest NX Player (5.0.63 or later), the most efficient way is to enable "Remote Resize" in the NX menu:
- Connect to NX
- From the desktop, bring up the NX player menu with a hotkey: Mac: Ctrl+Option+0, Windows: Ctrl+Alt+0, Linux: Ctrl+Alt+0
- Choose the "Display" submenu, then toggle the "Remote Resize" button. You can also choose "Change Settings" to manually change the resolution.
Emacs complains about missing fonts and shows white blocks¶
This is due to a problem with font server. Please use the following command instead:
emacs -font 7x14