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


Utilizing the last script for the tightvncserver file:

# 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
# The Username:Group that will run VNC
export USER=”pi”

# The display that VNC will use
# Color depth (between 8 and 32)
# The Desktop geometry to use.
# The name that the VNC Desktop will have.
OPTIONS=”-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}”
. /lib/lsb/init-functions

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

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

exit 0

If I then check

cd /etc/init.d
cat -v tightvncserver

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


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



sudo nano tightvncserver
  • Are you saying you are only getting the error when running it without sudo? Jan 11, 2016 at 0:07
  • sudo /etc/init.d/tightvncserver start Apologies as I didn't make it clear. My fault on that. I'm running the above command.
    – Architek1
    Jan 11, 2016 at 0:15
  • you didn't what? Jan 11, 2016 at 0:16
  • what is the output of ls -la /etc/init.d Jan 11, 2016 at 0:26
  • @SteveRobillard I edited the question as it should've been. Sorry about that.
    – Architek1
    Jan 11, 2016 at 0:26

1 Answer 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.

  • Thanks for this. I followed the original thread and although I get no errors. Nothing happens. I thought I'd get a screen after the sudo systemctl daemon-reload && sudo systemctl enable [email protected]? Also am I suppose to have anything in /.vnc/xstartup file?
    – Architek1
    Jan 11, 2016 at 2:36
  • @Architek1 I assume you mean /home/pi/.vnc/xstartup AFAIK this should be created. I changed one line xsetroot -solid grey -cursor_name left_ptr
    – Milliways
    Jan 11, 2016 at 3:03
  • I do as I did a sudo nano /.vnc/xstartup and the file was empty. Somehow I get the feeling that this shouldn't be the case...
    – Architek1
    Jan 11, 2016 at 15:42
  • open vnc://IP ADDRESS :5901 on my mac command line is what I was missing.
    – Architek1
    Jan 12, 2016 at 0:26

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.