Remote desktop connection in Linux: NX Server

Posted on Aug 13, 2010

My office computer was just an old Windows box which was getting slow due to the resource-devouring vaccine software. I decided to install Ubuntu (9.10, Karmic Koala) on it in order to use its computing power more efficiently. It was done quite nicely. I could run FireFox, Thunderbird and most of my favorite software as I used them on Windows just with the faster speed. The thing I wanted next was a substitute for Windows terminal service, aka, Remote Desktop Connection, since most of the time I logged on the machine remotely.

There are several implementations of VNC and RDP available for that purpose. I tested a couple of them myself, but the user experience they provided was not very satisfying to me, not to mention their slow speed. Then, I found FreeNX server1 which is a GPL implementation of NoMachine’s NX Server. It worked just like a charm. Fast and neat. It was exactly what I wanted, and I loved it.

However, something got wrong after I upgraded to Ubuntu 10.04 (Lucid Lynx). From Lucid, the official support package for the NX clone changed from FreeNX server to NeatX server which was released by Google. So I switched to NeatX. Since then, a bad thing happened. Whenever I disconnect the NX session, a zombie session remained alive on the machine which I could not remove or reconnect to. I had to log in with SSH and delete the session profile manually every time. The problem was continued even after I rolled back to FreeNX. I didn’t know whether it was a problem of NeatX alone or a problem of updated packages of both servers, but it was bothering me so much.

I looked for its solution so badly for a couple of days, and then suddenly an idea occurred to me. “Why am I looking for a solution for NX clones? Isn’t NoMachine’s NX Server free for the personal use? Why don’t I try the original server? I’m already using their client.2” I downloaded NoMachine’s binaries right away and became happy again. NoMachine provides NX Free Edition for Linux which allows simultaneous connection for two users. Therefore, if you are looking for a remote desktop solution in Linux and you don’t need to support more than two users, then don’t be bothered to try NX clones. Just install the original NX Server from NoMachine3.

The only problem of NoMachine’s NX Server is that somehow NX Free Edition does not allow you to shutdown by clicking the menu on the GNOME panel4. (I guess it is a kind of a user privilege problem. NX client logs in with the username “nx” whose shell is nxserver. Then, the user “nx” secures access to your stuff with the login information you provide, as “su” does, I guess. Therefore, the privileges that the user “nx” has may not be the same as yours.) It is still possible to shutdown by typing the command in a terminal though. So I solved it simply by registering the following script on the panel. Scroll to the right on the code line to see the whole script. It is one very long line.

sh -c "if zenity --question --title=\"Restart\" --text=\"Are you sure you want to close all programs and restart the computer?\"; then gksu -m \"Please enter the password to reboot this computer.\" reboot; fi"


1. If you are interested in FreeNX, this Community Ubuntu Document will be very helpful. One advantage of FreeNX is that it doesn’t limit the number of concurrent connections as NoMachine’s NX does.

2. Although there are a couple of open source NX clients, it is generally recommended to use NoMachine’s client along with the server you choose. No matter which server you choose, you can use it with NoMachine’s client.

3.For the details of server configuration, refer to the following two files.
/usr/NX/etc/server.cfg
/usr/NX/etc/node.cfg

4. To me, it was the most inconvenient thing, but another common complaint is about unsmooth play of remote computer sounds. NX Server supports ESD only which your favorite software may not compatible with. The applications are supposed to send audio output to the NX client directly over the network. (In this case, the NX client becomes an ESD daemon.) The response of audio to user actions is usually very slow. A music will start and stop a couple of seconds later when you click. Plus, large bandwidth is required, since the sound is transferred compressed.