-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Collect WSLg logs in collect-wsl-logs.ps1 #40913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
benhillis
wants to merge
6
commits into
master
Choose a base branch
from
benhillis/wslg-log-collection
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+150
−0
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
51c4901
Collect WSLg logs in collect-wsl-logs.ps1
4f23851
Pass WSLg dest path as sh argument to handle quotes safely
9c66ebe
Address review: timeout, --system, and gate WSLg dumps behind -Dump
af22996
Use --system --user root for WSLg log collection
15ca627
collect-wsl-logs: address WSLg review feedback
1d6641a
collect-wsl-logs: use New-Item -Force for the wslg folder instead of …
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # Analyzing WSLg logs | ||
|
|
||
| WSLg is the component that runs graphical (GUI) and audio Linux applications on WSL. Its | ||
| source lives in a separate repository: https://github.com/microsoft/wslg. The canonical list | ||
| of diagnostics to request for a WSLg bug is the WSLg repo bug report template | ||
| (`.github/ISSUE_TEMPLATE/bug_report.yml` in microsoft/wslg). | ||
|
|
||
| `diagnostics/collect-wsl-logs.ps1` collects the logs into a `wslg/` subfolder of the log archive | ||
| (via `wsl.exe --system --user root`, with a timeout so a wedged service can't hang collection), so a | ||
| standard WSL log collection already contains the log files below. Crash dumps (`dumps/`, | ||
| `wsl-crashes/`) are only collected when the script is run with `-Dump`. | ||
|
|
||
| ## Architecture (just enough to read the logs) | ||
|
|
||
| WSLg runs a **system distro** (a small Azure Linux VM, separate from the user distro) that hosts: | ||
| - **weston** (Wayland compositor) with the `rdp-backend.so` / `rdprail-shell.so` modules | ||
| - **Xwayland** for X11 apps | ||
| - **pulseaudio** with an RDP sink/source for audio | ||
| - **FreeRDP** to stream the surfaces over an hvsocket to the Windows RDP client (`msrdc.exe`) | ||
|
|
||
| `weston.log` and `wlog.log` are written by weston/FreeRDP, `pulseaudio.log` by pulseaudio, and | ||
| `stderr.log` is the combined stderr of `WSLGd` and the processes it launches. | ||
|
|
||
| ## Files (in the `wslg/` folder, sourced from `/mnt/wslg`) | ||
|
|
||
| | File | Contents | | ||
| |---|---| | ||
| | `versions.txt` | WSLg version, architecture, build date, component git hashes (weston, FreeRDP, mesa, pulseaudio) | | ||
| | `weston.log` | Weston compositor + RDP backend log | | ||
| | `wlog.log` | FreeRDP (WLog) log | | ||
| | `pulseaudio.log` | PulseAudio log | | ||
| | `stderr.log` | `WSLGd` and child-process stderr | | ||
| | `dumps/` | Legacy WSLg crash dumps (older builds only; collected with `-Dump`) | | ||
| | `wsl-crashes/` | Host-side WSLg crash dumps copied from `%TEMP%\wsl-crashes` (newer builds, e.g. `core.weston`; collected with `-Dump`) | | ||
|
|
||
| ## Reading tips and common signatures | ||
|
|
||
| - **`weston.log` is truncated on every boot.** Weston is started with `--log=/mnt/wslg/weston.log` | ||
| and opens it truncating, so the file only ever contains the **latest** system-distro boot. To | ||
| tell whether weston restarted, compare the boot timestamp on the first line (`weston 9.0.0 ...`) | ||
| across snapshots, or correlate with `dmesg`. | ||
|
|
||
| - **System distro cycling / teardown.** In `dmesg` (collected via the ETL `GuestLog` events or | ||
| the debug console), this pair means the WSLg system distro's `init` exited and the distro was | ||
| torn down (idle timeout or shutdown), which also restarts weston: | ||
| ``` | ||
| Exception: Operation canceled @p9io.cpp:258 (AcceptAsync) | ||
| WSL (1 - init()) ERROR: InitEntryUtilityVm:2551: Init has exited. Terminating distribution | ||
| ``` | ||
| Repeating every ~25-60s with no GUI client attached is usually normal idle teardown, not a crash. | ||
| A genuine weston crash instead leaves a core dump in `wsl-crashes/` (or `dumps/`). | ||
|
|
||
| - **No GPU acceleration (software rendering).** This means the virtual GPU (`/dev/dxg`, d3d12 mesa) | ||
| is not usable, so rendering falls back to CPU: | ||
| ``` | ||
| Xwayland glamor: GBM Wayland interfaces not available | ||
| Failed to initialize glamor, falling back to sw | ||
| ``` | ||
| Investigate GPU driver presence, `/dev/dxg`, and the `mesa`/`d3d12` stack if the user reports | ||
| black windows, slow rendering, or missing 3D. | ||
|
|
||
| - **Audio sink not connected (usually benign at boot).** Expected until an RDP/audio client attaches: | ||
| ``` | ||
| [rdp-sink] RDP Sink - Trying to connect to /mnt/wslg/PulseAudioRDPSink | ||
| [rdp-sink] Connected failed | ||
| ``` | ||
| If it persists while audio is actively broken, look at the RDP client (`msrdc`) audio channel. | ||
|
|
||
| - **Mostly-benign startup noise** (not a root cause on its own): | ||
| - `WSLGd: Exception: No such file or directory @FontMonitor.cpp:280` - font share not mounted. | ||
| - `XDG_RUNTIME_DIR "/mnt/wslg/runtime-dir" ... mode 040777` (should be 0700) - common warning. | ||
| - `dbus: Unknown username "pulse"` / `Option "-listen" is deprecated` - harmless. | ||
|
|
||
| ## When to escalate to the WSLg repo | ||
|
|
||
| WSLg code is not in this repository. Fixes to weston, FreeRDP, pulseaudio, or the RDP backend | ||
| belong in https://github.com/microsoft/wslg. Use a commit-pinned permalink when referencing files | ||
| there so the link does not drift, e.g. | ||
| `https://github.com/microsoft/wslg/blob/<commit-sha>/<path>`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.