How to install FreeNX server and client on Ubuntu


  1. Add the FreeNX team repo
      sudo add-apt-repository ppa:freenx-team
  2. Install FreeNX
    sudo apt-get update && sudo apt-get install freenx
  3. Apply Patch
    wget https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz && tar xvf nxsetup.tar.gz && sudo cp nxsetup /usr/lib/nx
  4. Setup NoMachine keys
      sudo /usr/lib/nx/nxsetup --install --setup-nomachine-key
  5. Import public key for server
    sudo cp /usr/NX/etc/keys/node.localhost.id_dsa.pub /tmp/node.localhost.id_pub.save
    sudo /usr/NX/bin/nxnode --keyadd /tmp/node.localhost.id_pub.save
    sudo  nx:root /usr/NX/bin/nxserver --keygen
    sudo chown nx:root /usr/NX/home/nx/.ssh/authorized_keys2
    sudo chmod 0644 /usr/NX/home/nx/.ssh/authorized_keys2
    sudo mv /usr/NX/home/nx/.ssh/authorized_keys2 /usr/NX/home/nx/.ssh/autohriazed_keys --
  6.  Add new user using useradd, then add this username to /etc/ssh/sshd_config under AllowedUsers (multiple usernames can be specified with spaces separating the names)
  7.  check if the user is ableto login to NXServer bu uisng command
    sudo /usr/NX/bin/nxserver --usercheck
  8. Add the following  shell script to /usr/NX/bin/nxwrapper
    #!/bin/bash
    nxnode=${ps -o ppid= -p $PPID}
    nxagent=${pgrep -p $nxnode -u $USER -x nxagent}
    ${1+"$@"}
    exec kill $nxagent
  9.   Import the key in /usr/NX/keys/rsa_id.pub.key on to client. use custom for desktop manager specify path to nxwrapper and specify startfluxbox

Leave a comment