Information on how to setup the RPI and control it via SSH, please refer - http://blog.darshshah.org/2013/01/ssh-into-your-new-raspberry-pi.html
The advantage to install VNC on RPI is that we don't require another display/keyboard/mouse for controlling RPI. We can just connect the RPI to laptop via Ethernet cable/Wifi and quickly start using it. We need to install the server on RPI via SSH and client on the laptop.
To install VNC server on RPI, SSH into RPI using the above link. Install tightvncserver by writing the below commands on the pi's terminal:
$ sudo apt-get install tightvncserver
$ tightvncserver :1
The tightvncserver :1 will start the VNC server.
To start VNC server on bootup - so that you don't need to follow the above procedure everytime you power-on the RPI, we need to set the tightserver init file from penguintutor site.
$ tightvncserver :1
The tightvncserver :1 will start the VNC server.
To start VNC server on bootup - so that you don't need to follow the above procedure everytime you power-on the RPI, we need to set the tightserver init file from penguintutor site.
Do these following steps:
$ wget http://www.penguintutor.com/otherfiles/tightvncserver-init.txt
$ mv tightvncserver-init.txt /etc/init.d/tightvncserver
$ sudo chown root:root /etc/init.d/tightvncserver
$ sudo chmod 750 /etc/init.d/tightvncserver
$ sudo update-rc.d /etc/init.d/tightvncserver defaults
if the above command throws up an error, run
$ sudo update-rc.d tightvncserver defaults
$reboot
Modify the tightvncserver file to have the following content -
#!/bin/sh
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop tightvncserver
### END INIT INFO
# More details see:
# http://www.penguintutor.com/linux/tightvnc
### Customize this entry
# Set the USER variable to the name of the user to start tightvncserver under
export USER='pi'
### End customization required
eval cd ~$USER
case "$1" in
start)
su $USER -c '/usr/bin/tightvncserver :1'
echo "Starting TightVNC server for $USER "
;;
stop)
pkill Xtightvnc
echo "Tightvncserver stopped"
;;
*)
echo "Usage: /etc/init.d/tightvncserver {start|stop}"
exit 1
;;
esac
exit 0
The highlighted text 'tightvncserver :1' will start everytime on bootup.
On the client side, install any vnc viewer. I installed Real VNC viewer.
Download Real VNC Viewer from this link: http://www.realvnc.com/download/viewer/
Go do Downloads,
$ cd Downloads/
$ chmod +x VNC-Viewer-5.0.4-Linux-x86
$ ./VNC-Viewer-5.0.4-Linux-x86
The IP address - 192.168.0:90:1 and the password is the one which you had set initially.
![]() |
| VNC login window |
![]() |
| The terminal on RPI pinging google.com |
Happy Tinkering !
Reference: http://www.penguintutor.com/linux/tightvnc


No comments:
Post a Comment