X11 desktop GUI apps for Windows Subsystem for Linux

Linux X11 GUI programs often work fine on Windows Subsystem for Linux. This procedure has been used for years on WSL1. WSL2 may need additional setup due to the more advanced network configuration of WSL2.

Setup

Install a Windows X11 server to enable graphical Linux applications on Windows as follows:

Install VcXsrv and add to WSL ~/.bashrc

DISPLAY=:0.0
export DISPLAY

Usage

To run any X11 Linux GUI app in WSL, start VcXsrv first from Windows. You don’t have to do this before starting WSL.

Notes

  • on WSL1, do NOT open a port in your firewall for X11 if asked by Windows.
  • old Xming X11 server