Installing FreeNX server and NX Open Source Components
The best remote access software for the Xwindows system has to be NX. NX was developed by NoMachine and is a compression algorithm that minimize the traffic send between the Xwindows client and server. It was specially designed for low bandwidth links like modems. Anyone who had used NX is usually surprised at how fast the system feels. The responsiveness is much faster than VNC.
NoMachine opened up their sources to the NX algorithm and provides binary downloads to the NX server. The binaries are x86 and x86_64 only so ARM CPUs like the SheevaPlug is out of luck. To further complicate matter, NoMachine GPL'ed only their NX components, not the entire NX server. So you'll need the FreeNX server in combination with the Open Source NX components to make NX work on the Sheeva Plug. I will describe all the necessary steps to compile both the NX components and FreeNX server here.
First off you need to follow this guide to download and setup the X11 libraries. You may want to install VNC as well to test the X11 setup. NX does not support IceWM and a window manager, so I suggest installing Gnome or KDE instead.
Compiling NX Open Source components
You can get the source to the NX Open Source components from NoMachine here. There is 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:
Download and unpack all the components into ~/devel/nx and you will end up with the following directories:
ktung@rosalyn:~/devel/nx$ ll total 36 drwxr-xr-x 2 ktung ktung 12288 2009-03-19 08:58 nxcomp drwxr-xr-x 2 ktung ktung 4096 2009-03-19 08:49 nxcompext drwxr-xr-x 2 ktung ktung 4096 2009-01-21 00:34 nxcompshad drwxr-xr-x 3 ktung ktung 4096 2008-11-07 08:17 nxproxy drwxr-xr-x 2 ktung ktung 4096 2008-11-05 00:29 nxscripts drwxr-xr-x 10 ktung ktung 4096 2009-03-19 08:09 nx-X11
You will need addition packages to build the NX components:
apt-get install xmkmf expect xorg-dev libjpeg-dev libpng-dev
There may be others I've missed, if so, simply search for them with aptitude and install the necessary packages. Then compile the components:
cd nxcomp ./configure make cd nxcompext ./configure make cd nxcompshad ./configure make cd nxproxy ./configure make cd nx-X11 make World
Compiling FreeNX Server
Download the FreeNX Server source from freenx.berlios.de. The version I used is freenx-server-0.7.3. Unpack the source and patch it with the gentoo-nomachine.diff patch file that is already in the source.
patch < gentoo-nomachine.diff
That patch really only changes the target directory of the NX install. You can ignore the patch if you want to put the binaries somewhere else but keep in mind that this guide references paths base on the patch. Next you need to download the nx version patch here. This patch fixes the FreeNX server to recognize the 3.3.0 NX components. Without it, the installer will produce this error:
Error: Could not find 1.5.0 or 2..0 or 3..0 version string in nxagent. NX 1.5.0 or 2..0 or 3..0 backend is needed for this version of FreeNX.
Apply the version patch with:
patch < nx_3.3.0.patch
Then build the binaries:
make; make install
Setting up the NX environment
Without nice make install scripts we have to manually copy the binary and library files to their proper locations. Keep in mind that the paths here is base on the gentoo-nomachine.diff patch. So if you didn't apply that patch make sure you change the destination directories appropriately.
cd ~/devel/nx cp -a nx-X11/lib/X11/libX11.so* /usr/NX/lib cp -a nx-X11/lib/Xext/libXext.so* /usr/NX/lib cp -a nx-X11/lib/Xrender/libXrender.so* /usr/NX/lib cp -a nxcomp/libXcomp.so* /usr/NX/lib cp -a nxcompext/libXcompext.so* /usr/NX/lib cp -a nxcompshad/libXcompshad.so* /usr/NX/lib cp -a nx-X11/programs/Xserver/nxagent /usr/NX/bin cp -a nxproxy/nxproxy /usr/NX/bin
The freeNX server install script requires you to have CUPS, otherwise you will get the following error message:
Setting up cups nxipp backend ...cp: cannot stat `/usr/lib/cups/backend/ipp': No such file or directory
So get CUPS with:
apt-get install cups
freeNX server also expects to have the file libXrender.so.1.2 but the NX components has a newer version of libXrender.so.1.2.2 so you need to create a soft link that the installer can follow:
ln -s /usr/NX/lib/libXrender.so.1.2.2 /usr/NX/lib/libXrender.so.1.2
Install the freeNX server by going the the freenx-server-0.7.3 directory and type as ROOT:
When asked, select NO to the custom KeyPair (unless you want to and know how to set that up). The install script will setup more directorys in /usr/NX, create the ssh keys and create the special nx user. At the end of the install script it will do a test of your server configuration. You should get a screen that looks like:
----> Testing your nxserver configuration ... Warning: Could not find nxdesktop in /usr/NX/bin. RDP sessions won't work. Warning: Could not find nxviewer in /usr/NX/bin. VNC sessions won't work. Warning: Invalid value "DEFAULT_X_SESSION=/etc/X11/xdm/Xsession" Users might not be able to request a default X session. Warning: Invalid value "COMMAND_START_KDE=startkde" Users will not be able to request a KDE session. Warning: Invalid value "COMMAND_START_CDE=cdwm" Users will not be able to request a CDE session. Warning: Invalid value "COMMAND_SMBMOUNT=smbmount". You'll not be able to use SAMBA. Warning: Invalid value "COMMAND_SMBUMOUNT=smbumount". You'll not be able to use SAMBA. Warning: Invalid cupsd version of "/usr/sbin/cupsd". Need version 1.2. Users will not be able to enable printing. Warnings occured during config check. To enable these features please correct the configuration file. <---- done ----> Testing your nxserver connection ... Fatal error: Could not connect to NX Server. Please check your ssh setup: The following are _examples_ of what you might need to check. - Make sure "nx" is one of the AllowUsers in sshd_config. (or that the line is outcommented/not there) - Make sure "nx" is one of the AllowGroups in sshd_config. (or that the line is outcommented/not there) - Make sure your sshd allows public key authentication. - Make sure your sshd is really running on port 22. - Make sure your sshd_config AuthorizedKeysFile in sshd_config is set to authorized_keys2. (this should be a filename not a pathname+filename) - Make sure you allow ssh on localhost, this could come from some restriction of: -the tcp wrapper. Then add in /etc/hosts.allow: ALL:localhost -the iptables. add to it: $ iptables -A INPUT -i lo -j ACCEPT $ iptables -A OUTPUT -o lo -j ACCEPT
You should not have any errors on the nxserver configuration section. If there are errors, it is usually path related and it must be fixed. At this point, you should be able to connect with the client to the FreeNX server. I am using the NoMachine NX client v3.3.0-6 and I installed it with the .deb file.
The nxserver connection test doesn't seem to produce any useful results. Even though the test was not able to connect, I am able to connect with my client. However, during the time when I was trying to get it to work, I had a lot of could not connect problems. I try nearly everything suggested and was finally able to connect. I then uninstalled NX and started over (so I can write this wiki) and was able to connect without doing anything at all. So I really don't know if there is an extra step missing that I did before but didn't have to do now because the settings was saved somehow. I will list all the steps I did but doesn't seem necessary anymore in the troubleshooting section.
Once you have verified everything works, you need to download this script and put it in /etc/init.d/ so the FreeNX server starts during boot. The script was originally from NoMachine that was packaged with their Linux free edition. I changed it so that it no longer starts the statistics because FreeNX server doesn't support that. I also added LSB information to the script so it plays nice with Ubuntu. After you download the script and put it in /etc/init.d/, type:
update-rc.d nxserver defaults
Next time you restart the Sheeva Plug, the FreeNX server will start automatically.
Here is a list of things I did during the trial and error phase. It doesn't seem like I need these steps now, but I'll list them in case you have trouble connecting.
- I uncommented the line with AuthorizedKeysFiles in /etc/ssh/sshd_config and pointed it to authorized_keys2. That did not seem to do anything so I put it back to the way it was.
- If you tried to run /usr/NX/bin/nxserver --listuser as root, you will see that it doesn't work and complains about ENABLE_PASSDB_AUTHENTICATION="1" in node.conf. To fix that, copy the file in the FreeNX server source directory node.conf.sample to /usr/NX/etc and rename it to node.conf. Then edit the file and change the setting, save and restart the server. Listuser will now work and you can add a new user with /usr/NX/bin/nxserver --adduser <username>. That doesn't seem necessary, but I did it anyway.
- Don't forget to /usr/NX/bin/nxserver --cleanup if you're trying to debug the client, sometimes the client that would normally work fails to connect because of an old session. It also doesn't hurt to /usr/NX/bin/nxserver --restart afterwards either.
If the client is stuck on Negotiating link parameters while trying to connect, make sure you have the "Disable encryption of all traffic" on the client unchecked. This is likely caused by the ssh server on the SheevaPlug rejecting non-encrypted ssh traffic.
Did you find this page useful?