Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using /etc/rc.local and here is the current contents:

Okay, for some reason the formatting here isn't making a codeblock and instead is making everything bold and 3x the size. Those who are able, please feel free to edit the post and change this - however for now I'll have to use pastebin links.

http://pastebin.com/8x5L8iGz ( rc.local contents )

http://pastebin.com/6rVRMkic ( /root/VPSInfinity/vncboot file )

If I run /root/VPSInfinity/vncboot by itself, everything works fine. If I reboot, /root/VPSInfinity/vncboot runs as the myfile.txt has a log written to it - but the vncserver command is not run.

I never get a log from rc.local to myfile.txt

Any help would be appreciated, I've spent far too much time on this already and read everything Google has thrown at me.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Here's why--vncserver exits with the following error:

vncserver: The HOME environment variable is not set.

This is because /usr/bin/vncserver is in fact a script which requires the home directory to be set (i.e. the user to have logged in), and will die (exit) because of this line of code:

745: die "$prog: The HOME environment variable is not set.\n";

To run vncserver on startup, before login, please follow the instructions in this answer: http://askubuntu.com/a/118645/58612 .

share|improve this answer
Ah, that makes sense! Thank you so much! –  TJ Biddle May 20 '12 at 5:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.