I have model b+ and I've installed tightvncserver, and can successfully start the VNC manually, but once I reboot I need to start it again, although I have configured it to start automatically, by following the instructions here word by word.

How can I find the problem?

  • Try adding the start up line -- /bin/su pi -c "/usr/bin/vncserver :1 -geometry 1280×800 -depth 16 -pixelformat rgb565" & -- to the end of /etc/rc.local and see if that works.
    – goldilocks
    Jan 1, 2015 at 16:30
  • Unfortunately didn't work.
    – student1
    Jan 1, 2015 at 16:45
  • What I am thinking is that your line and the script I referenced both have no mention of the vnc server name, which is tightvncserver in my case. How would Raspbian know that?
    – student1
    Jan 1, 2015 at 16:46
  • Actually I don't use vncserver, so I don't know how to invoke it properly; I just copied that line from the script to see if it was something else causing the issue. So you could use whatever line you normally use, but beware it it will be run by root (so don't include sudo). Looking at the man page I don't see how that will matter (it does not have to be started by the user that uses it). Also you must include the full path, /usr/bin/vncserver. If it normally does not background itself, also put a & at the end.
    – goldilocks
    Jan 1, 2015 at 16:52
  • When I first started using a Pi I tried to get tightvncserver to autostart. I have tried most, if not all, of the suggested scripts, with no success. In the end I just gave up, and ssh into the Pi and manually start tightvncserver.
    – Milliways
    Jan 1, 2015 at 22:58

5 Answers 5


You need to start tightvncserver as root, before using it in a startup script. It will ask you to specify a login password and a view-only password. When you've entered those, and rebooted, I bet your vnc server will work.

  • Or perhaps the start-up script does not work because whoever wrote it obviously did not bother to read /etc/init.d/README...
    – goldilocks
    Jan 1, 2015 at 16:26
  • @Werner I started it in the first place as my sudo-enabled user. Is that what you mean? Or do I need to literally switch to 'root' user?
    – student1
    Jan 1, 2015 at 16:40
  • 1
    I do not have my Pi handy, but if you type sudo tightvncserver does it ask you set a password? I had this problem when setting up tightvncserver on my Pi. Jan 1, 2015 at 18:52

Run the shell script from terminal and if there is an error in code, you'll see.. Other method... I don't know. I read on that site that the a visitor said that the script is buggy.

You can also try the script from the official documentation for Raspberry, http://www.raspberrypi.org/documentation/remote-access/vnc/README.md. Hope that they're not identical.

  • 1
    They're not identical. The one you linked looks more likely to work to me because it actually conforms to the Debian Policy described in /etc/init.d/README.
    – goldilocks
    Jan 1, 2015 at 16:34
  • I didn't compare the scripts, I only knew about the existence of it in the official documentation.
    – 23ars
    Jan 1, 2015 at 16:47
  • The only thing that seems odd to me in the rpi.org thing is that $USER and $HOME are exported. The man page doesn't refer to them being necessary, but it won't hurt in any case.
    – goldilocks
    Jan 1, 2015 at 16:56

I'm a bit of a unix neophyte myself and I had a similar problem. I followed the instructions that you're pointing to and it just wouldn't start the vnc server. I finally realised that the error message about 0 being locked (which I assume is effectively 'GUI' 0) was telling me exactly why it wasn't working. As soon as I changed the script in init.d to :1 rather than :0 it worked perfectly. Presumably :0 was already taken by the GUI that was loading automatically, since I wasn't running headless.

Hope that this helps anyone who has fallen into the same trap.(Feel free to tell me I'm wrong, if I'm leading people astray) Michael


Make sure the last entry in /etc/rc.local is edit 0.

If you copied from the source you state make sure that the quotes in the code are proper straight double quotes ("), it looks like WordPress changed them to typographical ones.


The following worked for me, I am using MAC OS.

  1. Open terminal on your MAC

  2. Enter the following line:


It will ask for a password (default at your raspberry pi): raspberry

  1. Now you need to start the VNCSERVER

pi@raspberrypi:~ $ vncserver

  1. Now you can start your VNC Viewer on your MAC.
  • 1
    Hello and welcome! I don't think that this answers the question. The original poster stated that starting the Server manually works just fine. This is what you suggest now. And while this works it might still be inconvenient in some cases to first login via ssh to start the server...
    – Ghanima
    Dec 24, 2015 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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