Category Archives: Raspberry Pi

X11 Forwarding from a Headless Raspberry Pi, to an Ubuntu 12.04 Desktop

I have several Raspberry Pi’s on my network that run headless, i.e. without monitor or keyboard. When I want to run an XWindows application on the Raspberry Pi and have the window appear on my Ubuntu desktop, I run ssh (secure shell client) with the -X option set, and the application’s connection to the X11 display is automatically forwarded from the Raspberry Pi to my desktop’s XWindows server. The connection is encrypted as all ssh connections are.

The command is:

ssh -X user@hostname

It’s that simple. The -X option takes care of setting theĀ DISPLAY environment variable for you.

Note that man page for ssh mentions that enabling X11 forwarding should be enabled with caution for reasons of security. For this X11 forwarding to work, the remote machine has to make a connection back to the local X11 display, and an attacker could take advantage of this connection to perform activities such as keystroke logging. Make sure you trust the machines you use X11 forwarding with.