devAlice
← Windows

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+), all of that disappeared — Linux apps just open as Windows windows.

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

  1. wsl --version — if both WSL version 2.0+ and WSLg 1.0+ show up, you're set
  2. wsl --update for the latest version
  3. sudo apt install -y x11-appsxcalc — if a calculator opens as a Windows window, success
  4. No DISPLAY config needed — WSLg injects it automatically
  5. Wayland apps get WAYLAND_DISPLAY, X11 apps get DISPLAY=: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 Weston compositor 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 OK

If WSLg isn't listed, update:

wsl --update
wsl --shutdown

Test:

# Inside WSL Ubuntu
sudo apt update && sudo apt install -y x11-apps
xcalc          # or xeyes / xclock

A 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
firefox

Browse 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/hosts

Useful for quick sudo editing when you prefer a GUI over nano.

3.3 Image editing (GIMP)

sudo apt install -y gimp
gimp

Not 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_program

If 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 wireshark

Captures 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=wayland by 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 firefox

5. 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 exposed

Use 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 test

Mics 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
EOF

Restart WSL and it appears in the Start menu.


8. Troubleshooting

xcalc runs but no window appears

  • Does wsl --version show a WSLg version line?
  • wsl --update·wsl --shutdown then 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 -fv

Clipboard 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=x11 and retry

"GTK theme not found"-style warnings

sudo apt install -y adwaita-icon-theme

Default 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 / fcitx5 inside 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=8GB in .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


References

Changelog

  • 2026-05-16: First draft. WSLg enablement · common GUI apps · GPU acceleration · audio/mic · Start menu integration · six troubleshooting cases.

Comments