Skip to content

X-Forwarding


What is X

X is a system on Linux that manages the display of Graphical Software. On most versions of Linux, when you start up in graphical mode (as opposed to cli), it will use X.

X is a very flexible system, as it can not only show local applications, but also applications running on another computer. This means that you can start software on another computer, but use it locally.

This is called X-Forwarding, as you are forwarding the X-data to another computer and show it there.

You can easily enable X-Forwarding on Linux and on Mac using ssh. On Mac you may need to install XCode first.


How to use

Connect to the remote computer using ssh, but add option -X.

ssh $username@$server -X

Then launch your favorite GUI application

gedit &

The & is so you can keep working in the same terminal. However, many applications will output messages to your terminal, so it's often more practical to use another terminal window for command line editing.

If you find that response is slow, you can try to enable Compression. Reconnect with an extra option -C:

ssh $username@$server -XC