WSLg
More info
- Creator
- Microsoft
- Released
- Type
- GUI support for WSL 2
- License
- MIT
- Source
- github.com/microsoft/wslg
Microsoft's own bridge that lets graphical Linux programs in WSL 2 open windows on the Windows desktop, built on Weston, Xwayland and RDP rather than on an X server for Windows.
For years, anyone wanting a GUI out of WSL ran a third-party X server such as VcXsrv or Xming and set DISPLAY by hand. WSLg, shown at Build 2020 and shipped with Windows 11 in October 2021, instead places a small system distribution next to the user's own, with a Wayland compositor built on Weston, Xwayland for X11 programs and PulseAudio for sound. The compositor has an RDP backend, and the Remote Desktop client built into Windows connects to it using RAIL, the mode in which each remote window becomes its own window on the host desktop. An addition called VAIL passes the pixel buffers through shared memory instead of over the network, so the whole thing feels local. Linux programs with .desktop files show up in the Start menu.
GPU acceleration goes through /dev/dxg and a Direct3D 12 driver in Mesa that Collabora wrote on Microsoft's behalf. The code is open under MIT on GitHub, which is easy to forget in the middle of the construction: the company whose CEO called Linux a cancer in 2001 now maintains a Wayland compositor. Windows 10 got the feature retroactively in 2022, through WSL from the Microsoft Store.