Weaselway

A Linux desktop on WSL2, rendered on your GPU and shown in a window on Windows.

Work in GNOME, Plasma or another Wayland desktop on a Windows laptop, on up to four monitors. It runs inside WSL2 and feels as fast as a local desktop.

The GNOME desktop in a window on Windows, showing Epiphany and SuperTuxKart.
GNOME in its viewer window on Windows, showing Epiphany and SuperTuxKart.

Why not just WSLg?

WSL already runs Linux GUI apps through WSLg. WSLg shows single app windows, though, and has no way to show a whole desktop. It also copies every frame off the GPU into system memory, then into WSLg's shared memory, and its viewer uploads the frame back to the GPU to show it. Weaselway keeps the frames on the GPU.

Weaselway is for developers whose company gives them a Windows laptop but who want to work in Linux. It also lets you try a Linux desktop without installing a second operating system. You get GNOME's overview, Plasma's panels or a tiling compositor such as Hyprland.

Weaselway

A Linux desktop in a window or fullscreen

  • The whole desktop session runs in WSL and shows up in one window, or in up to four.
  • A shortcut switches a window to fullscreen and back.
  • GNOME, Plasma or another compositor arranges the apps.
  • Each frame stays on the GPU. The desktop draws into a texture that the viewer shows directly.
WSLg

Apps on the Windows desktop

  • Each Linux app opens as its own window on Windows.
  • Windows arranges the app windows.
  • The Linux desktop's panel, workspaces and settings are missing.
  • Linux and Windows apps mix on one desktop, so working with them feels disjointed.
  • Each frame is copied from the GPU to system memory and then into WSLg's shared memory. The viewer uploads it back to the GPU to show it.

Weaselway still needs WSLg turned on, which is the default. When frames cannot be shared on the GPU, they go through shared memory that WSL sets up only for WSLg.

What works

GPU rendering

OpenGL and Vulkan run on your GPU through Mesa, with more than 150 fixes from Weaselway. Frames stay on the GPU all the way to the viewer.

GNOME, Plasma and others

GNOME and Plasma come set up, and the install script also sets up Hyprland. Other Wayland compositors such as sway and niri also work.

Several monitors

Show the desktop as up to four monitors, each in its own window that you can place on any Windows monitor.

Keyboard, mouse and touchpad

Swipe and pinch gestures with three or more fingers reach the desktop, so its own gestures work.

Audio and video calls

Sound plays on Windows, and Linux apps can use the microphone and a USB camera. Video calls work.

Clipboard

Copy and paste text and images between Windows and Linux apps.

USB and Bluetooth

Attach USB devices shared with usbipd-win. Common USB Bluetooth adapters work, for headphones and for signing in with a passkey on your phone.

Laptop battery

The desktop shows the battery charge that Windows reports.

Pick your distro

You need an x86_64 Windows machine with WSL2 and a GPU whose Windows driver supports WSL. The viewer runs from inside WSL, so you install nothing on Windows. Only USB devices need usbipd-win (a tool that shares USB devices with WSL) there.

NixOS

Ready-made image

Download the GNOME or Plasma image from the latest release and import it in PowerShell. Everything comes prebuilt. Existing NixOS-WSL systems can add the NixOS module instead.

wsl --install --from-file \
  nixos-weaselway-gnome-<version>.wsl \
  --name Weaselway
wsl -d Weaselway

Ubuntu

Install script

The script adds weaselway to the GNOME, Plasma or Hyprland packages from Ubuntu. It compiles Mesa and the compositor on your machine, which leaves you time for a coffee.

git clone https://github.com/weaselway/weaselway
cd weaselway
./distro/install.py

Arch Linux

Install script

The script adds weaselway to the GNOME, Plasma or Hyprland packages from Arch Linux or CachyOS. It compiles Mesa and the compositor on your machine, which leaves you time for a coffee. Arch's WSL image needs a user and a few packages first.

git clone https://github.com/weaselway/weaselway
cd weaselway
./distro/install.py

Then start the desktop and open it in a window.

ww-install-viewer-link puts a shortcut on the Windows desktop that does both in one click.

ww-start-session
ww-start-viewer

How it works

Four parts carry each frame from the Linux desktop to your Windows screen.

  1. CompositorGNOME, Plasma, …
  2. dxgdrmvirtual display
  3. weaselwayddraws each frame into a shared texture
  4. ViewerFreeRDP on Windows

A normal Wayland desktop runs inside WSL. WSL has no display device of its own, so the dxgdrm kernel module adds one: a DRM device, the same kind of device that a graphics card gets in /dev/dri. The compositor (mutter, KWin or Hyprland) uses its virtual displays like real monitors, one for each viewer window. Weaselway patches all three compositors for bugs that show up on these virtual displays.

Apps draw on your GPU with OpenGL or Vulkan, through Mesa's d3d12 or dzn driver. With dxgdrm, both drivers can now export a window's buffer as a dma-buf (a handle to GPU memory that another program can open). The compositor then uses the app's buffer directly to draw your desktop, without a copy.

The viewer is FreeRDP built for Windows. When it starts, it shares GPU textures with WSL. Each time the compositor shows a new frame on a virtual display, the weaselwayd daemon draws it into one of these textures, and the viewer puts it on the screen.

If the textures cannot be shared, weaselwayd sends the frames through the shared memory that WSL sets up for WSLg. Keyboard, mouse, touchpad and audio go over the RDP connection between the viewer and WSL. The architecture overview has the details.