How to Setup X Display in Linux Using PuTTY (Step-by-Step Guide)

Running graphical applications on a Linux server remotely can be very useful, especially when installing software that requires a graphical interface. In this guide, you’ll learn how to configure the X Display in Linux so GUI applications can run smoothly from a remote server to your local computer.


This tutorial explains the process using PuTTY and X11 forwarding, making it simple for beginners and system administrators alike.

What Is X Display in Linux?

The X Display (X11) system allows Linux to show graphical user interface (GUI) applications. When working on a remote Linux server, X11 forwarding lets those graphical programs appear on your local computer’s screen.

This is especially helpful when installing enterprise software or GUI-based tools on remote servers.


Step 1: Install an X Server on Your Local Computer

Before linux x display configuration , you must install an X Server on your local machine.

Choose the appropriate option for your operating system:


For Windows:

  • Xming
  • X410

For macOS:

  • XQuartz

After installation, start the X Server so your computer can receive graphical output from the remote Linux machine.

Step 2: Enable X11 Forwarding in PuTTY

If you are connecting to Linux from Windows, PuTTY must be configured to allow X11 forwarding.


Forwarding in PuTTY
Follow these steps:

  1. Open PuTTY
  2. Go to Connection → SSH → X11
  3. Check Enable X11 Forwarding linux
  4. Return to Session
  5. Save your session configuration

This step ensures graphical programs can be forwarded to your local system.

Step 3: Connect to Your Linux Server

Now connect to your Linux server using PuTTY.

Make sure the connection uses the saved session where X11 forwarding is enabled. Once connected, the server will be ready to send GUI applications to your computer.


Step 4: Configure the DISPLAY Environment Variable

Next, set the DISPLAY variable so the Linux server knows where to send graphical output.

Run this command in the terminal:

        export DISPLAY="HOST_NAME":0.0

Example:

        export DISPLAY=yourhostname:0.0

Replace HOST_NAME with your computer’s hostname or IP address where the X Server is running.

Step 5: Run the GUI Installer

Once the display is configured, you can start any graphical installer.

Example command:

        sudo PATH_TO_INSTALLER/installer

When executed correctly, the installer window will appear on your local machine, even though the software is running on the remote Linux server.


Step 6: Troubleshooting X Display Problems

Sometimes you may see errors such as:

  • Unable to verify graphical display setup
  • Application requires X display
  • Can't connect to X11 window server

These issues can happen if the user session changes.

For example, switching users with:

        su - oracle

may break the X11 connection.


Quick Fix

Open a new SSH session with X11 forwarding enabled and log in directly as the required user instead of switching users after login.


Final Thoughts

Setting up X Display in Linux with X11 forwarding makes it easy to run GUI applications from remote servers. By installing an X Server, enabling X11 forwarding in PuTTY, and configuring the DISPLAY variable, you can quickly run graphical installers and tools from any Linux system.

If you work with Linux servers, remote administration, or enterprise software installations, mastering X Display configuration will save you a lot of time.

FAQ 

❓ What is X11 forwarding in Linux?

X11 forwarding allows users to run graphical applications on a remote Linux server and display them on their local computer.

❓ Why is my X11 display not working?

This usually happens when X11 forwarding is disabled or the DISPLAY environment variable is not configured correctly.

❓ Can I run Linux GUI apps over SSH?

Yes. By enabling X11 forwarding and configuring the X display, you can run GUI applications remotely over SSH.

Post a Comment

Previous Post Next Post