How-To Connect Graphically from Remote: FreeNX

Alexey Eremenko "Technologov"

$Revision: 14 $

$Date: 2007-01-05 $

Revision History
Revision 1406 May 2007A.E.
bugfix release compared to v13
Revision 105 Jan 2007A.E.
First public release

About

NX (new X) is a new wonderful remote access protocol. It is both fast, secure, graphical and open. (as opposed to telnet protocol, which is only fast and open.)

NX is basically a client/server protocol, that allows you to graphically access any machine, is based on both SSH (for security) and X compression (X for graphics and compression for saved bandwidth, which results in better speed), and NX software is much easier to use than normal X protocol for remote connections.

This article describes how-to configure openSUSE as a terminal server, some background of NX, and how to connect to it.

Think of NX as a competitor to Microsoft's Remote Desktop and Terminal Services.

Procedure

  1. First enter root mode, by using the command su. then we must check if our software is installed: “FreeNX” Server and proprietary NoMachine's NX Client:

    # rpm -q FreeNX nxclient
    FreeNX-0.5.0-25
    nxclient-2.1.0-11
    

    The output above shows packages versions, which means both are installed. If not, then install them first.

    Fortunately, the FreeNX server is included in openSUSE CDs and DVD. The NX client must be downloaded manually from: http://www.nomachine.com/download

  2. After the packages installed, use this command to configure FreeNX server:

    # nxsetup --install --setup-nomachine-key --clean
    
  3. Start NoMachine's NX client and type: “localhost” as my host, “22” as my SSH port - after all NX is based on SSH, use your user's name and password, desktop: UNIX/KDE (my preference!), set the resolution to something smaller than your real screen for test, press ok.

  4. If your firewall is on (default openSUSE setup), you must configure your firewall to accept TCP Port 22 - to allow SSH and NX traffic to pass from remote computers. To do so:

    Yast Control Center -> Security and Users -> Allowed Services -> SSH -> Add -> Next -> Accept

  5. From now on, I will explain more advanced uses of NX. Those are “extras”; not needed for successful basic configuration.

History of NX

The NX Protocol (new-X) was created by NoMachine few years ago as a proprietary extension to X, for fast and secure remote access. NoMachine released their core libraries to the public, licensed under the GPL. The Open Source community took those libraries and created a product called FreeNX server!

NoMachine now sells their enterprise server software and gives away their NX client as freeware. Later, they also decided to release their commercial single-user “Personal” NX server as freeware.

We, the Open-Source community, can use GPL'ed implementation of this wonderful NX protocol, and we have built open-source FreeNX server and the KDE “knx” client.

Unfortunately, the knx client was never updated, so it can not work with newer releases of the NX server, such as the version of FreeNX included with openSUSE. Basically “knx” is dead. This means, that until someone updates the client, we are forced to use the proprietary one, and be limited to the number of platforms NoMachine chose to support, without any desktop integration.

Another push by the Open-Source community was an unsuccessful “QtNX” client, that never worked for me.

Backwards Compatibility

There are 2 generations of NX, that I know of. They are not fully compatible. It is highly recommended to have both the client and the server to be fully compatible at the protocol version.

Nomachine's NX version 2.0 is = FreeNX 0.5 (openSUSE works here)

Nomachine's NX version 1.5 is = FreeNX 0.4 (dead “knx” client works here)

Additional Information about NX Clients

In the real world, running a terminal server requires more than just configuring NX server. It requires to configure users on the server. On openSUSE it's easiest to do with Yast. Now we need to configure the clients. There are several ways for achieving this:

Using existing (Windows ?) Workstations and simply install NX Clients on them.

Use LiveCDs that comes with NX Client v2.x.

Unfortunately, the openSUSE Live DVD does not meet the specs - it doesn't include NX Client and doesn't include UnionFS to install the NX Client. Of course, you can manually install the NX client with user account to RAM disk, as RPM supports such non-standard ways, but it's harder than Knoppix. Alternatively, you could use “klik” packaging system to install nxclient anywhere.

The NoMachine's NX Client can run on:

  1. Windows 95...XP (x86 and x64)

  2. Linux - starting from RedHat 8, SUSE 8, Debian 3, ... (x86 and x64)

  3. Mac OS X 10.0 (x86 and PPC)

  4. Sun Solaris UNIX 8 (SPARC)

NOTE: The NX Server cannot run on Windows or Mac, because those OSes are not based on X Window System. Microsoft Windows uses GDI, while Mac OS X uses Aqua. Therefore NX Server can run only on UNIX-like systems; including BSD, Solaris and Linux.

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, actually integrates into it, and has no separate daemon, 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 openSUSE are:

  1. In file below find: “SSHD_PORT

    localhost:/ # cat -n /etc/nxserver/node.conf | grep SSHD_PORT

    NOTE: This command will only return the # of line, which needs to be edited manually.

  2. In file below find: “Port

    localhost:/ # cat -n /etc/ssh/sshd_config | grep Port
  3. ...and do not forget to restart the SSH service afterwards with:

    localhost:/ # rcsshd restart

Tip for advanced users:

By using this technique, you can effectively setup a farm of Linux distros even on your home PC. By using some kind of virtualization (VMware/Qemu/Xen), you can set up virtual NX servers to listen on different TCP 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 does not use the video card, so it will work.

NX Client, however, will require you to use runlevel 5. (That's applicable only if you run NX client on Linux, since Windows has no concept of runlevels. )

To find out, in which runlevel you are working now, use:

> who -r
	run-level 5  2006-04-24 17:33                   last=S

For More Information

Overall: FreeNX as a terminal server is great, because it's very fast, secure, and the software is not the limited by the number of clients. Your only limitation is the power of your server. (that is: the performance of your CPU and amount of RAM)

Unfortunately, knx client doesn't has any home page.

Look at the original article here: http://en.opensuse.org/FreeNX_Server_HOWTO.

NoMachine's Home Page: (creators of NX) http://www.nomachine.com.

Wikipedia page dedicated to FreeNX: http://en.wikipedia.org/wiki/FreeNX.

FreeNX Home Page: http://freenx.berlios.de/.

Original article written on: 21.apr.2006.