Monday 27 January 2014

Running GUI applications from another computer on Raspberry Pi (or vice versa)

The Raspberry Pi is a great piece of kit, however it's not particularly suitable for CPU or memory hungry applications (e.g. Firefox). There may also be times that you want to run an application you have on another computer on your Pi without having to install it.

As long as you are able to SSH onto a computer where that application is installed (and it can run the X Window System  - Linux will almost certainly do this out of the box) you can use a feature of the X window system to run the application on the remote computer but route the graphical window to your Pi (where it will behave - pretty much - as a standard graphical program.

To do this you must first be in a graphical environment on your Pi, for Raspbian this is started from the command line by typing startx. From here start the Terminal emulator, and log in to the remote computer over SSH using the -X switch:

ssh  -X username@192.168.0.2

Replace username with your username (default on Raspbian is pi) and 192.168.0.2 with the IP address of the remote computer.

You should now have what looks like a standard SSH terminal to the remote computer, however if you run a graphical program on the remote system the output will be displayed on the Pi. If you are logging into an Ubuntu/Debian or otherwise Gnome-based computer try running gedit as a quick test.

This also works in reverse, so you can run graphical programs on the Pi and have them display on your Linux desktop.

Running the Midori browser on my Raspberry Pi with the output redirected to an Ubuntu desktop using 'ssh -x'