How to Setup freeNX on Centos 5

Scenario / Question:

How do I setup freeNX on a remote server system and connect to it.

Solution / Answer:

Installing the freeNX server software on the remote server machine and using the NoMachine freenx client to connect to it from you local machine.

Installing freeNX Server:

On the server you want to control with freeNX

Install freenx using yum:

# yum install nx freenx

Copy minimal configuration file:

# cp /etc/nxserver/node.conf.sample /etc/nxserver/node.conf

Enable PASSDB for NX Database User Authentication pass-through:

Uncomment and change the following line in /etc/nxserver/node.conf


Add a user account to the nxserver database ( the user account must already exist on the system as a standard linux user account):

# nxserver --adduser <username>

Give the user a password:

# nxserver --passwd <username>

Installing freeNX NoMachine Client:

The NoMachine client needs to be downloaded from their site. Download the client that matches the operating system on your local machine.

After installing the NoMachine client open the NX Connection Wizard.

Enter a Session Name, Hostname or IP of the remote server system, SSH Port number of the remote server system (usually 22), and select your connection type. Click Next



Select the connection type, desktop system and the size of the desktop. Click Next



Click Finish



freeNX SSH Keys configuration:

In order for freeNX to function securely we need to copy the ssh key from the remote server system to the local machines NoMachine client software.

On the remote server system copy the client.id_dsa.key contents (including the —BEGIN— and —- END— lines):

# cat /var/lib/nxserver/home/.ssh/client.id_dsa.key

On the local client system open the NX client software and click on “Configure”:



Under the General tab, click “Key”



Delete the contents and paste in the contents from the remote server system /var/lib/nxserver/home/.ssh/client.id_dsa.key



Now connect using the username and password you created when you configured freeNX on the remote server system.

Common Errors:

The nx service is not available or the nx access was disabled

The issue with the above error is that you copied the wrong ssh key and most likely followed the process from an old tutorial that told you to copy the key from /etc/nxserver or told you to create your own key. The key you should copy is found at /var/lib/nxserver/home/.ssh/client.id_dsa.key

Keyboard Layout Error

When connecting to FreeNX server your keyboard layout is giving errors. Typically the up arrow key is causing the print screen dialog to show. To correct problem you need to adjust Xorg on the client system.


Create xorg.conf:

# Xorg -configure :1
# cp /root/ /etc/X11/xorg.conf

Add the following to xorg.conf:

Section "ServerFlags"
        Option          "AllowEmptyInput" "off"
        Option          "AutoAddDevices" "false"
        Option          "DontZap" "false"

Restart Xorg:

Fabio Milano has written 80 articles for us. Fabio Milano is a certified RHCE, MCP, and CFOI. He runs an IT consulting and services company called RDS Support inc. Website:
The information provided is for educational purposes only. All content including links and comments is provided "as is" with no warranty, expressed or implied. Use is at your own risk and you are solely responsible for what you do with it.

8 Comments so far

  1. Randy on July 23rd, 2010

    I was having a lot of trouble getting NX working on CentOS. I’m a Debian user normally, but just set up a new CentOS server. I followed the CentOS FreeNX setup from the CentOS wiki and kept getting an authentication error on the NX user. Turns out it was the DSA client key. This tutorial helped me find the issue very quickly.


  2. Jack on August 8th, 2010

    I noticed your troubleshooting section has the same error I am receiving, but it doesn’t solve my problem. I don’t seem to have that path installed and when I run a yum install freenx, I it doesn’t create that path.

  3. belsemtech on August 28th, 2010

    hello Fabio Milano thinks very mush about the tutorial

    is very good

    we stay need more for your acticles


  4. kensai on January 11th, 2011

    NX> 202 Authenticating user: nx
    NX> 208 Using auth method: publickey
    NX> 204 Authentication failed.

    Any idea why my authentication of user nx fails?

    I’m using the key from /var/lib/nxserver/home/.ssh/client.id_dsa.key…

  5. links for 2011-02-03 on February 3rd, 2011

    [...] How to install and configure freeNX | CentOS | Linux Tutorial (tags: freenx centos linux howto sysadmin) [...]

  6. vithal on April 25th, 2011


    Worked like a charm for me!

  7. Brian on May 21st, 2011

    Fantastic documentation!

  8. kesava on December 30th, 2012

    good documentation

Leave a reply