FreeNX

I just tried using FreeNX instead of X port forwarding with SSH. The problem with X port forwarding is that if your SSH connection dies for any reason, you lose your X session. You can use the ‘screen’ program inside an xterm (or just in SSH directly) for console-style programs, but that doesn’t help any with actual X clients. FreeNX uses SSH, but it acts as an X proxy, so that if your SSH conection dies you can reconnect (even from a different machine).

With Fedora Core 5, FreeNX is available from “extras”, so you can just say “yum install freenx” on your remote host. (I almost used the word “server”, but in terms of the X window system, the server is the machine running the display, which is the local machine.) The package installation handles most of the configuration, but there are still a few minor chores remaining. Some (but not quite all) of them are documented on Rick Stout’s “HOWTO setup Freenx on Fedora” page. I’ll get to the details later.

If you’re using a Fedora release earlier than FC5, Rick supplies RPMs, but they are based on the NX 1.5 core, and only work with the NX 1.5 client. Unfortunately it appears that NoMachine only distributes the 2.0 client now. One of the remote machines that I need to access via NX is running Fedora Core 3. I ended up rebuilding the FC5 Extras SRPMs under FC3, with a few minor changes to the spec file. I can make the spec, SRPMs, or i386 RPMs available if anyone needs them.

When you configure a connection using the local nxclient, you must put in the DSA key that was generated on the remote nxserver. Rick’s page shows how to do that. But you also have to “unlock” the nx user on the remote host, with “passwd -u -f nx”. And the SSH server on the remote host must be listening on the loopback address as well as a public IP address. Usually that is the case, but my remote host acts as a server for many virtual domains, so I had configured the SSH server to listen on only a single IP address. I had to change the configuration to make it also listen on 127.0.0.1.

When using FC3 on the remote host, you have to change the client configuration to use a custom session rather than a GNOME session, though you can run GNOME. Rick’s page explains that. But there is also a problem where starting Emacs as an X client gives an error ‘Undefined color: “black”‘. jugboy ran into this problem with a different X distribution, and wrote about how he solved it. Unfortunately his solution does not seem to work on FC3, because the rgb.txt file actually is in the place nxagent expects it.

Aside from that, it is working fine for me with the NoMachine NX client on FC5. But when I try to connect to either the FC3 or FC5 remote machines from Windows, it connects then reports “Authentication failed for user esmith”. The “Detail” button is grayed out, so it is completely non-obvious what is going wrong.

I very much appreciate that the fine folks at NoMachine released the server source code (and library source code) under the GPL. But it would be nice to have a GPL’d client program as well. Apparently 2X has just released one for Linux, so I’ll have to give it a try. I wanted to download the source, and their web site allows browsing their Subversion repository online (via Trac), but it is not clear how to connect from a Subversion client.

This entry was posted in Fedora, NX. Bookmark the permalink.

2 Responses to FreeNX

  1. Jugboy says:

    Did you check to see whether there is an entry for “black” in the rgb.txt file?

    I imagine there is, but it’s worth checking:

    I see:

    $ grep -i black /usr/X11R6/lib/X11/rgb
    0 0 0 black

  2. Eric says:

    Good idea, thanks. I was unclear on whether nxagent was looking for rgb.txt or just rgb, so at first I symlinked it. That didn’t help, so I made a copy instead. Both files do have a line for black, and both are world-readable. I’ll have to keep looking.

    The FC3 machine is slowly being phased out in favor of the FC5 machine, so eventually this will become a non-issue.

Leave a Reply