Auto-start VNC On Server

By donmc, 13 June, 2008


Mar 24th, 2008 by graham

I wanted to know how to get VNC to auto-start on my server without me having to manually do it on the server with a monitor connected. I went to the Ubuntu forums but found no answer there. After experimenting I discovered it was not complicated after all. It seems I had assumed VNC did not auto-start on the server. It does! But some things needed to be set correctly first.Ubuntu Logo

All the following directions are for Ubuntu (Gnome).

A friend helped me get started. He advised me not to install the server version of Ubuntu as I was going to want to see a Gnome interface like the one I have been using on my main desktop. So I installed the normal Ubuntu desktop, in my case ‘Gutsy’ (7.10).

Step 1. Ensure vnc-common and vncserver are installed on the server by using System> Administration> Synaptic.

Step 2. Go to System> Preferences> Remote Desktop> tick ‘allow others to view your desktop’ and where it says ‘When a user tries to view or control your desktop’ DO NOT TICK THAT BIT as no one will not be there to approve your login. Instead tick ‘require the user to enter this password’ and enter a password you want to use when you login, then click close.

Step 3. Start the server with a monitor connected to allow Ubuntu to set the correct screen resolution. Then go to System> Preferences> Screen Resolution> Tick the box that says ‘make default for this computer’. Don’t forget to then click ‘apply’.

Step 4. Go to System>Administration>Login Window>Security Tab>tick Enable Automatic Login and then select the user (you, not root).

Now try it out. Reboot the machine with a monitor connected. From another computer access the server with VNC. You should now see your Gnome desktop. Well done! BEFORE YOU LOG OUT click the power icon and choose ‘lock screen’. That is it, leave it.

ALWAYS leave the server with the screen locked. An open desktop is a security risk, even though Ubuntu is very secure.

I don’t know if any of this will change much with the new release of Ubuntu but the VNC viewer is changing in Ubuntu 8.04 to Vinagre so viewing will be different.

Ubuntu 8.04 ‘Hardy Heron’ is out now. Windows upgrades every 5 years or so, Ubuntu upgrades every 6 months!

Have fun!

Ubuntu 8.04 coming soon