Running Xtightvnc vncserver automatically on Raspberry Pi

I spent, oh, literally a week figuring this one out.  Solid week bashing the old noggin against solid walls.  But the clouds of haze parted and left a shining path before me, how to get my VNC Server on my R-Pi working automagically on Raspbian Jessie.

Firstly, you should have raspi-config (or its GUI equivalent) set to autologin to the desktop.

Once you’ve installed the server, go ahead and edit LXDE’s autostart routine.

sudo apt-get install tightvncserver
vncpasswd
nano /home/pi/.config/lxsession/LXDE-pi/autostart

add this line at the bottom:

@nohup vncserver :1

If you get a checkered background, you have have to add an extra line at the bottom of your commands.  For example, I also launch pronterface automatically. Don’t forget the @!

Now, safety first, it’s highly recommended to connect to VNC through an SSH tunnel, or leave your Pi on its own network if you’re controlling it like this.  There is an option on the vncserver to only allow connections from localhost, if you care to change it down the line.

Now for logging into your new server, I recommend tightvnc, it’s available free on every platform.

Props to our Pi forebears!

Leave a Reply

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