WSLg — Run Linux GUI Apps on Windows
Run Linux GUI apps on Windows: WSLg brings Wayland, X11, PulseAudio and GPU acceleration straight into WSL 2 – no manual X server required.
WSLg (Windows Subsystem for Linux GUI) puts graphical Linux applications straight onto your Windows desktop – without you installing or configuring an X server yourself. Built into WSL 2 on Windows 11 (and recent Windows 10 builds), it combines a Wayland and X11 compositor with PulseAudio and GPU acceleration. Linux apps such as gedit, GIMP or Nautilus launch with a single command; DISPLAY and WAYLAND_DISPLAY are already wired up for you. WSLg is therefore less a single command than a feature – this guide shows you how to set it up, launch GUI apps and fix the usual snags.
Setup & Requirements
wsl --update — Update WSL to ensure WSLg is included.
wsl --updatewsl --version — Check WSLg version (listed as WSLg version).
wsl --versionecho $DISPLAY — Verify the DISPLAY variable is set (should be :0).
echo $DISPLAYecho $WAYLAND_DISPLAY — Verify Wayland display is available.
echo $WAYLAND_DISPLAYRun GUI Applications
<app> & — Launch a Linux GUI app in the background.
gedit &nautilus . — Open the GNOME file manager in the current directory.
nautilus . &firefox & — Launch Linux Firefox (if installed).
firefox &gimp & — Launch GIMP image editor.
gimp &xeyes — Quick test to verify X11 forwarding works.
sudo apt install x11-apps && xeyesInstall GUI Apps
sudo apt install <gui-app> — Install a Linux GUI application.
sudo apt install gedit nautilussudo apt install x11-apps — Install basic X11 test applications.
sudo apt install x11-appssudo apt install mesa-utils — Install OpenGL utilities (test GPU acceleration).
sudo apt install mesa-utils && glxinfo | grep 'OpenGL renderer'GPU & Audio
glxinfo | grep 'OpenGL renderer' — Check which GPU renderer is being used.
glxinfo | grep 'OpenGL renderer'glxgears — Run OpenGL benchmark to test GPU acceleration.
glxgearspactl info — Check PulseAudio connection (audio support).
pactl info | grep 'Server Name'speaker-test -t wav -c 2 — Test audio output through WSLg.
speaker-test -t wav -c 2 -l 1Troubleshooting
wsl --shutdown && wsl — Restart WSL (fixes most WSLg issues).
wsl --shutdown && wslls /tmp/.X11-unix/ — Verify the X11 socket exists.
ls -la /tmp/.X11-unix/ls /mnt/wslg/ — Check if the WSLg mount point exists.
ls /mnt/wslg/export DISPLAY=:0 — Manually set DISPLAY if not set automatically.
export DISPLAY=:0cat /mnt/wslg/versions.txt — Show WSLg component versions.
cat /mnt/wslg/versions.txt Conclusion
WSLg makes the jump from the Linux command line to graphical Linux apps on Windows surprisingly painless: install the app with apt and launch it as if you were on a native Linux desktop – Wayland, X11, PulseAudio and GPU acceleration are already in place. Keep WSL current with wsl --update, since that is also how WSLg improvements arrive. If an app refuses to start, a wsl --shutdown followed by a restart almost always fixes it; for deeper diagnosis, look at /mnt/wslg/ and the DISPLAY and WAYLAND_DISPLAY variables. There is little destructive risk here – WSLg is a convenience feature, not a system-altering command.
Further Reading
- Microsoft Learn: Run Linux GUI apps with WSL – official tutorial for WSLg
- WSLg on GitHub – source code, architecture and troubleshooting
Related Commands
- wsl – manage and control the Windows Subsystem for Linux
- powershell – the Windows shell you launch WSL and WSLg from
- bash – the default shell where you invoke Linux GUI apps