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)