KDMcM
Posts: 11
Joined: Tue Dec 01, 2015 11:07 pm
Location: Redditch, England

Auto-run VNC

Thu Dec 03, 2015 11:06 pm

Similar questions have been posted, but none seems to fit into my category.

I've installed tightVNCserver on my Pi (Raspbian). It works nicely, but I want t to automagically run at startup. I followed this guide (the init.d method). My scripts are good: I've started the server using

Code: Select all

 vncboot start
and stopped it using the stop variant. I think this illustrates that the chmod was also successful.

When I did

Code: Select all

update-rc.d /etc/init.d/vncboot defaults
it complained that it couldn't find /etc/init.d//etc/init.d/vncboot, so I just issued update-rc.d vncboot defaults. It seems to know where to find vncboot, but where I expected it to say using dependency based boot sequencing it said nothing: it just returned me to the prompt. I don't know if that's significant.

If I ls -l /etc/rc?.d/*vnc* I can see that 7 new links have been created.

Can anyone help me figure out why the server doesn't start at boot?

I'm not hell-bent on using tightVNC: it's just what the documentation suggested. I think I might prefer the X11 VNC (?) which I'm told is builtin anyway?

Anything you can offer would be great.

Thanks.


KDMcM
Posts: 11
Joined: Tue Dec 01, 2015 11:07 pm
Location: Redditch, England

Re: Auto-run VNC

Sat Dec 05, 2015 10:32 pm

That's not going to work since tight VNC server is already installed. The packages will conflict. Surely there has to be a way to get VNC server to run at boot time?

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

Re: Auto-run VNC

Sat Dec 05, 2015 10:56 pm

OP, try

Code: Select all

sudo service vncboot start
and see if tightvnc starts.

Also, the instruction in the Raspberry Pi documentation make the assumption that you are not booting into the desktop.

Also, if you are running Raspbian Jessie, consider using these instruction to create a systemd service.

KDMcM
Posts: 11
Joined: Tue Dec 01, 2015 11:07 pm
Location: Redditch, England

Re: Auto-run VNC

Sun Dec 06, 2015 9:46 am

Code: Select all

sudo service vncboot start
returns no message: it simply gives me the prompt back. It did not start vnc server.

Out of curiosity, I also rebooted the Pi to see if it started as a service, but no joy.

I had an inkling that :0 wouldn't work using the raspberrypi.org instructions, so I changed it to :1. Do you suppose that if I tell the Pi not to boot to the desktop, then my installation will work?

How do I know if I'm running Jessie?

I'm very rapidly finding that everything to do with Linux is explained on the net, but that every explaination assumes an understanding of some other aspect. It's a very steep learning curve.

KDMcM
Posts: 11
Joined: Tue Dec 01, 2015 11:07 pm
Location: Redditch, England

Re: Auto-run VNC

Sun Dec 06, 2015 9:59 am

For info, your systemd solution DID work! Thank you!

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

Re: Auto-run VNC

Sun Dec 06, 2015 10:08 am

KDMcM wrote:I had an inkling that :0 wouldn't work using the raspberrypi.org instructions, so I changed it to :1. Do you suppose that if I tell the Pi not to boot to the desktop, then my installation will work?
Yes, although it should work with changing :0 to :1

Also, have a look in the file /var/log/messages e.g.

Code: Select all

grep -i vnc /var/log/messages
To see if there are any error messages regarding the service.
KDMcM wrote:How do I know if I'm running Jessie?
In a terminal run the command

Code: Select all

cat /etc/issue
Raspbian Wheezy

Code: Select all

Raspbian GNU/Linux 7 \n \l
Raspbian Jessie

Code: Select all

Raspbian GNU/Linux 8 \n \l

baxalo
Posts: 5
Joined: Mon Oct 26, 2015 6:46 am

Re: Auto-run VNC

Sun Dec 06, 2015 11:39 am

Code: Select all

cd /home/pi

Code: Select all

cd .config

Code: Select all

mkdir autostart

Code: Select all

cd autostart

Code: Select all

sudo nano tightvnc.desktop
Edit the contents of the file with the following text:
[Desktop Entry]
Type=Application
Name=TightVNC
Exec=vncserver :1
StartupNotify=false

Type ctrl-X and then Y to save the changes to the file

KDMcM
Posts: 11
Joined: Tue Dec 01, 2015 11:07 pm
Location: Redditch, England

Re: Auto-run VNC

Sun Dec 06, 2015 4:47 pm

Bloody Nora, how many ways are there to autostart a program!?!?

Return to “Raspbian”