The NoMachine sources aren't available anymore, back to FreeNX
Start with the Ubuntu FreeNX instructions.
$ sudo apt-get install freenx-server
$ mkdir ~/src/nxagent
$ cd ~/src/nxagent
$ sudo apt-get build-dep nxagent
$ apt-get source nxagent
$ cd nxagent-*
$ curl -L https://tonyscelfo.com/dl/nx/Keystore.c.patch | patch -p1
$ curl -L https://tonyscelfo.com/dl/nx/Cursor.c.patch | patch -p1
$ dpkg-source --commit . cursor_warp_and_keyboard_binding_change
$ dpkg-buildpackage
$ cd ..
$ sudo dpkg -i nxagent_*.deb