DEV Community

Lance Jian
Lance Jian

Posted on

Run Remote Linux GUI Application from Windows with X11 Forwarding

This article supposed the remote Linux is Ubuntu 20.04 and above.

Needed Software in Windows:

Start PuTTY, configure SSH > X11 > Enable X11 forwarding:

Image description

In remote linux machine, change /etc/ssh/sshd_config:

X11Forwarding yes
X11UseLocalhost no
Enter fullscreen mode Exit fullscreen mode

Restart remote SSH service:

sudo systemctl restart ssh.service
Enter fullscreen mode Exit fullscreen mode

(Optional) Add in ~/.bashrc :

export LIBGL_ALWAYS_INDIRECT=1
Enter fullscreen mode Exit fullscreen mode

To start the remote GUI application:

  1. Run XLaunch first in Windows
  2. Run PuTTY, login your remote machine
  3. Run xclock in the command line to test if it works.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay