0

I'm setting up my RPi 2 so I can run VNC from my Mac. I am running Raspbian Jessie Lite, and using this setup

http://www.brooksskybennett.cm/brooksskybennett/wp-content/uploads/2013/05/Setting-up-VNC-on-Raspberry-Pi-for-Mac-access-4DC5.pdf.

Utilizing the last script for the tightvncserver file:

#!bin/bash
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $remotefs $syslog
# Required-Stop: $remotefs $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
# The Username:Group that will run VNC
export USER=”pi”
#${RUNAS}

# The display that VNC will use
DISPLAY=”1"
# Color depth (between 8 and 32)
DEPTH=”16"
# The Desktop geometry to use.
#GEOMETRY=”x”
GEOMETRY=”800×600"
#GEOMETRY=”1440×900"
#GEOMETRY=”1280×1024" 
#GEOMETRY=”1920×1080"
# The name that the VNC Desktop will have.
NAME=”Rasp2_VNC”
OPTIONS=”-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}”
. /lib/lsb/init-functions

case “$1" in
    start)
log_action_begin_msg “Starting vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver ${OPTIONS}”
;;

    stop)
log_action_begin_msg “Stoping vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver -kill :${DISPLAY}”
;;
    restart)
$0 stop
$0 start
;;
esac

exit 0

If I then check

cd /etc/init.d
cat -v tightvncserver

I don't have any carriage returns (^M) in the file

EDIT:

I run the command

sudo /etc/init.d/tightvncserver
sudo: unable to execute /etc/init.d/tightvncserver: No such file or directory 

Any suggestions as to why I would be seeing the error: No such file or directory? I obviously can see it when using

ls

or

sudo nano tightvncserver
Milliways
  • 62,573
  • 32
  • 113
  • 225
Architek1
  • 143
  • 2
  • 8

1 Answers1

1

First you should run tightvncserver manually at the command line and setup the passwords etc. Don't use any fancy scripts.

You should not be messing around with init.d. That is SysV and is obsolete.

If you are running Jessie and want this to run at startup this should be started with a systemd service. See:- https://raspberrypi.stackexchange.com/a/39374/8697

This is the script I use to setup for access from my Mac.

Milliways
  • 62,573
  • 32
  • 113
  • 225