WSL GUI Feature Introspection.
Introduction⌗
Recently, Microsoft announced1 the support for Linux GUI applications on WSL2 and codenamed it WSLg.
WSLg aims to make Linux GUI applications feel as native as possible to the Windows user experience.
Initially, one would need to go through rigorous setup to get this to work but Microsoft is trying to make the experience as plug-and-play as possible. What caught my eye is how you don’t need to setup an X server to get the feature to work. Upon further introspection, I finally got to understand how Microsoft team achieved this. It is detailed below in their blog:
From the demos above, you might have noticed we didn’t need to start an X server manually. That’s because with this feature we are automatically starting a companion system distro, containing a Wayland, X server, pulse audio server, and everything else needed to make Linux GUI apps communicate with Windows. After you’re finished using GUI applications and terminate your WSL distribution the system distro will automatically end its session as well.
Like with the rest of WSL plumbing, our intention is for this component to be fully managed and seamless for users. Our intentions are for this system distro to be as invisible to the user as possible, and this is why you won’t see this system distro when you run
wsl -l -v
. Lastly, we’re excited to present that we are using Microsoft’s CBL-Mariner distribution for this system distro! CBL-Mariner is an internal Linux distribution used traditionally for Microsoft’s cloud infrastructure and edge products and services, and we are now extending its use to support GUI apps inside of WSL. You can view the diagram below to see an overall summary of the architecture of this feature.
- Excerpt from devblogs
You can read more about the architecture of the WSLg feature here2.
What excites me is that the feature is open-sourced3 and there’s so much potential of what to expect in the future. Personally, I would like to see a scenario where I can eventually be able to run WSL with a selection of my own X server. Eventually make it easier to run window managers of my choice? I think that’s a possibility. In the meantime, get into the project and find out what you can do. Happy hacking!
No comments yet!