WSLg — Running Linux GUI apps on Windows
Set up WSL2's GUI integration (WSLg) so Linux desktop apps open as native Windows windows. No external X server or VcXsrv needed.
Back in the day, running a Linux GUI app from WSL meant installing VcXsrv or X410, setting the DISPLAY env var, and adjusting the Windows firewall. Since WSLg (WSL GUI) shipped (Windows 11 + WSL 0.65+), that whole process disappeared — Linux apps just open as Windows windows.
I think WSLg is one of those improvements that's easy to miss because it requires no setup. Not because people don't know about it, but rather because the mental model of "Linux GUIs on Windows" used to mean "painful configuration," and that expectation hasn't caught up with what WSLg actually delivers. Originally getting a single X11 app to render required three configuration steps and a firewall rule. Now it works because the infrastructure is already there.
This guide enables WSLg on Windows 11 22H2+ + WSL 2 + Ubuntu 24.04 and walks through running common Linux GUI apps (Firefox, gedit, GIMP, GUI debuggers).
TL;DR
wsl --version— if bothWSL version 2.0+andWSLg 1.0+show up, you're setwsl --updatefor the latest versionsudo apt install -y x11-apps→xcalc— if a calculator opens as a Windows window, success- No DISPLAY config needed — WSLg injects it automatically
- Wayland apps get
WAYLAND_DISPLAY, X11 apps getDISPLAY=:0— both set for you
Prerequisites
- Windows 11 22H2+ (Windows 10 21H2+ works too, but 11 has better stability/performance)
- WSL 2 + Ubuntu 24.04 (other distros work — Debian, Fedora, etc.)
- Recent GPU driver (NVIDIA/AMD/Intel — WSLg uses vGPU)
1. How WSLg works (briefly)
[Linux GUI app] ──Wayland/X11──> [WSLg system compositor]
│
▼
[Windows RDP]
│
▼
[Windows desktop]
- The Linux app behaves as a normal Wayland or X11 client
- WSLg runs a
Westoncompositor and forwards via RDP to Windows - From Windows' side the app is just an RDP client — no separate X server needed
2. Verify — does it already work?
wsl --version
# WSL version: 2.x.x
# WSLg version: 1.x.x ← both present means OKIf WSLg isn't listed, update:
wsl --update
wsl --shutdownTest:
# Inside WSL Ubuntu
sudo apt update && sudo apt install -y x11-apps
xcalc # or xeyes / xclockA GUI window in Windows means success.
If nothing appears, see §8 Troubleshooting.
3. Frequently used GUI apps
3.1 Firefox
sudo apt install -y firefox
firefoxBrowse HTTPS sites and use DevTools through WSL Ubuntu's Firefox. GPU acceleration is limited compared to macOS Safari or Windows-native Firefox, so heavy sites feel slightly slower.
3.2 Text editors (gedit, gnome-text-editor)
sudo apt install -y gnome-text-editor
gnome-text-editor /etc/hostsUseful for quick sudo editing when you prefer a GUI over nano.
3.3 Image editing (GIMP)
sudo apt install -y gimp
gimpNot as fast as Photoshop, but the Linux build works as-is.
3.4 GUI debugger (ddd, gdb-gui)
sudo apt install -y ddd
ddd ./my_programIf you use VS Code Remote-WSL, you don't really need ddd, but it's there if you want a classic GUI debugger.
3.5 Wireshark (network analysis)
sudo apt install -y wireshark
sudo wiresharkCaptures WSL's virtual network interface. To capture the Windows host's traffic directly, you need additional setup (wsl --networkingMode=mirrored — Windows 11 22H2+).
4. Wayland vs X11 — auto-selected
WSLg supports both protocols and both env vars are set automatically:
echo $DISPLAY
# :0
echo $WAYLAND_DISPLAY
# wayland-0- Wayland first — modern GTK/Qt apps auto-select Wayland (
GDK_BACKEND=waylandby default) - X11 fallback — apps without Wayland support fall back to
DISPLAY=:0
Force a specific protocol for a particular app:
# Force X11
GDK_BACKEND=x11 firefox
# Force Wayland
GDK_BACKEND=wayland firefox5. GPU acceleration
WSLg exposes a vGPU (virtualized GPU) for OpenGL/Vulkan acceleration. CUDA workloads also work.
Check
sudo apt install -y mesa-utils
glxinfo | grep "OpenGL renderer"
# OpenGL renderer string: D3D12 (NVIDIA GeForce RTX ...) — host GPU exposedUse cases
- 3D apps like Blender / Maya
- ML visualization (TensorBoard, Plotly Dash)
- Games (limited performance but they run)
CUDA: the NVIDIA WSL driver is installed on the Windows side (https://developer.nvidia.com/cuda/wsl). Inside Linux you only need
nvidia-cuda-toolkit.
6. Audio, mic, webcam
WSLg also wires up PulseAudio automatically — audio output is routed to Windows' default output.
sudo apt install -y pavucontrol
speaker-test -c 2 # left/right speaker testMics and webcams are trickier:
- Mic: open
pavucontrol→ Recording tab → the Windows mic shows up (usually OK) - Webcam: WSLg doesn't directly support USB cameras. Use usbipd-win to attach USB devices
7. Pin Linux apps to the Windows Start menu
WSLg registers them automatically:
Win → search "Firefox" → Firefox (Ubuntu) entry → click and WSL boots and Firefox opens.
The visible apps come from ~/.local/share/applications/*.desktop (Linux). Register a custom app by writing your own .desktop file:
cat > ~/.local/share/applications/my-app.desktop <<'EOF'
[Desktop Entry]
Type=Application
Name=My Tool
Exec=/usr/local/bin/mytool
Icon=utilities-terminal
EOFRestart WSL and it appears in the Start menu.
8. Troubleshooting
xcalc runs but no window appears
- Does
wsl --versionshow aWSLg versionline? wsl --update·wsl --shutdownthen retry- Update the host GPU driver (WSLg 1.0.62+ has mesa software fallback, but some setups still need a GPU)
Fonts are broken (▢▢▢ for non-Latin text)
sudo apt install -y fonts-noto-cjk fonts-nanum
fc-cache -fvClipboard doesn't sync
WSLg auto-syncs text clipboard both ways. If it stops working:
- Is the app Wayland or X11? Wayland apps occasionally drop the clipboard
- Force
GDK_BACKEND=x11and retry
"GTK theme not found"-style warnings
sudo apt install -y adwaita-icon-themeDefault GTK theme is missing. Rare; occurs in some minimal Ubuntu images.
Some keystrokes don't reach the GUI app
Ctrl+Shift chords or Korean IME keys get caught by Windows first. Fixes:
- Disable the Windows IME (Win + Space to switch to English)
- Or install
ibus/fcitx5inside Linux and type Korean entirely in Linux
App is sluggish (noticeable UI lag)
- GPU acceleration may have fallen back to software — check with
glxinfo | grep -i hardware - Update the GPU driver
- WSL2 may be RAM-starved — set
memory=8GBin.wslconfig(wsl-tuning)
9. Limitations
- Windows 11 / WSL 2 only — no WSL 1 support
- No system tray / widgets — Linux tray icons don't show
- Multi-monitor is fine; fractional scaling is rough — at 125%/150% scaling some apps look blurry
- Auto-start / background daemons — to start a Linux systemd service at Windows boot, you need extra plumbing (
systemctl --user+ Windows Task Scheduler)
10. What's next
- WSL tuning: memory / CPU / network — /windows/wsl-tuning
- Docker on WSL2 — /windows/docker-wsl2
- Windows Terminal setup — /windows/windows-terminal-setup
- Cross-OS dev container: /multi-os/dev-container
References
- WSLg GitHub
- WSL official docs
- usbipd-win — attach USB devices
Changelog
- 2026-05-16: First draft. WSLg enablement · common GUI apps · GPU acceleration · audio/mic · Start menu integration · six troubleshooting cases.
Keep reading
- Node.js on Windows — Native vs WSL2, which should you use?
Differences between native Windows Node.js and WSL2 Linux Node.js — setup, troubleshooting, and a decision table by project type.
- Windows dev environment weekly maintenance — one command for MSYS2 · winget · toolchains
A weekly PowerShell script that updates MSYS2 pacman, winget, Scoop, npm globals, rustup, cargo binaries, pipx, and Flutter.
- Docker on Windows — Docker Desktop vs native WSL2 + license pitfalls
Two paths for Docker on Windows: Docker Desktop vs installing the docker engine inside WSL2. Cost / performance / license differences.