FreeNX on Mandrake 10.1

FreeNX is an open source alternative to NoMachine’s NX Server. This means super speedy remote desktop access over SSH; I was streaming audio, surfing the web, chatting, checking email at home and doing the same via the nxclient on my work machine without any noticeable lag on the remote box.

There were however some hoops to jump through, so I chronicle them here.

Server: (aka work/remote machine)

To make things a bit easier you will want to add these install media.

urpmi.addmedia mirrors.usc.edu_devel_contrib-i586 rsync://mirrors.usc.edu/mandrakelinux/devel/cooker/i586/media/contrib/

urpmi.addmedia mirrors.usc.edu_devel_contrib-x86_64 rsync://mirrors.usc.edu/mandrakelinux/devel/cooker/x86_64/media/contrib/

By the way; rsync media seems to be less popular, and less likely to be flooded with a bunch of people, than FTP media.

Next install freenx via urpmi:

urpmi freenx

Along with the freenx package this will also install its dependencies; nxagent, libnxX11_0, and nxproxy.

Then do the following:

chmod 640 /var/lib/nxserver/nxhome/.ssh/client.id_dsa.key

Rename the following to stay more in line with standards:

mv /var/lib/nxserver/nxhome/.ssh/authorized_keys2 /var/lib/nxserver/nxhome/.ssh/authorized_keys

cat ~augie/.ssh/authorized_keys2 >> ~augie/.ssh/authorized_keys .

Add the user(s):

nxserver –adduser augie
nxserver –passwd augie

I keep sshd pretty tight, so this may or may not be needed for you.

Add ListenAddress 127.0.0.1 to /etc/ssh/sshd_config if need be.

Client: (aka home)

urpmi nxclient

Copy /var/lib/nxserver/nxhome/.ssh/client.id_dsa.key from server to /usr/NX/share/client.id_dsa.key on the client

chmod 644 /usr/NX/share/client.id_dsa.key

Run nxclient –wizard as root.
Copy /root/.nx to ~augie/ .
chown -R augie:augie ~augie/.nx/
Edit ~augie/.nx/nxclient.conf

This entry was posted in General, work and tagged , , , . Bookmark the permalink.

8 Responses to FreeNX on Mandrake 10.1

  1. Carrick says:

    Hello, this is the best guide yet but im a bit stuck i have followed the instrutions to the letter but i keep getting the following:
    o/s std install of mandrake 10.1

    [root@192 /]# nxserver -adduser carrick
    NX> 100 NXSERVER – Version 1.4.0-03 OS (GPL)
    NX> 500 Error: Function -adduser not implemented yet.
    NX> 999 Bye

    i have a user in my home dir called NX and the user carrick already exits. i had to create the .ssh directory myself. it appears no key was generated during install. ive googled the error and the only return suggested i touch /etc/nxserver/passwords but when i checked the directory this file already exists (it is empty though)

    The only problem i had during install was the tcl package was not properly installed so in removed the nxclient and urpmi tcl and it install and then i repeated urpmi nx client and it all installed without trouble.

    your help would be much apprechiated.
    complete install list as follows:

    Regards Carrick.
    PS sorry for posting size

    rpm
    installing /var/cache/urpmi/rpms/xorg-x11-75dpi-fonts-6.7.0-4.2.101mdk.i586.rpm /var/cache/urpmi/rpms/x
    org-x11-Xvfb-6.7.0-4.2.101mdk.i586.rpm /var/cache/urpmi/rpms/X11R6-contrib-6.7.0-4.2.101mdk.i586.rpm /v
    ar/cache/urpmi/rpms/libxcomp1-1.4.0-3mdk.i586.rpm /var/cache/urpmi/rpms/nxproxy-1.4.0-3mdk.i586.rpm /va
    r/cache/urpmi/rpms/xorg-x11-xfs-6.7.0-4.2.101mdk.i586.rpm /var/cache/urpmi/rpms/xorg-x11-server-6.7.0-4
    .2.101mdk.i586.rpm /var/cache/urpmi/rpms/xorg-x11-6.7.0-4.2.101mdk.i586.rpm /var/cache/urpmi/rpms/libnx
    X11_0-1.4.0-3mdk.i586.rpm /var/cache/urpmi/rpms/libxorg-x11-6.7.0-4.2.101mdk.i586.rpm /var/cache/urpmi/
    rpms/freenx-0.3.1-2mdk.noarch.rpm /mnt/cdrom/media/main/nc-1.10-18mdk.i586.rpm /var/cache/urpmi/rpms/li
    bxcompext1-1.4.0-3mdk.i586.rpm /var/cache/urpmi/rpms/nxagent-1.4.0-3mdk.i586.rpm /var/cache/urpmi/rpms/
    xorg-x11-100dpi-fonts-6.7.0-4.2.101mdk.i586.rpm
    Preparing… ##################################################
    1:libxorg-x11 ##################################################
    2:xorg-x11 ##################################################
    3:libxcomp1 ##################################################
    4:libxcompext1 ##################################################
    5:xorg-x11-xfs ##################################################
    6:libnxX11_0 ##################################################
    7:nxagent ##################################################
    8:X11R6-contrib ##################################################
    9:nc ##################################################
    10:nxproxy ##################################################
    11:xorg-x11-75dpi-fonts ##################################################
    12:xorg-x11-Xvfb ##################################################
    13:xorg-x11-server ##################################################
    14:freenx ##################################################
    Tcl_Init failed: Can’t find a usable init.tcl in the following directories:
    /usr/lib/tcl8.4 /usr/lib/tcl8.4 /lib/tcl8.4 /usr/library /library /tcl8.4.5/library /usr/lib/tcl8.4

    This probably means that Tcl wasn’t installed properly.

    passwd: Authentication token manipulation error
    error: %post(freenx-0.3.1-2mdk) scriptlet failed, exit status 1
    15:xorg-x11-100dpi-fonts ##################################################
    ———————————————————————-
    More information on package freenx-0.3.1-2mdk.noarch
    After installing this package, an nx user is created ( this is a
    system user, do not try to log in with it ), with a home located
    at /var/lib/nxserver/nxhome His password is a random
    32char pass.

    Your user must install the key located at:
    /var/lib/nxserver/nxhome/.ssh/client.id_dsa.key
    to log in.

    For knx, put it in: /usr/share/knx/ with world-readable right.
    For nomachine.com Nx client for windows put it in : C:\Program
    Files\NX Client for Windows\share

    You user will now be able to log in using their username
    and password provided you have ssh logins enabled for them

    ———————————————————————-

    [root@192 /]# urpmi tcl
    Please insert the medium named “cd2″ on device [/dev/hdc]
    Press Enter when ready…

    installing /mnt/cdrom/media/main2/tcl-8.4.5-6mdk.i586.rpm
    Preparing… ##################################################
    1:tcl ##################################################
    [root@192 /]# urpmi freenx
    Mutex destroy failure: Device or resource busy
    Everything already installed
    [root@192 /]# ICE default IO error handler doing an exit(), pid = 7175, errno = 0

    [root@192 /]# urpmi freenx

    rsync://mirrors.usc.edu/mandrakelinux/devel/cooker/i586/media/contrib/freenx-0.3.1-2mdk.noarch.rpm
    installing /var/cache/urpmi/rpms/freenx-0.3.1-2mdk.noarch.rpm
    Preparing… ##################################################
    1:freenx ##################################################
    ———————————————————————-
    More information on package freenx-0.3.1-2mdk.noarch
    After installing this package, an nx user is created ( this is a
    system user, do not try to log in with it ), with a home located
    at /var/lib/nxserver/nxhome His password is a random
    32char pass.

    Your user must install the key located at:
    /var/lib/nxserver/nxhome/.ssh/client.id_dsa.key
    to log in.

    For knx, put it in: /usr/share/knx/ with world-readable right.
    For nomachine.com Nx client for windows put it in : C:\Program
    Files\NX Client for Windows\share

    You user will now be able to log in using their username
    and password provided you have ssh logins enabled for them

    ———————————————————————-
    [root@192 /]# chmod 640 /var/lib/nxserver/nxhome/.ssh/client.id_dsa.key
    [root@192 /]# mv /var/lib/nxserver/nxhome/.ssh/authorized_keys2 /var/lib/nxserver/nxhome/.ssh/authorized_keys
    mv: overwrite `/var/lib/nxserver/nxhome/.ssh/authorized_keys’? y
    [root@192 /]# cat ~carrick/.ssh/authorized_keys2 >> ~carrick/.ssh/authorized_keys
    cat: /home/carrick/.ssh/authorized_keys2: No such file or directory
    [root@192 /]# cd ‘/home’
    [root@192 home]# cd ‘/home/carrick’
    [root@192 carrick]# cd ‘/home/carrick/.ssh’
    [root@192 .ssh]# cd ‘/home/carrick/.ssh’
    [root@192 .ssh]# cd ‘/home/carrick/’
    [root@192 carrick]# cd ‘/home/’
    [root@192 home]# cd ‘/’
    [root@192 /]# cd ‘/home’
    [root@192 home]# cd ‘/home/carrick’
    [root@192 carrick]# cd ‘/home/carrick/.ssh’
    [root@192 .ssh]# cd ‘/home/carrick/’
    [root@192 carrick]# cd ‘/home/’
    [root@192 home]# cd ‘/’
    [root@192 /]# nxserver -adduser carrick
    NX> 100 NXSERVER – Version 1.4.0-03 OS (GPL)
    NX> 500 Error: Function -adduser not implemented yet.
    NX> 999 Bye
    [root@192 /]# sudo nxserver –passwd xxxxxx
    NX> 100 NXSERVER – Version 1.4.0-03 OS (GPL)
    NX> 500 Error: User xxxxxx not found in database.
    NX> 999 Bye
    [root@192 /]# sudo nxserver –passwd xxxxxx
    NX> 100 NXSERVER – Version 1.4.0-03 OS (GPL)
    NX> 500 Error: User xxxxxx not found in database.
    NX> 999 Bye

    [root@192 /]# sudo nxserver –passwd carrick
    NX> 100 NXSERVER – Version 1.4.0-03 OS (GPL)
    NX> 500 Error: User carrick not found in database.
    NX> 999 Bye
    [root@192 /]# sudo nxserver –passwd root
    NX> 100 NXSERVER – Version 1.4.0-03 OS (GPL)
    NX> 500 Error: User root not found in database.
    NX> 999 Bye

  2. augie says:

    Carrick,

    I recommend asking this question on the IRC channels ##mandrake or the newer ##mandriva on irc.freenode.org as my blog is not meant to be a support forum.

    Thank you.

  3. N Clements says:

    The problem that Carrick saw is based on the arguments being passed in. It should be two hyphens before the argument. The text shows one.

    Example: nxserver -–adduser augie

    The way to see it is to type nxserver –help.

    Other than that, nice guide.

  4. augie says:

    Ah, good catch; for some reason WordPress turned by double dashes into single dashes. Thanks.

  5. Alex Chejlyk says:

    Beautifully done!
    This is the best how-to I’ve seen for FreeNX.

    Excellent work,

    Thank you

    Cheers

  6. jpatelle says:

    hello

    I installed freenx successfully and copy the key /var/lib/nxserver/nxhome/.ssh/client.id_dsa.key to the client running MS XP
    I have installed nomachine client for XP and copy the key into share.
    when I login I received an TimeOut message et when look at the details I see
    enter paraphase. I have installed the freenx from the mandrake package and I run LE2005 the status from the nxserver is on

    4 [main] nxssh 2248 tty_list::allocate_tty: No tty allocated
    NX> 203 NXSSH running with pid: 2248
    NX> 285 Enabling skip of SSH config files
    NX> 200 Connected to address: 192.168.0.1 on port: 22
    NX> 202 Authenticating user: nx
    ###############################################################
    Bonjour et bienvenue sur le serveur
    Identifiez-vous !!!!!
    ###############################################################
    NX> 208 Using auth method: publickey
    NX> 205 Enter passphrase for key ‘C:\PROGRA~1\NXCLIE~1/share/client.id_dsa.key’:

    has everybody some idees ? what it can bin

    thank’s

  7. Seb Wills says:

    For what it’s worth, I was getting “205 Enter passphrase for key …” from my nxclient on linux. The problem, it turned out, was that the key (client.id_dsa.key) was not readable by my user, only by root. Perhaps there could be a similar permissions problem with your XP client, i.e. the read access permissions on client.id_dsa.key are too restrictive?

  8. Steven says:

    Does anybody know if you can use freenx without PAM?
    I am running a version of Slackware and I guess PAM is not included.

    Thanks
    Steve

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>