From Mageia wiki
Jump to: navigation, search

Nxclient-icon.png

Introduction

This document describes how to install and configure Nomachine FreeNX version 3.5.0 client and server on Mageia. It has been tested on Mageia versions 1,2, 3 and 4.

"Nomachine" is a collection of software for Linux (and other OS) which provides a "terminal server" using ssh as the client/server connection.

The terminal server function lets you access a "desktop-within-a-window" from your client.

Benefits of this include:

  • Capability to connect and disconnect without stopping the remote desktop thus maintaining state of the remote desktop and your work context.
  • client/server connection uses SSH encrypted network connection

Step 1: Verify ssh server is installed and running

$ rpm -qa | grep -q openssh-server && echo Good news: openssh is installed

Good news: openssh is installed


If ssh-server is not installed, install with:

# /usr/sbin/urpmi openssh-server

Check ssh server is running:

$ /sbin/service sshd status || echo ssh-server not running, start with: service sshd start
sshd is stopped
ssh-server not running, start with: /sbin/service sshd start

# /sbin/service sshd start
Starting sshd:               [  OK  ]

Step 2: Verify firewall allows inbound ssh on port 22/tcp

Normally, Mageia runs shorewall firewall which blocks all inbound connections unless you specify differently.

The following screenshots show how to configure the firewall to allow port 22/tcp inbound.

There are two ways to invoke firewall configuration:

a) from command line:

# /usr/sbin/drakfirewall   # launch Mageia firewall configuration

b) via Mageia Control Center:

From the "Security" tab of Mageia Linux Control Center, click on "Set up your personal firewall":
2012 03 05 Screenshot a 683x384.png


Check the tickbox for SSH:
2012 03 05 Screenshot b 683x384.png

Complete the subsequent screens.

Step 3: Download and install Nomachine rpms

Reference: "NX Free Edition for Linux"

i586 32-bit http://www.nomachine.com/download-package.php?Prod_Id=3775
x86_64 64-bit http://www.nomachine.com/download-package.php?Prod_Id=3772

Run the following commands as root to download and install Nomachine client, node, and server rpms.

# Download and install NoMachine FreeNX version 3.5.0 RPMs - updated 2013_12_20
# (copy & paste, run as root)

d=/usr/local/downloads/nomachine_3.5.0
mkdir -p ${d}  &&  chmod 750 ${d}  &&  cd ${d}

arch=$(echo $(uname -m) | sed -e "s/i./i3/")   # determine architecture: 32 or 64 bit

case ${arch} in
i386 )
    urlbase=ftp://ftp.is.co.za/mirror/pclinuxos.com/pclinuxos/apt/pclinuxos/2010/RPMS.retro/
    ;;
x86_64 )
    urlbase=ftp://ftp.ntua.gr/pub/linux/pclinuxos/pclinuxos/apt/pclinuxos/2011/RPMS.retro/
    ;;
esac

wget -N ${urlbase}/nxclient-3.5.0-7.${arch}.rpm     # d/l client
wget -N ${urlbase}/nxnode-3.5.0-9.${arch}.rpm       # d/l node
wget -N ${urlbase}/nxserver-3.5.0-11.${arch}.rpm    # d/l server

genhdlist2 .                               # generate urpmi index files
/usr/sbin/urpmi.addmedia nomachine ${d}    # add urpmi media source for downloaded nomachine rpms
/usr/sbin/urpmi nxclient nxnode nxserver   # install rpms

# check for and, if needed, create the authorised keys symbolic link

( cd /usr/NX/home/nx/.ssh && 
    if [ ! -f authorized_keys ]; then
        if [ -f authorized_keys2 ]; then
            echo ln -s authorized_keys2 authorized_keys
            ln -s authorized_keys2 authorized_keys
        fi
    else
        echo authorized keys file OK
    fi
)

# end copy & paste

The installation will also automatically start the nxserver.

Step 4: Run Nomachine client

From command line:

$ /usr/NX/bin/nxclient

From Gnome desktop: Applications -> Internet -> NX Client for Linux

2012 03 07 Screenshot c 683x384.png

Remote desktop within desktop. :-)

2012 03 07 Screenshot d 683x384.png

Repeat step 1 (above) on each machine you wish to make a remote desktop connection to.
There is also a Nomachine nxclient for windows so you can access your Linux desktop.

Troubleshooting

authorized_keys

On a recent install of Nomachine, I encountered problems with nx connection failure:

NX> 203 NXSSH running with pid: 11879
NX> 285 Enabling check on switch command
NX> 285 Enabling skip of SSH config files
NX> 285 Setting the preferred NX options
NX> 200 Connected to address: 192.168.1.4 on port: 22
NX> 202 Authenticating user: nx
NX> 208 Using auth method: publickey
NX> 204 Authentication failed.

It seems that nxserver used "authorized_keys2" rather than "authorized_keys". The solution is to create a symbolically linked "authorized_keys":

# cd /usr/NX/home/nx/.ssh
# ln -s authorized_keys2 authorized_keys

RPMs

It seems that the Nomachine FreeNX version 3.5.0 RPMs are no longer available from http://www.nomachine.org.
An alternative source has been found and is detailed here: https://wiki.mageia.org/en/Nomachine_appendix_a

Links

Nomachine http://www.nomachine.com/
NX technology http://en.wikipedia.org/wiki/NX_technology