Friday, August 10, 2012

Connect Remotely to Your Linux Machine Graphically

SkyHi @ Friday, August 10, 2012

Free NX is a client/server application which allows you to login remotely from another PC into your Linux system. The client is available for both Linux and Windows, so you will be able to login from a Windows machine too.
NX client connected to a Debian KDE3 session, 1024x768

In order to set up Free NX, you only need to install three DEB packages, start a SSH server and you're ready to go. In Debian Lenny and Ubuntu, just follow the steps below:

First of all, install the SSH (secure shell) server:

apt-get install openssh-server

SSH listens by default on port 22. You can test your SSH server by trying to login to localhost:

ssh your_username@localhost

And use your user's password. If the login is successful, you can proceed to the next step. In order to logout, just type Ctrl+D.

Next, download the Free NX DEB packages from the NoMachine website, here. The files which you need to download are called:

nxclient_3.3.0-6_i386.deb
nxnode_3.3.0-17_i386.deb
nxserver_3.3.0-22_i386.deb

Next, you will need to install all three of them, so type as root:

dpkg -i nxclient_3.3.0-6_i386.deb
dpkg -i nxnode_3.3.0-17_i386.deb
dpkg -i nxserver_3.3.0-22_i386.deb

What you need to do next is to start the NX server (if it isn't already started). To do that, type as root:

/etc/init.d/nxserver start

The output should be something like this:

# /etc/init.d/nxserver start
NX> 122 Service started.
NX> 999 Bye.
NX> 723 Cannot start NX statistics:
NX> 709 NX statistics are disabled for this server.
NX> 999 Bye.

Now, in order to test if what we've done is working, try to connect using the NX client to your own machine, so run as normal user:

/usr/NX/bin/nxclient

Notice that the path to nxclient is non-standard, so nxclient will not be included in your path; you have to use the full path to it. See the screenshots below of NX client in action:

Enter your username and password from your Linux machine

Configure NX client - I used localhost host here, but from another machine you'll have to enter the IP of the remote machine

An alternative NX client is qtnx (apt-get install qtnx) but I had some stability issues with it when trying to connect to a machine which doesn't has NX server configured.

QtNX, another NX client

The good thing about Free NX is that clients are provided for both Linux and Windows, so you will be able to login into your Linux machine from Windows without any problems.

REFERENCES
http://tuxarena.blogspot.ca/2009/04/connect-remotely-to-your-linux-machine.html