Member-only story

How to Do X11 Forwarding in Linux: A Beginner’s Guide

Siva
2 min readApr 30, 2023

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:

  1. A local machine running Linux with an X11 server installed.
  2. A remote machine running Linux with an X11 server installed and an SSH server running.
  3. 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.

--

--

Responses (1)