Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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. ( rc.local contents ) ( /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
up vote 2 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: .

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.