How-To
Windows Subsystem for Linux GUI (WSLg) Deep Dive
In a previous series of articles, I revisited Windows Subsystem for Linux (WSL) and found that it had matured a great deal since it first came out around five years ago. If you haven't installed it yet and want to see how I installed it from the command line, please refer to the series, which starts here.
I didn't plan on writing more on WSL, but the more I worked with it the more features I found that I think are worthy of highlighting, and I will be sharing some of those with you in a new series of articles. To kick it off, in this article I will outline how WSL has integrated Linux graphics applications with Windows, referred to as Windows Subsystem for Linux GUI or WSLg for short.
While launching graphics applications has traditionally been a doable -- albeit cumbersome -- process, WSLg has made it much more seamless. Before using WSLg, however, you will need to have installed WSL on a Windows 11 build 22000 or later; WSLg will not work with Windows 10. I used Ubuntu on Windows for this article and have not tried WSLg with other Linux distros.
Installing Linux Graphics Applications
Linux graphics applications are installed from the WSL console. WSLg takes care of displaying them on the Windows 11 system, and nothing special is required on the Windows system.
To get to the Linux console, type Ubuntu in the Windows search box and then double-click the application icon.
To test WSLg, I installed VLC (a popular media player) by becoming root user, updating my system and then entering the following commands:
sudo bash
apt update
apt install vlc -y
To launch VLC, I entered vlc & in the Ubuntu command line (the "&" ran VLC as a background process). I was presented with the VLC application as a new Windows pane that I could move around and resize like any other Windows application. I could then play videos using VLC without any issues.
Other GUI Applications
I was able to install and launch various other GUI applications by entering the commands listed below.
-
For Nautilus (graphics file manager):
- Install: apt install nautilus -y
- Launch: nautilus &
-
For Gimp (a graphics editor like Photoshop):
- Install: apt install gimp -y
- Launch: gimp &
-
For Gnome-system-monitor (graphics system monitor):
- Install: apt install gnome-system-monitor -y
- Launch: gnome-system-monitor &
It ran for a few minutes and then stopped with the following message. I didn't investigate the issue further.
-
For Firefox (a very popular web browser):
- Install: apt install firefox -y
- Launch: firefox &
The web browser functioned as expected and I was even able to play YouTube videos on it without any issues.
WSSLG on Windows 10
Something you need to remember is that WSLg will only work on Windows 11. When I installed and launched VLC from WSL on a Windows 10 system, I got multiple error messages and then a command-line prompt for VLC.
You can run graphics applications from WSL on Windows 10, but you will need to start a full Linux graphical desktop and then start the xrdp service on WSL, RDP into the WSL session, and start VLC in it. While this worked for me, this is far different than having WSLg seamlessly start graphics applications on a Windows 11 system where they act like any other Windows 11 application, as opposed to having them run inside an RDP session.
Conclusion
WSLg is a neat feature that allows you to launch graphics applications from Linux and have them behave like Windows 11 applications and shows the investment that Microsoft and Ubuntu have made into WSL.
About the Author
Tom Fenton has a wealth of hands-on IT experience gained over the past 30 years in a variety of technologies, with the past 20 years focusing on virtualization and storage. He previously worked as a Technical Marketing Manager for ControlUp. He also previously worked at VMware in Staff and Senior level positions. He has also worked as a Senior Validation Engineer with The Taneja Group, where he headed the Validation Service Lab and was instrumental in starting up its vSphere Virtual Volumes practice. He's on X @vDoppler.