Microsoft announced and provided information about running Linux GUI Apps in Windows 10 via WSL. Here are the details.
Microsoft’s Windows Subsystem for Linux (WSL) already allows us to install Linux distribution such as Ubuntu and run command-line applications for a couple of years now. Over the years WSL has been improved and slowly adding features.
Now, the biggest feature update yet, enabling the WSL to run Linux native desktop applications inside WSL.
Table of Contents
Linux GUI Apps in WSL
This update is available with Windows 10 insider preview build 21364.
Microsoft also nicknamed the new feature as WSLg – as in g for GUI. And right now this feature primarily for developers to test a) Linux IDE-based applications b) Build (!) and test Linux applications from the Windows environment.
How does it work?
The WSL now comes with a “WSLg system distribution” which contains the X server, Wayland, pulse audio server, and all other necessary components required by a native Linux desktop application. For example, if you install Ubuntu via Microsoft Store and updated to the latest WSL, then install GUI apps – all the functionalities of GUI apps are handled by the “WSLg system distro“.
From the demo and the blog post couple of things, I could summarize.
- You don’t start an X server manually from the WSL prompt (e.g. startx etc)
- When you execute gedit (for example) the WSL itself takes care of starting the X server via the WSLg system distro
- The initial demo shows GNOME apps with proper GTK themes, colors, and fonts.
- The GUI apps can browse the file system also.
- And the apps can connect to a pulse audio server for sound functionalities as well.
Pretty crazy isn’t it? Details can be found here.
How to enable
You need to make sure you are in the Microsoft Windows Insider program and running Windows 10 Insiders preview build 21364.
Install WSL if it is not installed. Or install Ubuntu from the Microsoft store.
Then open WSL and run –
wsl --install
And if you already have WSL installed, then run –
wsl --update
Both the commands will install the WSLg distributions.
Full install instructions can be found here.
Closing Notes
When Microsoft announced WSL a couple of years back, many were expecting this day when it is possible to run native GUI apps directly under WSL. And it seems now possible. But in my personal opinion, if you want to run Linux desktop apps, install Linux. Why invest so much time and effort to run it inside Windows? Unless there is some other agenda which all are aware of.
The feature is good, definitely, but how many users will use this, how much productive work would be achieved by this feature, no one knows. Moreover, what are the real-world problems that can be solved by the WSLg? I have doubts. It would only help those who created this entire WSL roadmap for certain other benefits!
Image credit: Microsoft