# microsoft/wslg architecture

> Architecture diagram of the GitHub repository microsoft/wslg, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/wslg
- Repository: https://github.com/microsoft/wslg

## Overview

WSLg integrates Linux GUI applications into the Windows desktop. A Linux app connects through the system distro’s Wayland/X11 and audio services, while WSLGd prepares the runtime, launches the compositor and audio server, and monitors processes and fonts. A separate remote-application-list channel synchronizes app entries and window identity to Windows, where the DVC plugin maintains Start Menu links. The README documents the user-facing integration; sampled sources show selected launch and callback relationships, not the full runtime wiring.

Main entry points: [`WSLGd/main.cpp`](https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp) (WSLg daemon), [`WSLDVCPlugin/WSLDVCCallback.cpp`](https://github.com/microsoft/wslg/blob/main/WSLDVCPlugin/WSLDVCCallback.cpp) (Windows DVC plugin), [`rdpapplist/server/rdpapplist_main.c`](https://github.com/microsoft/wslg/blob/main/rdpapplist/server/rdpapplist_main.c) (App-list server), [`rdpapplist/rdpapplist_protocol.h`](https://github.com/microsoft/wslg/blob/main/rdpapplist/rdpapplist_protocol.h) (App-list protocol)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["System distro runtime"]
  node_wslgd["WSLg daemon<br/>[main.cpp]"]
  node_process_monitor["Process monitor<br/>[ProcessMonitor.cpp]"]
  node_font_monitor["Font monitor<br/>[FontMonitor.cpp]"]
end

subgraph group_services["GUI services"]
  node_wayland["Wayland compositor<br/>[main.cpp]"]
  node_xwayland["Xwayland server<br/>[main.cpp]"]
  node_pulse["PulseAudio server<br/>[main.cpp]"]
end

subgraph group_appsync["Application integration"]
  node_app_list_server["App-list server<br/>[rdpapplist_main.c]"]
  node_app_list_protocol["App-list protocol"]
  node_dvc_plugin["Windows DVC plugin<br/>[WSLDVCCallback.cpp]"]
  node_plugin_listener["Channel listener"]
  node_file_db[("Link file database<br/>[WSLDVCFileDB.cpp]")]
end

subgraph group_windows["Windows desktop"]
  node_windows_menu["Windows Start Menu<br/>[WSLDVCCallback.cpp]"]
  node_rdp_client["Windows RDP client<br/>[main.cpp]"]
end

node_linux_user(("Linux GUI user"))
node_linux_app["Linux GUI apps"]
node_windows_user(("Windows desktop user"))

node_linux_user -->|"launches"| node_linux_app
node_linux_app -->|"connects to"| node_wayland
node_linux_app -->|"connects to"| node_xwayland
node_linux_app -->|"connects to"| node_pulse
node_wslgd -->|"creates"| node_process_monitor
node_wslgd -->|"creates"| node_font_monitor
node_wslgd -->|"launches"| node_wayland
node_wslgd -->|"launches"| node_pulse
node_wslgd -->|"launches"| node_rdp_client
node_wslgd -.->|"starts with"| node_xwayland
node_app_list_server -->|"uses messages"| node_app_list_protocol
node_dvc_plugin -->|"parses messages"| node_app_list_protocol
node_plugin_listener -->|"creates callback"| node_dvc_plugin
node_dvc_plugin -->|"updates links"| node_file_db
node_dvc_plugin -->|"creates shortcuts"| node_windows_menu
node_rdp_client -.->|"exchanges app list"| node_app_list_server
node_windows_menu -->|"appears for"| node_windows_user

click node_wslgd "https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp"
click node_process_monitor "https://github.com/microsoft/wslg/blob/main/WSLGd/ProcessMonitor.cpp"
click node_font_monitor "https://github.com/microsoft/wslg/blob/main/WSLGd/FontMonitor.cpp"
click node_wayland "https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp"
click node_xwayland "https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp"
click node_pulse "https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp"
click node_app_list_server "https://github.com/microsoft/wslg/blob/main/rdpapplist/server/rdpapplist_main.c"
click node_app_list_protocol "https://github.com/microsoft/wslg/blob/main/rdpapplist/rdpapplist_protocol.h"
click node_dvc_plugin "https://github.com/microsoft/wslg/blob/main/WSLDVCPlugin/WSLDVCCallback.cpp"
click node_plugin_listener "https://github.com/microsoft/wslg/blob/main/WSLDVCPlugin/WSLDVCListenerCallback.cpp"
click node_file_db "https://github.com/microsoft/wslg/blob/main/WSLDVCPlugin/WSLDVCFileDB.cpp"
click node_windows_menu "https://github.com/microsoft/wslg/blob/main/WSLDVCPlugin/WSLDVCCallback.cpp"
click node_rdp_client "https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_wslgd,node_process_monitor,node_font_monitor,node_linux_user,node_linux_app,node_windows_user toneBlue
class node_wayland,node_xwayland,node_pulse toneAmber
class node_app_list_server,node_app_list_protocol,node_dvc_plugin,node_plugin_listener,node_file_db toneMint
class node_windows_menu,node_rdp_client toneRose
```

## Components

### System distro runtime

- [WSLg daemon](https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp): `WSLGd/main.cpp`
- [Process monitor](https://github.com/microsoft/wslg/blob/main/WSLGd/ProcessMonitor.cpp): `WSLGd/ProcessMonitor.cpp`
- [Font monitor](https://github.com/microsoft/wslg/blob/main/WSLGd/FontMonitor.cpp): `WSLGd/FontMonitor.cpp`

### GUI services

- [Wayland compositor](https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp): `WSLGd/main.cpp`
- [Xwayland server](https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp): `WSLGd/main.cpp`
- [PulseAudio server](https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp): `WSLGd/main.cpp`

### Application integration

- [App-list server](https://github.com/microsoft/wslg/blob/main/rdpapplist/server/rdpapplist_main.c): `rdpapplist/server/rdpapplist_main.c`
- [App-list protocol](https://github.com/microsoft/wslg/blob/main/rdpapplist/rdpapplist_protocol.h): `rdpapplist/rdpapplist_protocol.h`
- [Windows DVC plugin](https://github.com/microsoft/wslg/blob/main/WSLDVCPlugin/WSLDVCCallback.cpp): `WSLDVCPlugin/WSLDVCCallback.cpp`
- [Channel listener](https://github.com/microsoft/wslg/blob/main/WSLDVCPlugin/WSLDVCListenerCallback.cpp): `WSLDVCPlugin/WSLDVCListenerCallback.cpp`
- [Link file database](https://github.com/microsoft/wslg/blob/main/WSLDVCPlugin/WSLDVCFileDB.cpp): `WSLDVCPlugin/WSLDVCFileDB.cpp`

### Windows desktop

- [Windows Start Menu](https://github.com/microsoft/wslg/blob/main/WSLDVCPlugin/WSLDVCCallback.cpp): `WSLDVCPlugin/WSLDVCCallback.cpp`
- [Windows RDP client](https://github.com/microsoft/wslg/blob/main/WSLGd/main.cpp): `WSLGd/main.cpp`

### Other components

- **Linux GUI user**
- **Linux GUI apps**
- **Windows desktop user**

## Connections

- Linux GUI user → Linux GUI apps: launches (evidence: `README.md`)
- Linux GUI apps → Wayland compositor: connects to (evidence: `README.md`)
- Linux GUI apps → Xwayland server: connects to (evidence: `README.md`)
- Linux GUI apps → PulseAudio server: connects to (evidence: `README.md`)
- WSLg daemon → Process monitor: creates (evidence: `WSLGd/main.cpp`)
- WSLg daemon → Font monitor: creates (evidence: `WSLGd/main.cpp`)
- WSLg daemon → Wayland compositor: launches (evidence: `WSLGd/main.cpp`)
- WSLg daemon → PulseAudio server: launches (evidence: `WSLGd/main.cpp`)
- WSLg daemon → Windows RDP client: launches (evidence: `WSLGd/main.cpp`)
- WSLg daemon → Xwayland server: starts with (evidence: `WSLGd/main.cpp`)
- App-list server → App-list protocol: uses messages (evidence: `rdpapplist/server/rdpapplist_main.c`)
- Windows DVC plugin → App-list protocol: parses messages (evidence: `WSLDVCPlugin/WSLDVCCallback.cpp`)
- Channel listener → Windows DVC plugin: creates callback (evidence: `WSLDVCPlugin/WSLDVCListenerCallback.cpp`)
- Windows DVC plugin → Link file database: updates links (evidence: `WSLDVCPlugin/WSLDVCCallback.cpp`)
- Windows DVC plugin → Windows Start Menu: creates shortcuts (evidence: `WSLDVCPlugin/WSLDVCCallback.cpp`)
- Windows RDP client → App-list server: exchanges app list
- Windows Start Menu → Windows desktop user: appears for (evidence: `README.md`)
