NX/FreeNX HOWTO


Warning: this isn't up to date and may not be correct.

Last updated Wednesday, April 27 2005
Kyle Davis

This HOWTO is provided with the intention of helping people get FreeNX installed and configured properly. I recommend that if you need this in a commercial environment you should buy the real server from NoMachine. I am not responsible for any damages caused by following these directions.

Please do not send general FreeNX/NX questions to me. I am in no way associated with NoMachine. I will only answer questions and comments about the HOWTO itself.

Table of Contents



Introduction

NX is a very efficient method of remote access created by NoMachine. From what I understand it is a method of buffering and compressing X11 traffic. There is also a way to use VNC to connect to an NX server for even more compatibility. NoMachine has free clients for most operating systems making it ideal for thin client or low bandwidth remote desktop setups.


Requirements

You will need root access to a working installation of your favorite flavor of Linux, and the bash shell.


Download

You will need to download these into the same place:

FreeNX - FreeNX is an open source replacement for NoMachine's commercial NX server.
My FreeNX patch - A patch that I wrote to fix some annoying path and library issues with the original FreeNX server.
NX Client and Server (Alternate) - These are the development versions but that's what I used so we'll use it here too.

Install

The first thing you will want to do is login as root. If you are currently logged in as a normal user you can type su to gain root privelages.

Uncompress the server and the client binaries. Keep in mind the filenames that I had when writing this may differ from the ones you just downloaded.

# Uncompress NoMachines binaries
tar -xzvf nxclient-1.4.0-75.i386.tar.gz
tar -xzvf nxserver-1.4.0-99.i386.tar.gz
mv NX/ /usr/

# Install the NX environment scripts
cp /usr/NX/share/profile.d/nx.* /etc/profile.d/
chmod 755 /etc/profile.d/nx.*

# Add a user for our NX/FreeNX server
useradd -u 500 -p "*" -s /usr/NX/bin/nxserver nx
mkdir -p /home/nx/.ssh/
chmod 700 /home/nx/ /home/nx/.ssh/

# Install the FreeNX scripts
tar -xzvf freenx_0.3.1.tar.gz
cd freenx-0.3.1/
patch -p0 < ../freenx.patch
chown root *
chgrp root *
cp nxkeygen nxnode nxnode-login nxserver nxsetup /usr/NX/bin/
./nxsetup
cp /home/nx/.ssh/client.id_dsa.key /usr/NX/share/client.id_dsa.key

Now we'll need to copy the secure key that was generated onto the client machines so that your NX client can use it. The key on the server is located in "/home/nx/.ssh/client.id_dsa.key". If you are using the Linux on your client machines you will need to copy it to "/usr/NX/share/client.id_dsa.key" and chmod 644 it. If you are using the Windows on your client machines you will need to copy it to "C:\Program Files\NX client for Windows\share\". on your client machine.

Next we add the NX capable user and setup a password for them.
NOTE: You can set the NX server up to allow any normal users to login in the config file in /etc/nxserver/ and skip this step, but I'm not going to recommend that.

/usr/NX/bin/nxserver --adduser username
/usr/NX/bin/nxserver --passwd username

At this point we should have everything on our NX/FreeNX server setup and ready to test. It is now time to try connecting to your new shiny NX/FreeNX server. Good luck!!


Uninstall

Just in case you have issues getting it the first time I thought it might be a good idea to include uninstall instructions so that you could start over from the beginning if you needed to.

userdel -r nx
rm -r /etc/nxserver/ /usr/NX/ /var/lib/nxserver/

Conclusion

So, now you too can show off how cool X can be! I hope that this helped you and that you had fun getting everything working. Cheers!