VNC Server at Startup

Discussion and Technical Support for general software applications and utilities including OS related issues.
Post Reply
Sergeus
Member
Member
Posts: 24
Joined: September 30th, 2011, 12:46 pm

VNC Server at Startup

Post 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
n2o2diver
Member
Member
Posts: 40
Joined: October 18th, 2011, 1:00 am

Re: VNC Server at Startup

Post 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
Sergeus
Member
Member
Posts: 24
Joined: September 30th, 2011, 12:46 pm

Re: VNC Server at Startup

Post 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. :(
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: VNC Server at Startup

Post 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.
Sergeus
Member
Member
Posts: 24
Joined: September 30th, 2011, 12:46 pm

Re: VNC Server at Startup

Post 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
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: VNC Server at Startup

Post 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.
Post Reply