FreeNX Server HOWTO
From openSUSE
Contents |
About
NX is a new wonderful remote access protocol. It is both fast, secure, graphical and open (as opposed to the Telnet protocol, which is only fast and open).
NX is basically a client-server protocol, that allows you to graphically access any machine, It is based on both SSH (for security) and X Compression (for GUI and speed), and NX is much easier to use than normal X protocol.
This How-To describes how to use SUSE Linux 10.0 as a Terminal Server, how to configure stuff, and how to connect to it.
Short History
After NoMachine created NX a few years ago, they released their core libs and commandline tools to the public (as GPL). Kurt Pfeifle - a KDE contributor - took those libs and tools and created a first humble (unreleased) script that automated the setting up of a remote NX connection to a degree. After Kurt introduced Fabian Franz (at the time a contributor to Knoppix and MPlayer) to NX, Fabian created a project called FreeNX; FreeNX is a work-alike implementation of NoMachine's commercial (and closed source) NX Server.
NoMachine still releases their core libraries under GPL, gives away their NX Client and grants free binary redistribution rights for it. Their client can be used to access FreeNX servers.
We - the community - can use the GPL'ed implementation of the FreeNX server and the KDE "knx" client (though that one does still miss many features and lacks maintenance).
There's also the GPL-ed client for the 2X server (another commercial product by a different company that uses the NX core libs) that is supposed to work with FreeNX.
Setting up things
openSUSE 11.1
The FreeNX package is no longer present in the official openSUSE 11.1 repositories. You can find the package in the Build Service.
- Install NX and FreeNX rpms from here and here. The versions from the repository X11:RemoteDesktop/openSUSE_11.1 should work fine.
- Run nxsetup --install --setup-nomachine-key --clean to install the server the first time
- Use nxserver --status to check status of the server. The server runs on the ssh port, 22.
- Test connecting using any NX client. Official No Machine client can be downloaded from www.nomachine.com which installs the client binary at /usr/NX/bin/nxclient See http://walter.deback.net/blog/archives/19 for using the NX client effectively.
openSUSE 10.0
If you are, like me, running SUSE Linux 10.0 - you will need to install FreeNX package (the server) using YaST (freenx is on SUSE CDs/DVD) as well as some client software (to test on local machine) - you can use freeware NX Client (from www.nomachine.com/download) or use Open-Source "knx" - the standard KDE NX Client.
After setting up the procedure is damn easy.
First enter root mode, then:
1) let's make sure that you installed the right package:
linux:/ # rpm -q FreeNX
FreeNX-0.4.4-4 ; for openSUSE 11.1 this is: FreeNX-0.7.3-1.1
If it returs nothing, then install it using YaST. If returns "FreeNX-0.4.4-4" like in my case, then all is OK.
2) This will configure the FreeNX server: (using the standard key)
linux:/ # nxsetup --install --setup-nomachine-key --clean
At least in openSUSE 11.1 you will see some checks done. Some will fail but may be harmless unless you want these features working. At the end a test session will be done which should succeed. You may want to save the output of nxsetup in a text file for later reference.
3) start any NX client - I use NoMachine's - and type: localhost as my host, 22 as my SSH port - after all NX is based on SSH, my user's name & password, desktop: UNIX/KDE set the resolution press ok - and - everything works wonderfully !
NX-In-Action Screenshot:
Congratulations ! ! ! You are done !
The next paragraphs are strictly optional for Advanced NX configuration. You don't need to read them to make NX working.
Running The Terminal Server
In the real world, running a Terminal Server requires more than just configuring NX Server - it also requires to configure users on the server. On SUSE Linux it's easiest to do with Yast. Now we need to configure the clients - there are two ways for achieving this:
1) Using existing (Windows ?) Workstations and simply install NX Clients on them.
2) Use LiveCD that comes with NX Client. Newer Knoppixes do. v3.9+.
NOTE1: Unfortunately, the SUSE Live DVD do not meet the specs - it doesn't include NX Client _and_ doesn't include UnionFS to install the NX Client. SUSE Live DVD can still be used - but you will have to manually install the NX client with user account but it's harder than Knoppix.
NOTE2: FreeNX as a Terminal Server is great, because it's very fast, secure, and the software is not the limited to the number of clients -- your only limitation is the power of your Server. (that is -- the performance of your CPU & amount of RAM)
3) Use discless distributive, such as thinstation or 2x.com.
A note about NX Clients
There are two NX clients in existence - namely:
a) the freeware NoMachine's "NX client" (closed-source). Advanced client.
b) and an open-source KDE "knx" client. Simple Client.
Each is supported on different platforms:
1) Windows 95...XP - must use a.
2) Mac OS X (ppc) - must use a.
3) Linux - can use a -or- b.
4) FreeBSD - must use b.
5) Solaris (sparc) - must use a.
A Server can be Linux or UNIX host only.
SUSE Linux 10.0 is very well supported. Another UNIXes/Linuxes might need to compile stuff.
Using KDE3 If KDE4 Is Installed
If KDE4 is installed on the NX server and you attempt to login to a KDE desktop, the NX server will default to a KDE4 desktop.
If you wish to connect to a KDE3 desktop remotely, add the following line to the /etc/nxserver/node.conf file:
COMMAND_START_KDE=startkde3
On openSUSE 11.0, startkde starts KDE4 and startkde3 starts KDE3.
Changing NX TCP Port
Because changing NX port on the client is straightforward - I will concentrate on the server here.
Since FreeNX server is based on SSH, changing NX port will require you to change SSH port as well, or NX will fail. The default TCP port of SSH and NX is 22. The configuration files on SUSE Linux 10.0 are:
/etc/nxserver/node.conf
/etc/ssh/sshd_config
...and don't forget to restart the SSH service afterwards.
Tip for advanced users:
By using this technique - you can effectively setup a farm of Linux distros even on your home PC - using some kind of virtualization (VMware/Qemu/Xen) - by setting up virtual NX servers to listen on different ports. This is really cool - because it can be used from both a LAN and from the Internet at the same time !
Runlevels
The NX Server can run in runlevel 3 or 5. NX Server doesn't use video card, so it will work.
NX Client will require you to use runlevel 5. (*Applicable only if you run NX client on SUSE Linux - since Windows has no runlevels concept)
To find out in which runlevel you are working now, use:
> who -r
run-level 5 2006-04-24 17:33 last=S
International Keyboard Support
The NX Server requires a small modification of /etc/nxserver/node.conf as root to allow NX clients to use other keyboards settings than the US (QWERTY) one:
Locate the line in /etc/nxserver/node.conf reading:
#AGENT_EXTRA_OPTIONS_X=""
And change it to read:
AGENT_EXTRA_OPTIONS_X="-xkbdir /usr/share/X11/xkb"
Restart your NX Server with:
nxserver --restart
Then reconnect your NX Client and that's it. You should now have a working international keyboard.
SLE 10 Modifications
These instructions work on SLED SP2 and SLES10 SP2, with the following additional setup steps:
- FreeNX, NX, rdesktop do not ship with SLES 10, so you must download an RPM from the OBS Project.
- FreeNX has dependencies on the following packages that can be installed from the shipping CD/DVD/ISO
- expect
- cups
- After running nxsetup, the following line must be un-commented and modified as follows in /etc/nxserver/node.conf
COMMAND_SESSREG="/usr/X11R6/bin/sessreg"
- This prevents the following error when trying to connect a client:
/usr/bin/nxserver: line 874: sessreg: command not found NX> 280 Exiting on signal: 15
-By Alexey Eremenko. 21.apr.2006.
-Internation Keyboard Support area by Xavier Colinot. 14.jul.2007
-SLE10 Modifications area by Luke Hallett. 07.sep.2008
- minor SLES10 changes by Benjamin Francom 03.mar.2009
If you want to go level up, click here: http://en.opensuse.org/Configuration


