Pages

Saturday, November 5, 2011

Configure X11VNC in Ubuntu 11.10 a.k.a Oneiric Ocelot

As you should know the new Ubuntu version is out almost one month already but I just got time to play with it. The upgrade process as usual was easy. It took some hours but it was smooth. The first thing I did was to remove Ubuntu Unity. I might write an entire post about it but right now I am just going to say that I hate it!

Looking for another options to access my server remotely I found that X11VNC was my best option. The best thing about it is its great options it has for command line control and the best thing is that even if there is no user log in into the terminal you can still start the server, this was a huge limitation about Vino-VNC (the default VNC server Ubuntu ships). First a user has to log in so the server could start, there was no way to start it from command line or ssh. It demands to have a monitor attached.

Anyways after the usual "sudo-apt install X1vnc" to install the required x11vnc packages these are the commands you need to run in order to make it work:

if there is user a user already logged in:

x11vnc -display :0

if nobody is logged in:

sudo x11vnc -auth /var/run/lightdm/root/:0 - display :0

If you notice, you will need to run it as super user since that path needs super user privileges.

The -auth parameter needs the path to the display manger if no one is logged into, but there is a greeter login program like gdm ( Ubuntu ), kdm ( Kubuntu ), xdm ( Xubuntu) , etc running so it might vary on different platforms. You can try 2 things:

This will try to guess the path

x11vnc -auth guess -display :0

Sometimes executing:

ps wwwaux | grep auth

can show you the path to that file, in my case it did.

This tool has tons of options but one I really found useful is the geometry option, which lets scale the screen to fit your needs or if you are connecting from slow internet bandwidth :

4 comments:

Thank-you, sir! You provide a clear and concise summary of the basic options to get x11vnc up and running. Anything X-related always has strange options. Thanks for providing the method to identify your respective display manager as well. Posts like yours keep Ubuntu on my desktop. thnx!