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

Fix for "Cannot shutdown using power button" on Ubuntu


After my recent upgrade to ubuntu, pressing the power button to shut down stopped working. I had to remap the script mapped to the power button by

  1. Editing  /etc/acpi/events/powerbtn using the command
       sudo gedit  /etc/acpi/events/powerbtn
  2. Commenting line shown below by adding a # to the beginning  of the line
       action=/etc/acpi/powerbtn.sh
  3. adding a new line
       action=/sbin/poweroff
  4. Saved and exited Gedit. Tested to make sure the functionality is restored by pressing the  power button to shut down