In this post I will demonstrate how to run Linux GUI (Graphical User Interface) applications on Windows Desktop platform.
For now, it is necessary to install a third-party App to run the GUI Apps, but Microsoft announced on //build 2020 that they will release soon an improvement that will not require any third-party component to run Linux GUI Apps on Windows Desktop.
If you want to know how to install WSL on Windows 10, please check the following post:
The X server is a provider of graphics resources and keyboard/mouse events. I am using the VcXsrv Windows X Server that is open-source and is frequently update.
The first step is to install the third-part display manager called VcXsrv Windows X Server available at:
During setup is important to disable the access control to avoid the permission denied error when trying to run a GUI application:
To warranty that the “Disable access control” will be always checked, save the configuration and always launch VcXsrv using the configuration file (config.xlaunch):
The next step is to set the DISPLAY environment variable on Linux to use the Windows host's IP address as WSL2 and the Windows host are not in the same network device. It is necessary to run the following bash command to load the correct IP address on launch:
export DISPLAY="`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"
Running the following command, it is possible to see that the $DISPLAY environment variable now has the Windows Host’s IP set:
To avoid having to run that command every time that WSL is launched, you can include the command at the end of the /etc/bash.bashrc file:
Done! Now you can run the Linux GUI Apps on Windows desktop.
Follows some Apps that you can use to test:
Install Chromium Dev :
sudo add-apt-repository ppa:saiarcot895/chromium-dev sudo apt-get update sudo apt-get install chromium-browser
sudo apt install gedit gedit
sudo apt install x11-apps xeyes xcalc
Make sure that XLaunch is running and before calling the Linux GUI Apps on Windows Desktop environment.
The first thing that you need to do is to install a Linux Desktop Environment. I will user Xfce as it is a lightweight one.
Run the following commands to install Xfce:
sudo apt install xfce4
The next step is to install the xrdp that provides a graphical login to remote machines using RDP (Microsoft Remote Desktop Protocol).
sudo apt install xrdp
Type the following command to get the WSL IP address:
Make sure that xrdp service is running:
Run the Remote Desktop Client (MSTSC) and type the WSL IP address to connect to xfce4:
Done! Now you can access your favorite Linux IDE on WSL.
In this post we see how to run GUI Linux Apps using XServer on Windows Desktop environment and how to access the full WSL Linux desktop environment.
I hope you liked!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.