Member-only story
X11 forwarding is a powerful feature in Linux that allows you to run graphical applications on a remote Linux server and display them locally on your machine. This can be incredibly useful for tasks such as software development or managing a remote server. In this article, we will explore how to do X11 forwarding in Linux.
Prerequisites
To follow along with this tutorial, you will need:
- A local machine running Linux with an X11 server installed.
- A remote machine running Linux with an X11 server installed and an SSH server running.
- SSH client installed on the local machine.
Step 1:
Connect to the remote server via SSH The first step is to connect to the remote server via SSH. Open a terminal window on your local machine and enter the following command:
$ ssh -X username@remote_server
Replace ‘username’ with your username on the remote server, and ‘remote_server’ with the IP address or hostname of the remote server.
Step 2:
Test X11 forwarding Once you have connected to the remote server, you can test X11 forwarding by running a graphical application on the remote server and displaying it on your local machine. To test this, we will use the xclock
application, which displays a clock on the screen.