Getting TightVNCserver started on boot

      No Comments on Getting TightVNCserver started on boot

Getting TightVNCserver started on boot using a RaspberryPi can get some trouble some. So i aggregated the information from various forum posts to in order to make it work correctly.

Refresh the installation of TightVNCserver

sudo apt-get purge –auto-remove tightvncserver

Create a TightVNCserver boot script

sudo nano /etc/init.d/vncboot

Content of the ‘/etc/init.d/vncboot’ file;


#!/bin/sh
# /etc/init.d/vncboot
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts VNC
# Description:
### END INIT INFO

export USER=’pi’

eval cd ~$USER

# Check state
case “$1” in
start)
su $USER -c ‘/usr/bin/vncserver :1 -geometry 1280×720 -depth 24’
echo “Starting vncserver for $USER”
;;
stop)
pkill Xtightvnc
echo “vncserver stopped”
;;
*)
echo “Usage: /etc/init.d/vncboot {start|stop}”
exit 1
;;
esac

exit 0


Refresh the /etc/rc#.d directories with the correct K01vncboot files

sudo update-rc.d -f vncboot remove
sudo update-rc.d vncboot defaults

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.