> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/rdm/knowledge-base/how-to-articles/x11-forwarding.md).

# X11 forwarding

X11 forwarding allows you to run graphical applications installed on a remote Unix/Linux host and display them locally on a Windows machine. When using Xming and SSH, a proper setup is required to avoid common errors such as missing display variables or authentication failures.

This guide outlines the prerequisites for X11 to function properly and provides step-by-step troubleshooting tips if issues arise.

### Prerequisites

Before starting, make sure the following conditions are met:

* Xming is installed and running on your Windows machine.
* X11 forwarding is enabled in your SSH client settings (entry properties - X11 forwarding - Enable X11 forwarding).

  ![](https://cdnweb.devolutions.net/docs/RDMW6119_2025_1.png)
* The remote host has X11 applications installed (e.g., xclock).

### Steps to use X11 forwarding

1. Start Xming on your Windows machine.
2. Connect to the remote host via SSH with X11 forwarding enabled.
3. Run an X11 application on the remote host (e.g., xclock).

### Troubleshooting common X11 issues

#### DISPLAY variable not set

Check ***echo $DISPLAY***. The expected output should be something like localhost:10.0. If the output is empty, X11 forwarding is not working. Check that it is enabled in the SSH client settings.

#### "Invalid MIT-MAGIC-COOKIE-1" error

This error indicates that the X11 transport is working, but the authentication has failed.

1. Check for .Xauthority file by opening a terminal and entering `ls -l ~/.Xauthority`.
2. If the file is missing or owned by another user, authentication can fail.
3. View X Auth list.
4. You should see an entry like: ***midopd1/unix:10 MIT-MAGIC-COOKIE-1 \<long\_hex\_string>.*** If this is not the case, create the entry.

#### X11 forwarding issues when using su

1. From the original SSH user, enter `xauth list - /tmp/xauthcookies`.
2. Switch to the new user.
3. Enter `xauth merge /tmp/xauthcookies`.
4. Try running the X11 application again (e.g., xclock).

Following the steps above ensures that X11 forwarding via SSH using Xming on Windows is correctly set up. Most issues are either due to misconfigured DISPLAY variables or X11 authentication problems. Addressing these common pitfalls should resolve typical X11 forwarding problems.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devolutions.net/rdm/knowledge-base/how-to-articles/x11-forwarding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
