I followed This tutorial to install and run a VNC server on my Pi using tightvnc.
Everything works great when I start the server through SSH but I wanted it to start at boot.
So I wrote the script to make that happen and updated the boot sequence to make sure the script actually runs.
Here is the script:

# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.

#! /bin/sh
# /etc/init.d/vncboot


export USER HOME

case "$1" in
  echo "Starting VNC Server"
  #Insert your favoured settings for a VNC session
  su - pi -c "/usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565"

  echo "Stopping VNC Server"
  /usr/bin/vncserver -kill :0

  echo "Usage: /etc/init.d/vncboot {start|stop}"
  exit 1

exit 0

The script runs and when trying to connect with Remmina on my laptop it actually recognize the vnc server and tries to authenticate.
The problem is, the script does not specify a password or anything, so Remmina can't connect and keeps asking me for a password that I can't provide.
Is there a solution to set the VNC server password at its creation when the RPi boots?

  • Might be a good idea to post this to the RPF forums at raspberrypi.org as it's their tutorial.
    – recantha
    Sep 2, 2015 at 15:30

1 Answer 1


Run the vncpasswd utilty.

Normally you should be prompted to enter the password the first time you run vncserver.

Try man vncpasswd for more detail.

  • What you suggest works great when I start the server through SSH. However, this is intended to auto-start at boot, when there is no keyboard or display connected to the RPi. I'm not sure I understand how this would work here, I'll look into vncpasswd tonight.
    – momoparigo
    Sep 2, 2015 at 17:32
  • Aight, I just lauched the utility under SSH and defined the password. works great now.
    – momoparigo
    Sep 2, 2015 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.