Install NX Server on Raspberry Pi

From TIAO's Wiki
Revision as of 20:27, 13 September 2012 by Admin (talk | contribs) (Prepare the build environment)
Jump to: navigation, search

10 PCS, 10cm x 10cm, 2 layers prototype for $38.80 shipped!








Buy Game Console Adapters from http://www.easymg.com or http://www.diygadget.com

What is Raspberry Pi

Why you need NX server

How to install NX server on Raspberry Pi

Prepare the build and runtime environment

You need the following packages to build NX server. Use apt-get to install them on your pi:

  • xutils-dev
  • expect
  • xorg-dev
  • libjpeg8-dev
  • libpng12-dev

Before you use apt-get, try to run update command first, otherwise you may encounter some 404 not found errors.

sudo apt-get update

Command:

sudo apt-get install xutils-dev expect xorg-dev libjpeg8-dev libpng12-dev

NX server also requires CUPS, thus you need to install it as well:

sudo apt-get install cups

Compiling NX components

NoMachine has released the component source here. There is also a official guide to compiling the components and it is a good source of information. The components you need to build the NX servers are (as of Sept 13/2012, you may see a different version, but component name won't change):

  • nxproxy-3.5.0-1
  • nxcomp-3.5.0-2
  • nxcompext-3.5.0-1
  • nxcompshad-3.5.0-2
  • nx-X11-3.5.0-2
  • nxauth-3.5.0-1
  • nxagent-3.5.0-9
  • nxscripts-3.5.0-1


You can SSH to your Pi and use "wget" to download the files.

Now you should have total 8 files:

pi@raspberrypi /work/nx $ ls -l
total 22180
-rw-r--r-- 1 pi pi  1510400 Jul 12 16:40 nxagent-3.5.0-9.tar.gz
-rw-r--r-- 1 pi pi    30671 Jul 12 16:39 nxauth-3.5.0-1.tar.gz
-rw-r--r-- 1 pi pi   532999 Jul 12 16:40 nxcomp-3.5.0-2.tar.gz
-rw-r--r-- 1 pi pi    91725 Jul 12 16:40 nxcompext-3.5.0-1.tar.gz
-rw-r--r-- 1 pi pi    77293 Jul 12 16:39 nxcompshad-3.5.0-2.tar.gz
-rw-r--r-- 1 pi pi    80194 Jul 12 16:39 nxproxy-3.5.0-1.tar.gz
-rw-r--r-- 1 pi pi    25664 Jul 12 16:39 nxscripts-3.5.0-1.tar.gz
-rw-r--r-- 1 pi pi 20345475 Jul 12 16:39 nx-X11-3.5.0-2.tar.gz
pi@raspberrypi /work/nx $

Unpack all files (use "tar -xzvf <filename>" command), you should have the following directories (I moved gz files to a different directory):

pi@raspberrypi /work/nx $ ls -l
total 32
drwxr-xr-x  2 pi pi 12288 Jun 15  2011 nxcomp
drwxr-xr-x  2 pi pi  4096 May  9  2011 nxcompext
drwxr-xr-x  2 pi pi  4096 May  9  2011 nxcompshad
drwxr-xr-x  3 pi pi  4096 May  9  2011 nxproxy
drwxr-xr-x  2 pi pi  4096 May  9  2011 nxscripts
drwxr-xr-x 10 pi pi  4096 Aug  5  2011 nx-X11
pi@raspberrypi /work/nx $

Now compile individual components, it may take a while, so go grab a cup of coffee and relax:

cd nxcomp
./configure
make

cd nxcompext
./configure
make

cd nxcompshad
./configure
make

cd nxproxy
./configure
make

cd nx-X11
make World

Compiling FreeNX Server

The FreeNX Server source can be downloaded from http://freenx.berlios.de/download.php. The last version is freenx-server-0.7.3. (updated in 2008). Unpack the source and patch it with the gentoo-nomachine.diff patch file that is also packaged in the source file:

pi@raspberrypi /work/nxserver/freenx-server-0.7.3 $ ls
AUTHORS                nxcheckload.sample  nxserver
ChangeLog              nxcups-gethost      nxserver-helper
CONTRIB                nxdesktop_helper    nxserver-suid
COPYING                nxdialog            nxserver-usermode
gentoo-nomachine.diff  nxkeygen            nx-session-launcher
init.d                 nxloadconfig        nxsetup
INSTALL                nxnode              nxshadowacl.sample
Makefile               nxnode-login        nxviewer_helper
node.conf.sample       nxprint             nxviewer-passwd
nxacl.sample           nxredir
pi@raspberrypi /work/nxserver/freenx-server-0.7.3 $ patch < gentoo-nomachine.diff
patching file nxloadconfig
pi@raspberrypi /work/nxserver/freenx-server-0.7.3 $

Now, create a new patch file, e.g. nx_3.5.0.patch with the following context:

--- nxloadconfig.orig   2009-05-26 16:13:02.000000000 -1000
+++ nxloadconfig        2009-05-26 16:13:22.000000000 -1000
@@ -606,8 +606,8 @@
        [ -z $(echo "$ENABLE_ROOTLESS_MODE" | egrep "^[0|1]$") ] && \
                ERROR="yes" && echo "Error: Invalid value \"ENABLE_ROOTLESS_MODE=$ENABLE_ROOTLESS_MODE\""

-       [ -z "$(strings $PATH_BIN/nxagent | egrep 'NXAGENT - Version 1.5.0|NXAGENT - Version 2.[01].0|NXAGENT - Version 3.[012].0')" ] && \
-               WARNING="yes" && echo "Error: Could not find 1.5.0 or 2.[01].0 or 3.[01].0 version string in nxagent. NX 1.5.0 or 2.[01].0 or 3.[012].0 backend is needed for this version of FreeNX."
+       [ -z "$(strings $PATH_BIN/nxagent | egrep 'NXAGENT - Version 1.5.0|NXAGENT - Version 2.[01].0|NXAGENT - Version 3.[012345].0')" ] && \
+               WARNING="yes" && echo "Error: Could not find 1.5.0 or 2.[01].0 or 3.[012345].0 version string in nxagent. NX 1.5.0 or 2.[01].0 or 3.[012345].0 backend is needed for this version of FreeNX."

        [ -z $(echo "$ENABLE_USESSION" | egrep "^[0|1]$") ] && \
                ERROR="yes" && echo "Error: Invalid value \"ENABLE_USESSION=$ENABLE_USESSION\""

And run the patch:

pi@raspberrypi /work/nxserver/freenx-server-0.7.3 $ patch < nx_3.5.0.patch
patching file nxloadconfig

And

make

and

sudo make install


Setting up the NX environment

Now copy the library files and binaries compiled in the above steps to the correct locations.

cd /work/nx
sudo cp -a nx-X11/lib/X11/libX11.so* /usr/NX/lib
sudo cp -a nx-X11/lib/Xext/libXext.so* /usr/NX/lib
sudo cp -a nx-X11/lib/Xrender/libXrender.so* /usr/NX/lib
sudo cp -a nxcomp/libXcomp.so* /usr/NX/lib
sudo cp -a nxcompext/libXcompext.so* /usr/NX/lib
sudo cp -a nxcompshad/libXcompshad.so* /usr/NX/lib 
sudo cp -a nx-X11/programs/Xserver/nxagent /usr/NX/bin
sudo cp -a nxproxy/nxproxy /usr/NX/bin


Buy Game Console Adapters from http://www.easymg.com or http://www.diygadget.com



10 PCS, 10cm x 10cm, 2 layers prototype for $38.80 shipped!