Guide for setting up X11 Forwarding from Linux to Windows through SSH.

  1. Install & Run Xming X Server for Windows
  2. Set the DISPLAY environment variable:
    • Windows:
      set DISPLAY=localhost:0.0
      
    • PowerShell:
      $env:DISPLAY="localhost:0.0"
      
  3. Double check the environment variable:
    • Windows:
      echo %DISPLAY%
      
    • PowerShell:
      echo $env:DISPLAY
      
  4. 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.

  5. Check the environment variable on the Linux server:
    echo $DISPLAY
    
  6. Launch a X11 application:
    xeyes
    

    or

    glxgears
    

Posted: