Tutorial: Join The FreeNX Wave

Nomachine NXNX is an exciting new technology for remote display. It provides near local speed application responsiveness over high latency, low bandwidth links. The core libraries for NX are provided by NoMachineunder the GPL. FreeNX is a GPL implementation of the NX Server and NX Client Components. If you want to read more facts about this incredible program, check out: Wikipedia.

In this tutorial I will tell the points I had to go through to be able to get it working. Last year (2008) I tried to setup the FreeNX, but it wouldn’t let me start a session and after a lot of IRC discussions and surfing the intahwebz I didn’t find a solution to my problem. At the time I was running OpenBOX as a window manager, and all I got was a black screen after authentication, now however I’m running Gnome (I love them both <3) and I got it working. Im not saying it wont work on *BOX, just that I’ve only tested it in gnome so far. This is how I solved the issue, using normal password login and default NX keys.

Installation
If you plan using freenx to connect to a headless PC, keep in mind that you’ll also need an X server configured, so you should install any relevant xorg package.

# ArchLinux 
pacman -S freenx 
# Ubuntu (...do a google search) 
# Gentoo 
emerge -av nxserver-freenx

I’m going to assume you have a working SSH server running, if you don’t do a google search. Be sure that the SSH server has the following options set:

#/etc/ssh/sshd_config
ListenAddress 0.0.0.0
PubkeyAuthentication yes
UsePAM yes

You should also check your /etc/hosts.allow and /etc/hosts.deny, the latter being empty, and the first one allowing sshd. In Archlinux the NX server is installed to /opt/NX/. You now need to do the following to generate keys and other stuff i wont go into (most likely you need to run as root).

/opt/NX/bin/nxsetup --install --setup-nomachine-key

That’s basically it! If you run into any problems, give me a shout in the comments and Ill try to help out as best as I can.

Client
In Archlinux you can get the client from pacman:

pacman -S nxclient

And for Windows you can get the client from nomachine’s homepage: http://www.nomachine.com

Tip from ArchWiki:

Nomachine tends to remove old clients from their homepage, If your setup works with a client save it at a safe place


Image source:OpenSuse Wiki

Notes

  • If you are running your ssh server on a different port than 22, you need to define the port in <PathToNX>/etc/node.conf (my path: /opt/NX/etc/node.conf)
  • If your running SLiM as login manager, or you are running something else besides Gnome or KDE, you need to uncomment this line:
    #USER_X_STARTUP_SCRIPT=.xinitrc

    This will enable the NX server to run the user defined run script, remember you need to set the DE/WM you are running in that file, here’s my file for an example:

    #$HOME/.xinitrc
    exec gnome-session
    #exec openbox-session

    Then in the client under configuration settings, choose Custom as the desktop, and click on settings:

    • In the first group select – Run the default X client Script on server
    • In the second group select – New virtual desktop
  • If you are having issues, try to change the following:
    #SESSION_LOG_CLEAN=1
    # to
    SESSION_LOG_CLEAN=0

    Then you can look/debug the log files for successful connections: $HOME/.nx/T-C-<hostname>-<display>-<session-id> and $HOME/.nx/F-C-<hostname>-<display>-<session-id> for failed ones.

Sources
Archlinux forum: FreeNX authentication
ArchWiki: FreeNX

About Torstein Skulbru

23 year old, Bachelor ICT(Information and Communication Technology) student at University of Bergen (NO)