I recently needed to run a GUI application on a remote, headless Linux server. I went down the usual road of trying to get X11 forwarding to work and met the usual slew of errors.
Then I found Xpra.
Save yourself the pain and go straight to Xpra if you need to display an application on your laptop that is running on a remote Linux system.
What Does Xpra Do?
Xpra allows you to run a program that has a GUI output on a remote Linux server. This means that they program is running remotely but the GUI is displayed locally on your Laptop.
Step 1 - Get Everything Installed
You will need to get Xpra installed at both ends, on the the remote server and on your laptop. On Debian and Ubuntu this is as simple as:
sudo apt install xpra
You will also need to install the application that you want to run on the remote server. I’m going to use a simple application called xeyes. This is contained in the
x11-apps package on Debian and Ubuntu.
Step 2 - Running the program
Run a command with the following syntax on your laptop:
xpra start ssh://<USER>@<HOST>:22 --start-child=<APPLICATION>
jimmi on a server at
126.96.36.199 gives us:
xpra start ssh://email@example.com:22 --start-child=xeyes