x11vnc as a nxserver replacement

x11vnc screenshot

Now that nomachine's great nxclient is defunct on MacOS X and its new nxplayer is still in beta (and completely nonfunctional on my setup), I needed another solution to connect to my work desktop from home. I tried many things, but then settled for x11vnc. My work desktop is running Ubuntu Precise Pangolin (12.04) and I connect from a MacOS X 10.8 (Mountain Lion). I only had to install x11vnc and openssh-server on my work desktop and add an x11vnc.conf file to /etc/init with the following content:
x11vnc -forever -rfbauth /etc/x11vnc.pass -bg -o /var/log/x11vnc.log -scale 1280x800 -display :0 -auth /var/run/lightdm/root/:0
I have to create the password file:
x11vnc -storepasswd password /etc/x11vnc.pass
Then I just have to get into my work desktop by some means or another. At the moment I jump there via the UNIX computers of the university, because direct ssh access is not possible because of a firewall. So I ssh into the UNIX mainframe and from there I ssh into my work computer. Once I am in, I establish a reverse ssh tunnel to my Macbook Pro at home:
ssh -R 19999:localhost:5900 IP_address_of_homecomputer
On my Macbook at home I had to enable Sharing - Remote login first. Then I just use the inbuilt Screen sharing of the OS "Connect to server" and then I type "vnc://localhost:19999" and voila I can see my work desktop's login screen.

Alternatively I could use my openvpn server that I have installed on my Macbook and use an openvpn client on my work desktop to establish a connection to my Macbook. Then I could directly log in and avoid the hops via the university UNIX machines to set up the reverse ssh tunnel.

Another, although very slow method to access the GUI of my work desktop is X11 forwarding via ssh. All I need is a working ssh connection to the server, X11 forwarding enabled in the ssh server configuration file and an X11 server on the local machine (e.g. XQuarz on MacOSX):
ssh -X username@remote-server.com
xclock &