If you're running WSL2 on a reasonably up-to-date Windows machine, you can probably run Linux GUI applications right now without installing anything extra. No X server, no configuration files, no port forwarding. Just install a Linux app and run it.
This is WSLg—Windows Subsystem for Linux GUI—and it's been quietly shipping with Windows since 2021. Most people don't even know it's there.
Do You Have WSLg?
Open PowerShell and check:
wsl --versionYou should see something like:
WSL version: 2.6.3.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.71If you see a WSLg version listed, you're ready. If not, update WSL:
wsl --update
wsl --shutdownWindows Version Requirements
Windows 11: Build 22000 or later (any Windows 11 release works)
Windows 10: Build 19044 or later (version 21H2 or 22H2)
Important for 2025+: Windows 10 mainstream support ended in October 2025. Continued updates require enrollment in Microsoft's Extended Security Updates (ESU) program. If you're still on Windows 10, consider using the Microsoft Store version of WSL for the latest features.
For the best experience, install WSL from the Microsoft Store rather than using the built-in Windows component. The Store version updates independently and always has the latest WSLg.
Test It Out
Inside your WSL distro, install some GUI apps:
sudo apt update
sudo apt install x11-apps gedit -yNow run them:
xclock &
gedit &Linux windows should appear on your Windows desktop with their own taskbar entries. That's it—no configuration needed.
How WSLg Actually Works
WSLg isn't just an X server bolted onto Windows. Microsoft built something more sophisticated that uses technology Windows already understands deeply: RDP.
Here's the high-level flow:
When you launch a Linux GUI app, it doesn't talk directly to Windows. Instead:
- Your app connects to a Wayland compositor running in a separate system distro
- The compositor renders frames and streams them to Windows using RDP
- Windows displays each app as a native-looking window
The clever bit is using RDP internally. It's a protocol Windows has supported for decades, with mature clipboard sharing, audio passthrough, and GPU acceleration.
Inside the System Distro
Every WSL2 user distro is paired with a hidden system distro based on Microsoft's CBL-Mariner Linux. This system distro runs the WSLg components:
Tip: You can shell into the WSL system distro if you like - use
wsl --system
WSLGd is the init process that launches everything: Weston (the Wayland compositor), XWayland (for older X11 apps), and PulseAudio (for sound). It also establishes the RDP connection by launching mstsc.exe in silent mode on the Windows side.
Weston is the Wayland project's reference compositor. Microsoft extended its RDP backend to support RAIL (Remote Application Integrated Locally) and VAIL (Virtualized Application Integrated Locally) modes — these let individual app windows be remoted rather than an entire desktop.
XWayland handles legacy X11 applications by translating X11 protocol calls to Wayland. Most Linux GUI apps still use X11, so this compatibility layer is essential.
The RDP connection stays active in the background, ready to display new apps instantly without connection delays.
Wayland vs X11 Apps
Modern Linux apps using GTK4, Qt 6, or other current toolkits typically support Wayland natively. Older apps using X11 go through XWayland, which adds a small translation overhead but works transparently.
You can check what an app is using:
# For GTK apps
GDK_BACKEND=wayland gedit & # Force Wayland
GDK_BACKEND=x11 gedit & # Force X11In practice, you rarely need to care—WSLg handles both automatically.
Audio Works Too
WSLg includes PulseAudio, routing Linux audio through the same RDP channel to your Windows speakers:
# Test audio
sudo apt install mpv sound-theme-freedesktop -y
mpv /usr/share/sounds/freedesktop/stereo/complete.ogaAudio, clipboard sharing, and even GPU acceleration all work through RDP. No separate configuration needed.
Check Audio Status
sudo apt install pulseaudio-utils -y
pactl infoIf audio isn't working, a WSL restart usually fixes it:
wsl --shutdownGPU Acceleration
WSLg can use your Windows GPU for accelerated rendering. This happens automatically if you have recent GPU drivers installed.
Performance note: On discrete GPUs, there's overhead from copying rendered frames between VRAM and system memory. At very high frame rates (think 600fps in benchmarks), this overhead can reach 50%. For normal application use, you won't notice it.
Check if GPU acceleration is working:
sudo apt install mesa-utils -y
glxinfo | grep "OpenGL renderer"You should see your GPU name. If you see "llvmpipe", that's software rendering — fine for most apps like text editors and file managers, but 3D-heavy applications will be slower.
Update GPU Drivers
If you have a GPU but see llvmpipe, or experience graphical glitches, update your drivers:
- NVIDIA: Download from nvidia.com/drivers
- AMD: Download from amd.com/support
- Intel: Usually updated via Windows Update, or from intel.com/download-center
Environment Variables
WSLg automatically sets these in your distro:
| Variable | Value | Purpose |
|---|---|---|
DISPLAY | :0 | X11 display server |
WAYLAND_DISPLAY | wayland-0 | Wayland compositor |
PULSE_SERVER | /mnt/wslg/PulseServer | Audio server |
If you've set custom values for these (perhaps from an older X server setup), WSLg will overwrite them. Remove any manual DISPLAY exports from your .bashrc if you're using WSLg.
When WSLg Isn't Enough
WSLg is optimised for running individual applications. Each app gets its own window on your Windows desktop, managed by Windows.
But what if you want:
- A full Linux desktop with panels, system tray, and window management?
- Multiple apps sharing a cohesive desktop environment?
- GNOME, KDE, or XFCE as your workspace?
For that, you need a different approach: running a complete desktop environment via XRDP. That's covered in Part 2: Ubuntu Desktop with XRDP.
Quick Reference
# Check WSLg is available
wsl --version
# Update WSL
wsl --update && wsl --shutdown
# Install GUI apps
sudo apt update
sudo apt install x11-apps gedit -y
# Test GUI
xclock &
# Test audio
sudo apt install pulseaudio-utils -y
pactl info
# Check GPU acceleration
sudo apt install mesa-utils -y
glxinfo | grep "OpenGL renderer"
# Fix display issues - restart WSL
wsl --shutdownThis Series
- Part 1: Running Linux GUI Apps with WSLg — You are here
- Part 2: Ubuntu Desktop with XRDP
- Part 3: Fedora Desktop with XRDP
- Part 4: Kali Linux Desktop with Win-KeX
- Part 5: Arch Linux Desktop with XRDP
- Part 6: openSUSE Desktop with XRDP
- Part 7: Alpine Linux Desktop with XRDP
- Part 8: WSL2 Desktop Troubleshooting Guide
Further Reading
- Run Linux GUI apps on WSL — Official Microsoft tutorial
- WSLg GitHub Repository — Architecture docs and issue tracker
- WSLg Architecture Deep Dive — Microsoft's technical explanation
- Microsoft WSL Documentation