deavmi
Posts: 6
Joined: Thu Jan 09, 2014 4:14 pm

TightVNC startup on boot not working

Thu Jan 09, 2014 4:21 pm

Hello, I have recetly been having problems gettoing a tightvnc server to start on boot using this page over here (http://elinux.org/RPi_VNC_Server) . I have created the file in /etc/init.d , then chmodded it. Then I tried the first command "update-rc.d /etc/init.d/vncboot defaults" which didn't work so I tried the other alternative one, "update-rc.d vncboot defaults" then it printed this out,

"update-rc.d: using dependency based boot sequencing
insserv: warning: script 'mathkernel' missing LSB tags and overrides" and I rebooted my Pi and tried connecting to it via VNCViewer and it gave me an error, I think it said connection refused so obviously the server didn't start.

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: TightVNC startup on boot not working

Thu Jan 09, 2014 8:29 pm

deavmi wrote:insserv: warning: script 'mathkernel' missing LSB tags and overrides"
This is a warning to do with the Mathematica init.d entry. It is just a warning that the file is missing the LSB header. It won't have anything to do with TightVNC not running.

deavmi
Posts: 6
Joined: Thu Jan 09, 2014 4:14 pm

Re: TightVNC startup on boot not working

Fri Jan 10, 2014 9:06 am

But for some reason I think the VNC server never starts on boot. On their page it has the word "root" should I replace that with my user name, that being"pi"

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: TightVNC startup on boot not working

Fri Jan 10, 2014 9:11 am

Further down that page it talks about Getting VNC Server to Work on a Specific User

deavmi
Posts: 6
Joined: Thu Jan 09, 2014 4:14 pm

Re: TightVNC startup on boot not working

Fri Jan 10, 2014 10:40 am

I think I might have found the error. The vncboot file was saved as vncboot.save and not just vncboot - UPDATE: Sorry about this post, i by mistake was on a different machine lookign at a different script file.
Last edited by deavmi on Sat Jan 11, 2014 7:34 pm, edited 1 time in total.

deavmi
Posts: 6
Joined: Thu Jan 09, 2014 4:14 pm

Re: TightVNC startup on boot not working

Fri Jan 10, 2014 10:43 am

Okay I think it's still not working. I will check out the link you have posted. :D :D :D

alanwbaker
Posts: 9
Joined: Sat Jan 11, 2014 6:38 am

Re: TightVNC startup on boot not working

Sat Jan 11, 2014 7:00 am

I'm experiencing the same issue as deavmi. I ran the same two update-rc.d commands he mentioned with the same results.

vncserver did not start at boot time, so I put a couple of echo statements in the vncboot script and found that it is just not being executed then. But once the Pi is up and running, I can run sudo /etc/init.d/vncboot and the server works perfectly. I'm fine with running it as root.

Can you give me clue?

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: TightVNC startup on boot not working

Sat Jan 11, 2014 12:02 pm

What's in the LSB header. You need to be sure the network is active before trying to start VNC.
# Required-Start: networking

Try sudo update-rc.d vncserver 99 to get it to run later in the boot process.

What options are you setting:
OPTIONS=" -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"

The $DISPLAY variable after the colon defines which virtual display you're using and by implication which port
:1 == 5901, :2 == 5902 etc.

Have you got it writing a log file?
Has everything been chmod'ed with chmod +x?
/etc/init.d/scripts always run with root.root as owner & group (unless you do something special) so anything like password files will be assumed to be in the /root directory.

NOTE: it's a massive security hole to run VNC as root.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

alanwbaker
Posts: 9
Joined: Sat Jan 11, 2014 6:38 am

Re: TightVNC startup on boot not working

Sun Jan 12, 2014 3:01 am

Thanks for your reply, Dougie. I'm using the init.d script from http://elinux.org/RPi_VNC_Server#Run_at_boot. As you suggested I ran

Code: Select all

sudo update-rc.d vncboot start 99 2 3 4 5 . stop 19 0 1 6 .
which returned
update-rc.d: using dependency based boot sequencing
insserv: warning: current start runlevel(s) (3 4 5) of script `vncboot' overrides LSB defaults (2 3 4 5).
insserv: warning: script 'mathkernel' missing LSB tags and overrides
Once the pi is up I can run

Code: Select all

sudo /etc/init.d/vncboot start
from the command line and it works fine with a solid connection and proper logging. I changed the geometry to

Code: Select all

/usr/bin/vncserver :0 -geometry 800x600 -depth 24
which works fine on the client monitor.

Adding networking to its Required-Start was a good idea but it didn't help my case. To confirm that the script is not executed at boot time I added the following line to the script:

Code: Select all

echo In /etc/init.d/vncboot >>/tmp/vncboot.log
And indeed it is not being executed at boot time, so something in the LSB environment is still hosed.

Thanks in advance for any further ideas.

alanwbaker
Posts: 9
Joined: Sat Jan 11, 2014 6:38 am

Re: TightVNC startup on boot not working

Mon Jan 13, 2014 4:18 am

I did not find out why /etc/init.d/vncboot would not run at boot time, but here's a workaround. To start it at boot time add the following line to /etc/rc.local:
sudo service vncboot start

Return to “Troubleshooting”