Remote RPi using VCN and SSH

We can connect to our Raspberry Pi remotely using SSH. This would be enough if we only needed to control our device using only the console. In order to have “X” access, we could execute the ssh command with the -X option and then launch the X window System using the command “startx“. If you do so, you will only start the GUI with video output of our Raspberry Pi.

Below is a screenshot taken from my computer where the interface has been “started” remotely. Note that this  doesn’t mirror what is seen in the RPi itself. Instructions on how to perform this are described below.

Screen Shot 2012-12-04 at 7.53.24 PM

SSH Connection:

First we must achieve ssh connection between our RPi and a computer. This step isn’t nothing special, or to do with RPi itself but following any guide to connect two computers with ssh will be good. After all RPi has a Linux based OS. In my case I used a Mac OS X, and therefore ssh between unix based computers is extremely easy:

Note that by default the RPi ssh is off. This can be changed either at the configuration process (executed the first time we run our freshly loaded image on the RPi)

expandrootfsopt1

(more info on raspi-config: http://elinux.org/RPi_raspi-config)

or by executing the following:

By default the SSH is off. To enable SSH, logon to your PI and type:

sudo mv /boot/boot_enable_ssh.rc /boot/boot.rc
reboot

After rebooting your RPi, find out the ip address of the RPi itself:

ifconfig

Under “eth0” interface you will find a line like this:

inet addr:192.168.2.6  Bcast:192.168.2.255  Mask:255.255.255.0
 
 

Installing VNC Server:

Connect to your Raspberry Pi via SSH or type in locally.

sudo apt-get install tightvncserver

This will install the VNC server. Run startx in the background.

startx &

Start the VNC server, it will then ask for a password. Enter a password of your choice.

tightvncserver

On your Mac install a VNC client such as Chicken of the VNC. Start the client and enter the ip address of your Raspberry Pi and the password from the server install. You should see something like this:

Screen Shot 2012-12-04 at 8.51.32 PM

You will finally see the RPi interface in your computer!

One response to “Remote RPi using VCN and SSH

Leave a comment