Page 1 of 1

VNC Server at Startup

Posted: October 21st, 2011, 2:14 am
by Sergeus
Greetings all,

I've just finished building my media server yesterday, so today I've been working on the software side. It all started well, but I can't seem to get VNC to load at startup. I followed the 'Administer Remotely' page to the letter, as far as I can tell. My /var/log/boot.log reports this:

Code: Select all

JOB RUN AT Fri Oct 21 01:33:03 BST 2011
============================

vncserver: The HOME environment variable is not set.


So VNC is starting at the wrong time. (too early?) It works fine if I just type the VNC command into putty.

Also, I'm running Ubuntu Server 11.04, so it is different from the version used on the site, that might mean I'll have to do it differently.

Any help would be much appreciated. :D

Re: VNC Server at Startup

Posted: October 21st, 2011, 6:33 am
by n2o2diver
I had to do it the way described on this page under "create a Cronjob to run a script"
http://www.havetheknowhow.com/Configure ... -boot.html

Re: VNC Server at Startup

Posted: October 22nd, 2011, 2:21 pm
by Sergeus
I've just set it up for the cron jobs stuff through webmin, but that doesn't start VNC at boot either. =/ Webmin and Putty work fine after boot, but I can still only start VNC manually. :(

Re: VNC Server at Startup

Posted: October 23rd, 2011, 1:57 pm
by Ian
Hi,

I've not seen this issue so cannot say whether it is a bug in Ubuntu or whether it's something you've done somehow.

Try adding a "sleep 5" at the top of the script you're using to start VNC. Add it directly below the "#!/bin/sh" line.

Then reboot your server. Does VNC now start without issue?

Ian.

Re: VNC Server at Startup

Posted: October 23rd, 2011, 4:25 pm
by Sergeus
Awesome, thanks, Ian! I actually saw you recommend that in a different thread after I posted on here, but I forgot to update this topic. After I fixed a different error at boot, VNC started working with a sleep 10. :D

Re: VNC Server at Startup

Posted: October 23rd, 2011, 10:26 pm
by Ian
It's amazing how a little sleep can make all the difference! :lol:

A while back the Ubuntu guys speeded up the boot time. As a result some things which are meant to have started by a certain time are not. Obviously in your case the setting of the HOME environment variable is one of them.

I know it's a total hack adding a sleep but I find it easier than trying to work out what's going on. :thumbup:

Ian.