Build a FreeNX server from source on the IGEPv2 board

From IGEP - ISEE Wiki

Jump to: navigation, search

This guide covers the installation of freeNX and the supporting NX environment from the source code. NX is a remote desktop application for linux machines. It is extremely bandwidth optimized and has clients for every platform.Look here for details.

Originally created by Nomachine, it has an open source clone called FreeNX.

This app is very useful if you plan to access your IGEP board from remote and don't want to get only a simple shell prompt.These instructions have been proven to work on a standard Ubuntu 10.10 system. Instructions MAY work in other Ubuntu versions or Debian. They will probably not work for other non-Debian distros. If you use Gentoo, the whole NX system is available as a package in emerge.

First thing: NX works at its best with gnome installed at server side. Don’t use XFCE, it won’t work with this guide.


  1. A working IGEPv2 board with Ubuntu maverick or lucid installed. Everything will be done from the IGEP board itself, not on a supporting computer.
  2. Network connection
  3. A working SSH server (I assume you are trying to build a headless computer, buti f you got mouse/keyboard/monitor and work locally, these instructions are still valid)
  4. A basic knowledge of the linux shell
  5. Good will, coffee, patience, and all the other stuff normally needed when you go for source code compiling.

IMPORTANT: if you find errors and the software does not compile, don't start immediately to ask for help, every system installation is different. There is surely a library header, a development utility or something else you did not install or that was not present on your system: read carefully the last lines of the error log, figure out, google a bit and don't worry, it’s not at all difficult.

Let's start:

1. If you don’t have a desktop manager installed, install gnome-desktop (don’t install the full ubuntu-desktop unless you really need it, it will install production packages like and Gimp)

sudo apt-get install gnome-desktop

2. Install the build environment and some supporting libraries and tools (NOTE: if you need a complete build environment, look at other infos here)

sudo apt-get install build-essential libjpeg62-dev libpng12-dev xutils-dev cups expect netcat

Before you start asking: Yes, you need cups even if you’ll never use a printer. NX won’t build without it installed

3. Create a work directory in your home and enter it

mkdir freenx
cd freenx

4. Download all the source packages (packages are taken here  and here )


5. Unpack everything

tar zxvf *.tar.gz

There will not be a single directory for each one of the unpacked archives as some of these will unpack under the nx-X11 folder. If you have trouble unpacking everything at once, do it file by file.

6. Now enter the nx folders and build everything (leave only the nx-X11 apart)

cd <every single folder>

7. Then enter the X folder and make the whole server

cd nx-X11
make World

NOTE: This operation will take a LONG time. Explanation: this step actually builds the complete Xfree86 with custom modifications from NX.

8. Copy some the compiled libraries in the NX folder (all the following commands have to be done as superuser with sudo)
mkdir /usr/NX

cp -a nx-X11/lib/X11/* ${NXPREFIX}/lib
cp -a nx-X11/lib/X11/* ${NXPREFIX}/lib
cp -a nx-X11/lib/Xext/* ${NXPREFIX}/lib
cp -a nx-X11/lib/Xrender/* ${NXPREFIX}/lib
cp -a nxcomp/* ${NXPREFIX}/lib
cp -a nxcompext/* ${NXPREFIX}/lib
cp -a nx-X11/programs/Xserver/nxagent ${NXPREFIX}/bin
cp -a nxproxy/nxproxy ${NXPREFIX}/bin
cp /usr/NX/lib/libXcomp* /usr/lib
cp /usr/NX/bin/nxagent /usr/bin/

9. There is an error in the freenx installer, you need to manually create a link to a library

sudo ln -s /usr/NX/lib/ /usr/NX/lib/

10. Now enter the freenx folder and build the server

cd freenx-server-0.7.3
patch -p0 < gentoo-nomachine.diff
sudo make install

11. Now configure your NX server (follow the insttructions and ignore warnings about the nxagent without version string, it is a known and uncorrected bug)

and you are done
export PATH=$PATH:/usr/NX/bin
sudo nxsetup --install

Now you should have a working NX server. If not, check the error logs in the NX client and ad try to get a clue. The installation has been tried with XFCE and it did NOT work at all, so don't even try to understand why (unless you have a lot of spare time to do it): use Gnome.

Just connect to your IGEPv2 box using one of the the NX clients found on