Gentoo Wiki


Merge-arrows.gifIt has been suggested that this article be Merged into one article with FreeNX.    (Discuss)


FreeNX is a free "Terminal Service" written for Linux and is available thanks to common work of No machine and the Community. This howto will show you how to install nxserver-freenx so that it is possible to connect from anywhere to your desktop and one can use only one session (this can be modified, watch Other Remarks bottom).


Edit your make.conf to include some USE flags needed for nxserver-freenx: rdesktop and cups.

These USE flags are needed for FreeNX if you have KDE installed: kdeenablefinal and kdehiddenvisibility.

Note: You need to include CUPS as it is needed by nxserver-freenx.

Then adjust some general settings:

echo "net-print/cups -php" >> /etc/portage/package.use

Use the newest nxserver-freenx and nx library (if you prefer older but somewhat more stable, omit the following lines):

echo "net-misc/nxserver-freenx" >> /etc/portage/package.keywords
echo "net-misc/nx" >> /etc/portage/package.keywords

Then emerge FreeNX:

emerge nxserver-freenx

Launch the installer:


Now edit your SSH settings and restart it, make some defaults, start nxserver:

sed -i 's/#PubkeyAuthentication\ yes/PubkeyAuthentication\ yes/' /etc/ssh/sshd_config
sed -i 's/authorized\_keys$/authorized\_keys2/' /etc/ssh/sshd_config
sed -i 's/#AuthorizedKeysFile/AuthorizedKeysFile/' /etc/ssh/sshd_config
/etc/init.d/sshd restart
rc-update add nxserver default
/etc/init.d/nxserver start

Add or change the line which allows custem users to login:

echo "AllowGroups wheel nx" >> /etc/conf.d/sshd_config

Add a new user (in my case "stefan"):

useradd stefan
passwd stefan
mkdir /home/stefan
chown stefan:stefan /home/stefan
chmod 700 /home/stefan

You need to add every user that should be able to use the FreeNX server to the group "nx":

usermod -G wheel,nx stefan

Now launch nxclient to check if everything works.

Retrieved from ""

Last modified: Sun, 03 Aug 2008 10:48:00 +0000 Hits: 826