My Raspberry Pi once upon a time was able to VNC perfectly but then it just stopped. Tightvnc Server works but when i do netstat | grep 5901 the connection doesn't show up. I try using tightvncviewer but nothing shows up neither. However I am able to use the ssh service on my Raspberry Pi. I am using Remmina Remote Desktop Client to try to access it on Ubuntu 12.10.

2 Answers 2


Configure your firewall right and unblock port 5901.


Are you sure that VNC is running? By default VNC does not normally run automatically. So you may have been setting it up and started to run it. Then when your RPi was restarted, VNC was not automatically restarted.

Here is how to configure VNC to run on startup.

Create a file in /etc/init.d with a suitable name such as vncboot with the following content.

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

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


export USER HOME

case "$1" in
   echo "Starting VNC Server"
   #Insert your favoured settings for a VNC session
   /usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565

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

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

exit 0

Modify the file permissions so it can be executed

chmod 755 /etc/init.d/vncboot

Enable dependency based boot sequencing

update-rc.d /etc/init.d/vncboot defaults

If enabling dependency based boot sequencing was successful, it says

update-rc.d: using dependency based boot sequencing

But if it says

update-rc.d: error: unable to read /etc/init.d//etc/init.d/vncboot

then try the following command

update-rc.d vncboot defaults

Reboot your Raspberry PI and you should find a vncserver already started.

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.