X11 Forwarding through SSH
Guide for setting up X11 Forwarding from Linux to Windows through SSH.
- Install & Run Xming X Server for Windows
- Set the
DISPLAY
environment variable:- Windows:
set DISPLAY=localhost:0.0
- PowerShell:
$env:DISPLAY="localhost:0.0"
- Windows:
- Double check the environment variable:
- Windows:
echo %DISPLAY%
- PowerShell:
echo $env:DISPLAY
- Windows:
- Connect to Linux server (such as a Ubuntu Desktop) through SSH:
ssh -Y <user_name>@<server_name>
ssh -Y
should only connect to a trusted Linux server. - Check the environment variable on the Linux server:
echo $DISPLAY
- Launch a X11 application:
xeyes
or
glxgears