Nxserver

NX is a technology developed by nomachine that provides similar functionality to xdmcp with the advantages of inbuilt security, compression and caching. Those advantages, however, bring complications.

Let us say we want to have machine A show a desktop where the window manager is actually running on machine B. Henceforth I shall refer to machine A as the client and machine B as the server.

On the client:

On the server:

Now the fun begins!

Authentication
The process of authentication appears to involve two ssh conversations.

nxclient contacts the server using public key authentication for a user called nx (which should hopefully have been added by the ebuild). If you look at /etc/passwd, you will see that the shell associated with this user is /usr/NX/bin/nxserver. Thus when ssh logs in to this user nxserver is started on the remote machine. There is no daemon involved - nxserver is started as required.

nxclient then starts a second ssh connection based on the user account and password given to it in the log in dialog. This creates an nxnode process and your session is run under this. It ends up looking like this: init─┬─acpid .    .     ├─sshd─┬─sshd───sshd───nxserver─┬─nxserver │     │                        └─2*[nxssh] │     └─sshd───sshd───nxnode─┬─nxagent │                            └─nxnode───fvwm─┬─FvwmBacker │                                            ├─FvwmButtons .                                            .     ..

In theory this is all completely transparent. Just run

and fill in the relevant bits in the dialog and all should be well.

If Authentication doesn't work
After a fresh install of nxserver-freeedition this authentication handshake did not work for me. I got this:

NX> 202 Authenticating user: nx NX> 208 Using auth method: publickey NX> 204 Authentication failed.

I tried many increasingly desperate things. I eventually reasoned that if I could get ssh to connect then I should be able to get nxclient to connect as well. The first test, therefore is to give nx a password with:

and ensure that in /etc/ssh/sshd_config you have:

/etc/ssh/sshd_config

Now try (on the server):

and you should get: HELLO NXSERVER - Version 3.4.0-8 - LFE NX> 105

Type at the prompt.

This, for me, was the first glimmer of hope that something could be achieved!

Next, we need to make it work for a "passwordless" (i.e. public key driven) log in. This works in the same way that ssh does - drop a public key into ~/.ssh/authorized_keys and connect with the private key... except that by default nxserver uses ~nx/.ssh/authorized_keys2 instead. To get everything singing from the same hymn book:

This deletes ~nx/.ssh/authorized_keys2.

Now edit the following line in both /usr/NX/etc/node.cfg and /usr/NX/etc/server.cfg:

/usr/NX/etc/node.cfg and /usr/NX/etc/server.cfg

Next create a shiny new key pair:

And create the authorized_keys file:

After all this we should have:


 * A private key named /usr/NX/share/keys/default.id_dsa.key
 * A public key named /usr/NX/home/.ssh/default.id_dsa.pub
 * /usr/NX/home/.ssh/authorized_keys which is just a copy of /usr/NX/home/.ssh/default.id_dsa.pub

Let us now test access:

You should once again get: HELLO NXSERVER - Version 3.4.0-8 - LFE NX> 105

but this time without having to type in a password. If ssh can do this, so can nxclient.

Start nxclient and import the private key (/usr/NX/share/keys/default.id.dsa.key). You should now hopefully be able to connect.

Core X fonts
There is something of an issue with core X fonts. If you use nothing but xft fonts, this is not a problem. If, however, you have a penchant for urxvt and terminus font as I do, it renders the client all but unusable. The nature of nx is that XServers are in play on both the client and the server. They must agree on which fonts are available. On the client side, this is simply all the fonts that are available to the XServer that nxclient is running on. On the server side, however, you're dealing with a proxy server that is following it's own rules. One of these rules is that only certain directories will be scanned for fonts - just because you have the font path in /etc/X11/xorg.conf does not mean that you can use the font. One of the directories that does get scanned is /usr/share/fonts/misc so drop the fonts in that and all will be well.

I shall deal with getting terminus working across nx:

On both the client and the server:

Fullscreen FVWM (other window managers are available...)
For those that don't do gnome or KDE, fvwm works just fine. In the configuration dialog of nxclient select Desktop as Unix;Custom and under settings choose "New Virtual Desktop" and "Run the Following command", entering as the command. Under Display select Fullscreen. You can also create a script to run instead if you need xrdb to run before starting fvwm.