Okay. There you are. You have your Raspberry Pi. You’ve connected it to your Smart TV with HDMI but wan’t to run it headless, so without a monitor (with expensive HDMI to VGA adapter) and you don’t want to get in trouble with your wife by claiming the TV while she’s watching the daily soaps. If you’re somewhat familiar with SSH, you can install VNC server to the Pi and remote desktop to it’s graphical interface.

Log in to your Raspberry Pi via SSH and install a VNC server with the command: sudo apt-get install tightvncserver. Now start it with the command tightvncserver and set a password if needed. Now we are going to create a startup script and run the service automatically when the Pi boots up. Do this with sudo vi /etc/init.d/vnc, press i to insert text and paste the output below in the editor.

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

USER=pi
HOME=/home/pi
export USER HOME
case "$1" in
    start)
        echo "Starting VNC Server"
        #Insert your favoured settings for a VNC session
        su - $USER -c "/usr/bin/vncserver :1 -geometry 1024x768 -depth 16 > /tmp/vncserver.log 2>&1 &" &
    ;;
    stop)
        echo "Stopping VNC Server"
        /usr/bin/vncserver -kill :1
    ;;
    *)
        echo "Usage: /etc/init.d/vnc {start|stop}"
        exit 1
    ;;
esac
exit 0

Save the file with [esc] :qw! and make it executable with sudo chmod +x /etc/init.d/vnc. Now type this so the VNC server starts when the Pi boots up: sudo /usr/sbin/update-rc.d vnc defaults. Now reboot your Pi to test it. You should be able to create a VNC remote desktop connection to your Raspberry Pi. Use Chicken of the VNC as VNC viewer, both available for Windows and Mac.

Raspberry Pi via VNC

Raspberry Pi via VNC