You are on page 1of 13

FreeNX

What is FreeNX
FreeNX is a system that allows you to access your desktop from another machine over the Internet.
You can use this to login graphically to your desktop from a remote location. One example of its use
would be to have a FreeNX server set up on your home computer, and graphically logging in to the
home computer from your work computer, using a FreeNX client.

It's Open Source, secure (SSH based), fast and versatile! License: GPL

Note: Running FreeNX as server on Ubuntu with the free "NX Client for Windows"
from NoMachine on a Windows workstation is working fine, exceptresuming sessions.

Terminology
The Server is the computer you want to connect to. This is the computer where the FreeNX server
will need to be installed. The name of the Ubuntu package providing the server is "freenx". For the
example used here, the home computer is the server.

The Client is the computer from which you want to be able to access theServer. The name of the
Ubuntu package providing the client is "nxclient". For the example used here, the work computer is
the client.

What is neatx
neatx is a similar system to FreeNX, produced by Google.

It's Open Source, secure (SSH based), but does have some feature drawbacks compared to
FreeNX. License: GPL2

Installation Prerequisites
Before installing FreeNX server make sure you have SSH set up and is working. You can find the
SSH Howto here:https://help.ubuntu.com/community/SSHHowto

We will be installing the FreeNX server on the Server machine, i.e., the machine that you want to
access remotely. In the stated example, this is your computer that is at home.

FreeNX is not included in Ubuntu, so we'll add it from the FreeNX Team PPA. This step will be in the
installation instructions for your Ubuntu distribution of choice below.

For the paranoid: there is an added security risk involved in using the default keys. If you keep the
default keys then everybody will be able to connect to your SSH server as the NX user which is
added to your system during the installation. This opens an additional (and unnecessary)
opportunity to attack your computer. You could avoid it by using custom SSH keys, as explained
later.
Installing the FreeNX server on Ubuntu Maverick Meerkat (10.10)
Follow the instructions for installing FreeNX on Lucid (10.04) with the added step of modifying the
repository after you have installed it and changing the release from "maverick" to "lucid". Consider
this to be step 1a:

1. Open your terminal


Applications->Accessories->Terminal
then copy and paste in this command
sed -i 's/maverick/lucid/g' /etc/apt/sources.list.d/freenx-team-ppa-maverick.list

Then continue with remaining steps. There is currently no version for maverick but the lucid version
seems to work.

Installing the FreeNX server on Ubuntu Lucid (10.04)


As of Ubuntu 10.04, Lucid Lynx, users have two choices for their NX server, 1) FreeNX from the
FreeNX team or 2) neatx from Google.

FreeNX

1. Follow the instructions for Ubuntu Karmic 9.10


o CAVEAT: If you do not have the nxsetup binary for the last step, you can download it
from here: nxsetup.tar.gz More details on this step below.
neatx

OPEN FOR DISCUSSION:

 2010-07-04:9:00AM from [fermulator] - I disagree with this recommendation. Why should


users switch to "neatx"? If you go to their website, it flat out confirms that not all features are
available when compared to the existing open source FreeNX server. Also, I'd prefer to
continue to trust the tried and true FreeNX server, over something from Google. If you want
to continue to use freeNX, you can. Just following the above instructions, otherwise, feel free
to use neatx instead by following the below instructions. (Interested to see if anyone else has
opinions on this)
 2010-10-18:2:06PM from [deesto] - Installing freenx in Maverick with the given commands
for the Lucid repository worksonly if you first install the repository file, which you can't edit
before that because it doesn't yet exist. Even then, trying to start the service fails miserably:
 $ sudo /etc/init.d/freenx-server start
 Rather than invoking init scripts through /etc/init.d, use the service(8)
 utility, e.g. service freenx-server start
 Since the script you are attempting to invoke has been converted to an
 Upstart job, you may also use the start(8) utility, e.g. start freenx-server
start: Unknown job: freenx-server

 1010-10-18:8:58PM from [spencerwire] Actually it does work, and you don't need to start the
service as you indicated, because it starts when you connect to the machine. I'm connected
to my work machine right now using exactly the steps I indicated. I did, however, modify the
instructions so that the entire process is in step 1 (1a-1c) so that step two later on would
make more sense.

1. Open your terminal


Applications->Accessories->Terminal
and type in this command
sudo apt-get install python-software-properties && sudo add-apt-repository ppa:freenx-team
2. Then Update Apt
sudo apt-get update
3. At this point, the repository is added and apt is updated, then install the neatx-
server package (using Aptitude to install extra needed packages).

sudo apt-get install neatx-server

Installing the FreeNX server on Ubuntu Karmic (9.10) (Also works on Lucid)
Karmic introduces the add-apt-repository command that simplifies most of the work of adding a
third party repository.

1. Open your terminal


Applications->Accessories->Terminal
and type in this command
sudo add-apt-repository ppa:freenx-team
o NOTE: If you do not have add-apt-repository installed add the following
sudo apt-get install python-software-properties
2. Then Update Apt
sudo apt-get update
3. At this point, the repository is added and apt is updated, then install the freenx package
(using Aptitude to install extra needed packages).
sudo aptitude install freenx
(note, as of Aug. 16 2010 the above command doesn't install a particular script file--appears
to be missing from package. So after performing the above, download it from here. Next, cd
to the directory to where the script was downloaded and un-packed, probably your
downloads folder. Then, move the script into the proper directory: /usr/lib/nx/ with:
sudo mv nxsetup /usr/lib/nx/nxsetup
o Finally, make sure you change the ownership of this file once you moved it so that it
is owned by root:
sudo chown root:root /usr/lib/nx/nxsetup
4. Now use nxsetup to install necessary files and create the special user "nx"
sudo /usr/lib/nx/nxsetup --install

Installing the FreeNX server on older Ubuntu Versions


These instructions are for older Ubuntu versions. FreeNX is not included in Ubuntu, so we'll add it
from the FreeNX Team PPA.

Add this repository using the Third-Party Sources Tab in Software Sources. When it asks, Reload
the information about available software. Now you can see and install the freenx package
in Synaptic Package Manager.

You must edit the configuration files and install by hand:

1. Add this PPA to it's own list file


2. sudo bash -c "echo 'deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu VERSION main

deb-src http://ppa.launchpad.net/freenx-team/ppa/ubuntu VERSION main' >>


/etc/apt/sources.list.d/freenx.list"
where VERSION can be: dapper, hardy, intrepid or jaunty. More information can be found
at FreeNX Team PPA.
3. Add the public key of FreeNX PPA run:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com
F3A662B57D580D3A2E98E5152A8E3034D018A4CE
4. Then Update Apt
sudo apt-get update
5. After you add the repository, then install the freenx package (using Aptitude to install extra
needed packages).
sudo aptitude install freenx
6. Now use nxsetup to install necessary files and create the special user "nx"
sudo /usr/lib/nx/nxsetup --install

Installing the NX Client


The official NX client is not in the Ubuntu repositories.

You should be able to access your Ubuntu box from any Windows or Linux box using the free client
from NoMachine's website. You can also embed your NX Server in a webpage by installing the
Nomachine Web Companion and the Apache webserver.
Now you can execute the installed client using the following command:

/usr/NX/bin/nxclient &

Or by looking it up in the menu

This will start the NX client in a GUI, and step you through getting connected to the FreeNX server,
and you will be on your way![Note: If you are behind a firewall you may need to enable SSL
encryption under the Advanced configuration tab -JeremySchroeder]

Installing QTNX (Opensource client)


sudo apt-get install qtnx

Miscellany
NX Server Free Edition
NX Server Free Edition provided by NoMachine is not related to FreeNX. NXSFE has a limit of 2
sessions per server. FreeNX doesn't have this limit.

FreeNX on PowerPC
There are no precompiled binaries of FreeNX on this platform (Launchpad PPA doesn't provide
support), so FreeNX have to be compiled from source. Sources can be found at the FreeNX Team
PPA.

These steps will build FreeNX from source (you need to add the deb-src repository):

1. Create a directory to hold the FreeNX source, and cd into it.


mkdir freenxSource; cd freenxSource
2. Build the freenx packages and install related packages.
3. sudo apt-get build-dep nx freenx

apt-get -b source nx freenx

This will download the source tarballs and build the freenx packages (*.deb) in the current
directory.

4. Install the FreeNX packages.


sudo dpkg -i *.deb
5. If dpkg complains about missing packages, let apt fix it
6. sudo apt-get -f install

sudo dpkg -i *.deb


How to start/stop FreeNX
The FreeNX server is not a service but uses ssh. The following command will stop the FreeNX
program from accepting connections.

sudo /etc/init.d/freenx-server stop

(Replace stop by start for starting it again)

Configuring SSH port


By default, nxserver uses port 22 for communicating over SSH. On some machines or networks, port
22 may be blocked; some Internet providers block port 22, for instance. Port 22 is also a common
target of people trying to crack into a network. To make the SSH server listen on port 8888, you can
do the following:

Edit the file /etc/ssh/sshd_config

gksudo gedit /etc/ssh/sshd_config

Find

Port 22

and change it to

Port 8888

You then need to restart SSHD. Try

/etc/init.d/ssh restart

FreeNX should detect the SSHD port, but otherwise: Edit the file /etc/nxserver/node.conf

gksudo gedit /etc/nxserver/node.conf

Find

# The port number where local 'sshd' is listening.


#SSHD_PORT=22

and change it to:

# The port number where local 'sshd' is listening.


SSHD_PORT=8888
That is, change the port number to the one that sshd is listening to, and uncomment the line.

Using custom SSH keys


After installation, FreeNX will use a set of default ssh keys for authentication. This is a security risk,
especially on any internet-facing machines, and the default keys should be replaced with your own
custom keys.

To change the default keys to your own custom keys - on the machine hosting the freenx-server, run
the command:

sudo dpkg-reconfigure freenx-server

This will launch a dialogue that will guide you through the generation of custom keys. On the first
page hit 'OK' and on the second page select 'Create new custom keys'

a key file called client.id_dsa.key will be created in: /var/lib/nxserver/home/custom_keys/

Now, we need to transfer the key to the client machine so that it can be imported in the FreeNX
client application. First copy the key to your home directory on the server machine:

sudo cp /var/lib/nxserver/home/custom_keys/client.id_dsa.key ~/

Next, copy client.id_dsa.key to your client machine. Ideally you should copy the file securely, for
example by running the following command from the client computer:

scp user@freenx-server:~/client.id_dsa.key ~/

which will securely copy the client.id_dsa.key file from the freenx-server computer to your home
directory on the client.

If your client is a Windows machine, just copy the key with your preferred method.

In the nx client software you can now import this key.

After you have tested that authentication is working using your custom keys you should then remove
the client.id_dsa.key file from your home directories on both the server and client machines.

Using Custom SSH keys on Lucid


Summary: When finished, a custom key should have been created, and you should be able log into
the remote machine with a valid userid id and password that belongs to the server and client.

Objective:

Custom Keys.
User ID and Password.

Authentication method: PASSDB. (PASSDB: Uses an internal user database.)

Adding the PPA repos

deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu lucid main

deb-src http://ppa.launchpad.net/freenx-team/ppa/ubuntu lucid main

You can add them from Menu > System > Administration > Software Sources

Click the Other Software Tab > Click Add and paste each line separately.

From the terminal:

sudo vi /etc/apt/sources.list.d/freenx
i (insert) > paste
esc > :wq

Update sources and install freenx

sudo aptitude update

sudo apt-get install freenx

Check for, and or Download and Install nxsetup

ls -l /usr/lib/nx/nxsetup

Get NXSETUP

Unpack it:

In Nautilus,navigate to where you downloaded nxsetup > right click on the file to get the context
menu, and then select Extract Here

At the terminal:

$tar xvzf nxsetup.tar.gz

Install it:

chmod 755 nxsetup

sudo cp nxsetup /usr/lib/nx/


sudo chown root:root /usr/lib/nx/nxsetup
sudo /usr/lib/nx/nxsetup --install

I told it to Y for custom keys, but it did not happen.

Enabling the PASSDB database

Now, since i opted to use 'PASSDB' as the authentication method, the following also has to be done:

Be sure that the /etc/nxserver/node.conf file contains the following line:

ENABLE_PASSDB_AUTHENTICATION="1"

Adding the User ID and Password to the database:

Add yourself to the nxserver database. Suppose your username is jra:

sudo nxserver --adduser jra


NX> 100 NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
NX> 1000 NXNODE - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
NX> 716 Public key added to: /home/jawara/.ssh/authorized_keys2
NX> 1001 Bye.
NX> 999 Bye

Assign a password for jra:

sudo nxserver --passwd jra


NX> 100 NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
New password:
Password changed.
NX> 999 Bye

Adding SSH permissions for the users.

Add nx and jra user ids to sshd_config:

I did it under the Authentication section.

sudo vi /etc/ssh/sshd_config

i (insert)

AllowUsers nx jra

Save the file.

esc > :wq


Restart the SSH service.

$sudo service sshd restart

* Restarting OpenBSD Secure Shell server


sshd [ OK ]

Generate the custom keys.

sudo /usr/lib/nx/nxkeygen

Backing up existing client key to /var/lib/nxserver/home/.ssh/client.id_dsa.key.20101117-131539


Unique key generated; your users must install

/var/lib/nxserver/home/.ssh/client.id_dsa.key

on their computers.

The key file, client.id_dsa.key, will be in: /var/lib/nxserver/home/.ssh/

Now, we need to securely transfer /var/lib/nxserver/hone/.ssh/client.id_dsa.key to the client machine


so that it can be imported intonxclient.

Now securely transfer the file from the freenx-server, to home directory on your client machine.

scp source destination

sudo scp /var/lib/nxserver/home/.ssh/client.id_dsa.key jra@Ip.Address.Or.Hostname:''

For safety, do delete the ~/client.id_dsa.key from your client machine when finished.

Download and Install the nxclient.

From website: Get NXClient

or in your terminal with wget,

wget http://64.34.161.181/download/3.4.0/Linux/nxclient_3.4.0-7_i386.deb

Install with GDebi from the Nautilus context menu, if installed, or in the terminal with,

sudo dpkg -i nxclient_3.4.0-7_i386.deb

From your menu Open the NX Connection Wizard.

Enter a Session Name,


Enter Hostname (or IP Address),

Enter Port number or keep the default,

Select your Type of connection I chose LAN, and select Next.

Next:

Select the Desktop System you want to use (Gnome or KDE),

Set the Desktop Size (1024x768),

Do not check the disable encryption box if you want SSL encryption.

Select Next when finished.

Next:

Now, choose if you want to Create shortcut on desktop.

Select Show the Advanced Configuration dialog box.

Click Finish.

Importing the custom key file client.id_dsa.key.

In the advanced dialog window under the General Tab, you should see the items you have already
entered, and to the right ofRemember my password there is a Key... button.

Click the Key button, a window will popup initially displaying the Default Key

Now, Click the Import button, navigate to the directory where you saved the client.id_dsa.key file
you copied from the server, and select it to open and import the key. You show now see the custom
keys which should be different from the initial default key.

Click Save > Save > Ok.

You should now be presented with a login prompt, displaying your,

Login: User ID

Password: Blank

Session: session name

Just enter the password you added too the nxserver database, Click Login, the nxclient will make's
the connection, and once there are no errors, you should be on your remote machine.
If your client is a Windows machine, just copy the key with your preferred method.

In the nx client software you can now import this key.

After you have tested that authentication is working using your custom keys you should then remove
the client.id_dsa.key file from your home directories on both the server and client machines.

Troubleshooting
 Problem: Everything is installed as described above, but I still get errors at installing nxsetup
--install
 Solution: Check that this line exists in /etc/ssh/sshd_config "AllowUsers nx" and this line
also exists and is set toauthorized_keys2 "AuthorizedKeysFile %h/.ssh/authorized_keys2",
if commented, just uncomment them. after that run this command in a
terminal sudo /etc/init.d/ssh restart .This issue is due custom SSH server
configuration.
 Problem: At the client, the !M logo window appears, but after a few seconds that window just
closes, even without showing any error message.
 Solution: In the server, access your home directory and run this
command, sudo rm .Xauthority* followed bytouch .Xauthority and
finally chmod 600 .Xauthority . This issue is due custom VNC configuration.
 Problem: What can I do if I get the error 'Could not yet establish the connection to the
remote proxy' ?
 Solution: This commonly happens when the Advanced tab configuration option "Disable
encryption of all traffic" has been selected, but the appropriate firewall ports have not been
opened. Open the necessary firewall ports, or uncheck the option to re-enable encryption
over SSH. NoMachine knowledge base article
 Problem: NX Client connects and displays the desktop but the screen does not refresh.
 Solution: Set Disable Direct Draw for screen rendering in the client's advanced
configuration tab.
 Problem: NX Client authenticates user NX and tries to authenticate normal user but then
fails with:

Permission denied (publickey). NX> 280 Exiting on signal: 15.

 Solution: Set authentication = SU in /etc/nxserver/node.conf. All other authentication


methods set to "0". Automated Solution and workaround credit: this thread

References
 FreeNX on Wikipedia
 FreeNX project page on BerliOS
 FreeNX Team PPA An up-to-date repository from the FreeNX Team, for Ubuntu 8.04
(Hardy), 8.10 (Intrepid) or 9.04 (Jaunty)
 Seveas' Packages FreeNX old repository
 Ubuntu Forums HowTo FreeNx How to remote desktop using SSH and FreeNX - OpenGL
Seveas Repositories
 Ubuntu Forums Install FreeNX in Ubuntu 10.4 Lucid
 From the CentOS Wiki
Related docs
You can also have a look at the article about installing the NX packages provided by NoMachine
company

Desktop integration wanted


For those who want to have freenx supported in krfb, krdc, log into bugs.kde.org, and add a
comment and vote for the following bugs (wishlist) :

 187310 : nxserver support in krfb


 149482 :nx support in krdc (client), it seems that work is already in progress, and there only
a few problems left.

The same should be done on gnome side, for vino and vinagre.

 comment-77547 : vinagre has a plan to support nx


 vino goals/to-do v2 : no mention of nx; only rdp and vnc

NXLaunch is another solution and could possibly be integrated in other Remote Desktop clients.

 msg00330, 2007-Sept : committed source


 msg00404, 2007-Sept : integration

CategoryInternet CategoryNetworking CategoryNetworking CategoryInstallation

FreeNX (last edited 2011-01-05 05:55:32 by Adam Porter)

 Page History

You might also like