Skip to content

win-ssh-x11-fwd

This guide explains how to do X11 Forwarding with OpenSSH on Windows 10 using VcXsrv.

Note: before starting, make sure that X11Forwarding is enabled and xauth is installed on the SSH server you want to connect to.

First of all, you need to install VcXsrv. Example with the Chocolatey package manager:

Bash
sudo choco install -y vcxsrv

Note: the sudo binary here is provided by gsudo on Windows.

Then start the application (it should be XLaunch in the applications menu). After a quick configuration wizard, it will minimize to the Windows tray bar.

Now you can connect to an SSH server with X11 Forwarding. Open a Git Bash window and type the following (adjusting the server connection parameters):

Bash
DISPLAY=127.0.0.1:0 ssh -Y myuser@192.168.0.123

Then, in the remote shell:

Bash
sudo apt install x11-apps
xclock