Monday, September 9, 2013

How to setup Putty to do X forwarding for Linux Ubuntu and Raspberry Pi.

How to setup Putty to do X forwarding for Linux Ubuntu and Raspberry Pi. (Remote desktop your Linux)Remote control your Linux and Raspberry Pi

What is X windows forwarding on Linux?


X windows forwarding allows you to local display the applications that is running on a remote Linux server.
Install your favorite X windows server on your MS windows PC.
I will install my favorite Cygwin x windows server and will explained the steps here.


Start the x Windows server.


You Should see a X in the icon bar at the bottom of your desktop.


When done continue with the Putty installation steps here http://www.chiark.greenend.org.uk/~sgtatham/putty/

Install Putty and then run it to get to First configuration screen below.

1) Enter the Host-name or IP of your Linux server in host Name text box.  E.G www.yourdomain.com
2) Enter the Port if its not the default port 22

Putty Start-up Configuration screen


2) Click on the Connection >> SSH >> X11 Category in the tree view.


3) Save the configuration.


4) Open your new configuration.
Enter your username and password.

login as: user1
user@test.com's password:
Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.5.0-23-generic i686)

 * Documentation:  https://help.ubuntu.com/

245 packages can be updated.
122 updates are security updates.

*** System restart required ***
Last login: Mon Sep  9 15:32:31 2013 from here.domain.com
user1@test.com:~$ 

5) Now see if X fording is setup on your Linux (by default it is enabled but not for the root user)
Run the command echo $DISPLAY
localhost:12.0

The value could be localhost:12.0 or 10.0

Do not su to any user otherwise your DISPLAY setting will not work.

"ls -l .Xauthority"  in the home directory to verify a file named .Xauthority exists. If so it should show permissions -rw-------

If you have to su to a different user you will have to copy the Xauthority file from your home directory to the home of the su user as well and check if the DISPLAY setting is also correct.

If you don't have a DISPLAY setting then run this command. export DISPLAY=<value from step above> 

6)Test it with  xterm or xclock

it could take some time for the xterm application window to pop up on your MS windows desktop.


and there you have it.

If you want your Raspberry Pi Full desktop and not just the app you start you could use the command on the Raspberry Pi startlxde

No comments:

Post a Comment