Thursday, November 7, 2013

Remote control Raspberry Pi from Windows 8.1 using VNC

Before establish VNC connection between Raspberry Pi and Windows, you have to prepare the following setup.
- Enable ssh on Raspberry Pi. It should be already enabled in default setting.
- You have to know the IP address of your Raspberry Pi.
- Install PuTTY on Windows.
Install TightVNC server on Raspberry Pi.
Install Real VNC Viewer on Windows.

This demo run on Windows 8.1. In order to make it easy to demo the operation. I will log-in Raspberry Pi from Windows 8.1 with PuTTY using simple ssh to start vncserver. Suppose it have same result if you start vncserver at Raspberry Pi locally.

- Enter the command in LXTerminal:
$ vncserver

Now the vncserver is running. Note the number shown behind the words "New 'X' desktop is raspberrypi:", it is the SSH tunnel port number. We will use it to specify our connection later, when we setup SSH tunnel.

run vncserver in Raspberry Pi side
Start another PuTTY session to log in the running vncserver. It's the actual vnc connection in this demo.

- Enter the IP address of your Raspberry Pi in "Host Name (or IP address)" box.

- Expend Connection > SSH > X11 on the left, check to Enable X11 forwarding.

- Expend Connection > SSH > Tunnels, Enter 590X in Source port, where X is the SSH tunnel port number when we start vncserver in Raspberry Pi, and enter <Raspberry Pi IP address>:590X in Destination.

- Enter <Raspberry Pi IP address>:X in VNC Server.

- You will be prompted with Unencrypted Connection.

- Enter Password, set in Install TightVNC server on Raspberry Pi.

* Success

To end vncserver session, end the command in Raspberry Pi.
$ vncserver -kill :X

demo video:

- Set desktop size of vncserver

No comments: