Running Graphical Programs on WSL

Windows 10 has no build in support for graphical programs on WSL. The WSL Bash is intended for running command-line programs that developers might need, but it is also possible to run graphical Linux desktop programs. You will be able to display graphical programs running in WSL on a Windows 10 desktop by using an X server (.. running on Windows 10).

X-Server for Linux GUI in Windows

There are many X servers that run on Windows and everyone has their own favorite. The most popular and free ones are: Xming, Cygwin X, and vcXsrv
I would recommend to use Xming. You should see the Xming Server running on 0.0 right after the installation.

On WSL you simply have to set the current display by export DISPLAY=:0 and execute the desired GUI. If you are to lazy to write it when its needed, you can also add it to you .bashrc.

Leave a Reply

Your email address will not be published. Required fields are marked *