🔍 See Original Answer on Ask Ubuntu 🔗
What's the easiest way to run GUI apps on Windows Subsystem for Linux?
January 7, 2018
Edited: June 7, 2019
November 24, 2022
Copy to clipboard: false
I chose to use
VcXsrv in WSL (Windows 10 Subsystem for Linux). I recommend everyone do their research between
xming (the accepted answer) and [VcXsrv] before selecting one or the other for Graphical User Interface (GUI) support in Windows 10 Ubuntu 16.04.
Installation is straight forward. As of March 17, 2019 you can simply accept the defaults. If you want to call
gedit from within your Bash Shell / Terminal you need to edit
~/.bashrc and insert this line:
What can you do after VcXsrv is installed?
I was able to run:
sudo apt install ubuntu-desktop sudo apt install yad sudo apt install gedit
… to install GUI desktop software. This then allowed me to run
nautilus. Also I was then able to install specific GUI applications through the CLI (Command Line Interface) using
When I want to try many of my Ubuntu bash scripts within WSL VcXsrv must be installed so
yad x-windows dialog boxes are displayed for user input.
As others have noted GUI within WSL is not perfect and you can expect to spend time problem-solving some issues. Also some GUI software simply won’t work in WSL.
/etc/environment to tweak GUI drop down menus:
PATH="/mnt/e/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" export LIBGL_ALWAYS_INDIRECT=Yes export DISPLAY=localhost:0.0
/mnt/e/binis unusual path because it is where I store scripts used in both Windows 10 dual boot WSL and Ubuntu 16.04 dual boot. Most users would not include this on their machine. : https://sourceforge.net/projects/vcxsrv/