Skip to main content
deleted 7 characters in body
Source Link
Steve Robillard
  • 34.9k
  • 18
  • 104
  • 109

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:

### BEGIN INIT INFO
# 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.
### END INIT INFO

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

USER=pi
HOME=/home/pi

export USER HOME

case "$1" in
 start)
  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"
  ;;

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

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

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?
Thanks.

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:

### BEGIN INIT INFO
# 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.
### END INIT INFO

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

USER=pi
HOME=/home/pi

export USER HOME

case "$1" in
 start)
  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"
  ;;

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

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

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?
Thanks.

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:

### BEGIN INIT INFO
# 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.
### END INIT INFO

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

USER=pi
HOME=/home/pi

export USER HOME

case "$1" in
 start)
  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"
  ;;

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

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

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?

Source Link

VNC server run at boot - authentication problem

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:

### BEGIN INIT INFO
# 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.
### END INIT INFO

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

USER=pi
HOME=/home/pi

export USER HOME

case "$1" in
 start)
  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"
  ;;

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

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

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?
Thanks.