1

Since upgrading to the latest version of Raspbian, I've been having some problems with using it through TightVNC.

I set up tightvncserver using the instructions in the official Raspberry Pi documentation, including the part that adds an init.d module to automatically start a VNC server at boot.

Whenever I shutdown or reboot from the GUI (not the command line), or insert or eject a USB flash drive, I am asked for a username and password. This did not happen before upgrading Raspbian. I noticed that the release notes for the latest version say "Removed sudo from shutdown options", which seems like it might be related.

I did some testing with a fresh SD card image, which showed that this problem does not occur when using the Pi directly (through HDMI, not remotely). It also doesn't occur without the init.d module that automatically starts VNC at boot, so if I start the VNC server manually, the Pi acts normally.

This leads me to think that the problem has something to do with the vncboot Bash script mentioned in the RPi docs:

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

### 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

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 - $USER -c "/usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565"
  ;;

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

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

exit 0

The problem only occurs when the VNC server is started by this script, but not otherwise. Is there anything in this script that looks like it might be the cause of the problem?

tjohnson
  • 408
  • 2
  • 12
  • 1
    I wasn't able to figure out a solution with TightVNC, but since upgrading to PIXEL I'm using RealVNC which is built-in instead, and it doesn't have this problem. – tjohnson Nov 12 '16 at 00:11

1 Answers1

0

I don't know why the Foundation hasn't updated its documentation for systemd (although the old instructions should work - because sysV attempts to convert old scripts to services).

See the following https://raspberrypi.stackexchange.com/a/40896/8697

I use this without any problems on my Pi. NOTE It is important to run manually at least once and set password).

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • I replaced the init.d module with a systemd one, as explained in the link you mentioned, but I'm still experiencing this problem. It only has happened since the Raspbian update a few weeks ago. – tjohnson Jun 15 '16 at 03:40