# NoMachine / NX¶

NoMachine (formerly NX) is a computer program that handles remote X Window System connections which offers several benefits over traditional X forwarding.

NoMachine 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).

NoMachine 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.

The previous KDE desktop has been retired since it is no longer supported in CentOS7. Our current default desktop is GNOME. Most of the instructions on this page will help you use our GNOME desktop. If you would prefer to use our lighter-weight Xfce desktop, you will find directions further down this page.

## Installing the NoMachine Client¶

Please make sure you have a recently updated version of the NoMachine client.

To sshproxy or not to sshproxy?

Depending on whether you are using the NERSC sshproxy service, we have two different sets of connection instructions below.

## Creating a connection to NERSC WITH sshproxy¶

sshproxy now working for Windows NoMachine users

As of Feb 2020, Windows users can now use sshproxy to log onto NoMachine. See below for more detailed instructions.

If you don't want to reauthenticate with your password and a new one-time password every time the NoMachine 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 NoMachine Client will automatically reconnect.

Check out this video which shows you how to install NoMachine from scratch and configure using sshproxy. (Even if you don't want to use sshproxy, you might still find it helpful.)

1. 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. Windows users: Use this command to generate your key:
sshproxy.exe -u <yourusername> --format openssh -o nersc

2. Open the NoMachine client and click the New box in the upper right corner of the menu.
3. Choose SSH for protocol and click Continue.
4. Type in nxcloud01.nersc.gov for Host (leave the port set to 22) and click Continue.
5. Choose Private Key: use key-based authentication with a key you provide and click Continue.
6. Fill in the path to the ssh key you generated in step 1 (for Mac OSX, usually ~/.ssh/nersc and for Windows, usually in the place you installed sshproxy.exe) and click Continue. Note that you may need to specify the full path to your key. Windows users: Make sure you select nersc (rather than nersc.pub) as your private key.
7. Select Don't use a proxy and click Continue.
8. 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.
9. To enable sshproxy in NoMachine, you will need to edit one of the NoMachine config files on your local machine. You must edit this file while NoMachine is closed/not running. First exit the NoMachine program and then edit \$HOME/.nx/config/player.cfg and change the following key from library to native:
<option key="SSH client mode" value="native" />

Mac OSX users can edit this file via vi/emacs. Windows users should make sure they can view hidden files and navigate to C:\Users\<yourusername>\.nx\config\player.cfg. They can edit this file using Notepad++ or other programs that allow you to edit hidden files which cannot be edited by default in Windows.
10. To log on to NERSC NoMachine, click on the connection you just created. You should not need to enter your username or password. At this point you should now be logged onto the NoMachine desktop.

## Creating a connection to NERSC WITHOUT sshproxy¶

If you would prefer not to use the sshproxy service, you can still connect to NoMachine. You will need to enter your password + OTP (no spaces in between) every time you log on to NoMachine.

1. Open the NoMachine client and click the New box in the upper right corner of the menu.
2. Choose SSH for protocol and click Continue.
3. Type in nxcloud01.nersc.gov for Host (leave the port set to 22) and click Continue.
4. Choose Password for password+OTP authentication.
5. Select Don't use a proxy and click Continue.
6. 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.
7. To log on to NERSC NoMachine, click on the connection you just created. You will need to enter your username and password+OTP. At this point you should now be logged onto the NoMachine desktop.

## Using Xfce instead of GNOME¶

Would you like a lighter-weight desktop?

The current default desktop environment in NoMachine is GNOME. However, some users have found that this desktop can sometimes be laggy or graphics may be displayed with poor resolution. If you have experienced these issues (or simply would prefer a lighter-weight environment) we recommend trying our Xfce desktop.

To use our Xfce desktop instead of our default GNOME desktop:

1. Make sure you have completely logged out of any open NoMachine sessions. To do so click log out in the bottom left corner of the GNOME desktop menu.
2. Return to the NoMachine connection page. Create a new connection file following either the WITH or WITHOUT sshproxy directions above. To help your future self, consider calling it Xfce connection or something similar.
3. Click connect.
4. Once you've connected, choose Create a new custom session
5. On the next screen, click Run the following command and fill in /bin/startxfce4 and click Run the command in a virtual desktop
6. This should give you a session with the Xfce desktop
7. Then you can connect to Cori clicking on the small terminal icon on the bottom of the screen and typing ssh -X cori.nersc.gov.
8. To log out of Xfce, click on the box with your name at the top right corner. Select log out. Then click log out again. It may take several seconds to fully close your session. There is also a log out option under the upper left menu Applications/Others but this log out button does not currently work.

## Troubleshooting¶

### Connecting to NoMachine¶

If you are having trouble connecting to NoMachine, please try these steps:

2. Create a new connection file following the instructions above. 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 NoMachine player AND an updated configuration file to connect to the NoMachine service.

3. Try to ssh directly to the NoMachine server. You can do this with the command

ssh <nersc_username>@nxcloud01.nersc.gov

and your NERSC user name and password+one-time MFA password (with no spaces in between). If your access to the NoMachine 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 NoMachine client. If this is the case, please contact your local IT department.

4. If you're using sshproxy, test the sshproxy key by using it to ssh to the NoMachine server. You can do this with the command

ssh -i ~/.ssh/nersc <nersc_username>@nxcloud01.nersc.gov

If this fails and Step 3 works, there may be a problem with your sshproxy key, please open a ticket with NERSC to diagnose the issue.

If you've tried these steps and still cannot connect, please open a help ticket. In this ticket, please include the following information:

1. The type of system you're trying to connect from (i.e. Mac, Windows, Linux, etc.).
2. A screen capture of the error you get (if possible).
3. A tarball of the NoMachine logs. You can find instructions for how to bundle your NoMachine logs on the NoMachine website.

## Connecting via the Browser Interface¶

Note

The browser interface is still experimental and can sometimes be slower than connecting via the client.

### Configuring the NoMachine 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 NoMachine screen¶

With the latest NoMachine Player (5.0.63 or later), the most efficient way is to enable "Remote Resize" in the NoMachine menu:

1. Connect to NoMachine
2. From the desktop, bring up the NoMachine player menu with a hotkey: Mac: Ctrl+Option+0, Windows: Ctrl+Alt+0, Linux: Ctrl+Alt+0
3. Choose the "Display" submenu, then toggle the "Remote Resize" button. You can also choose "Change Settings" to manually change the resolution.

If you dislike the default NoMachine terminal color scheme (white background, dark text), you can open a terminal from the Show Applications menu at the bottom of the menu bar on the left hand side of the screen (it looks like 9 dots). Once you have opened your terminal, click EditPreferences in the terminal menu. If you click the Colors menu at the top of the window, you can uncheck the Use colors from system theme box. You can then choose the color of the background and text you prefer.
If you like to make adjustments from the command line, open a terminal/konsole from the Show Applications menu and enter:
dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/use-theme-colors false

To change your keyboard language from the default (US English), click the Show Applications menu at the bottom of the menu bar on the left hand side of the screen (it looks like 9 dots). Then click the Settings icon → Region and Language. Under Input Sources, click the plus arrow on the bottom left hand side. This should open a list of additional options (for example: Spanish (Spain)). Under this menu will be another, more detailed submenu with options such as Spanish (Macintosh). Choose your option and click the Add button on the upper right hand side. Then under input sources, make sure your new option is highlighted. You can click the keyboard icon on the bottom right to see how the keys in your new configuration are arranged.