WSL
Copilot instructions34k starsChanged 5 months agoMITView on GitHub
ALWAYS reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. WSL is the Windows Subsystem for Linux - a compatibility layer for running Linux binary executables natively on Windows. This repository contains the core Windows components that enable WSL functionality. Use WIL (Windows Implementation Libraries) macros — never bare if (FAILED(hr)): - THROW_IF_FAILED(hr) — throw on HRESULT failure - THROW_HR_IF(hr, condition) — conditional throw -…
- Installs packages
Trending
Quiet since September.about the whole repository
Who's talking about microsoft/WSL
- A Hacker News story“Windows file access performance compared to Linux”Hacker News · Dec 29, 2018 · 518 points
- A Hacker News story“Windows Subsystem For Linux a.k.a. WSL 1.0.0 released”Hacker News · Nov 16, 2022 · 182 points
- @cyberciti.biz“Microsoft made Windows Subsystem for Linux open source (WSL) github.com/microsoft/WSL”Bluesky · May 19, 2025 · 139 likes
- A Hacker News story“Windows Subsystem for Linux 2.0 release”Hacker News · Sep 19, 2023 · 74 points
- NixOS/nixpkgs“[WIP] Windows Subsystem for Linux”GitHub · Jun 13, 2019 · 17 reactions
The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 54
Talked about on Hacker News, GitHub and Bluesky (54 times).
On Hacker News · 24
- Dec 29, 2018Windows file access performance compared to Linux518 points · 278 comments
- Nov 16, 2022Windows Subsystem For Linux a.k.a. WSL 1.0.0 released182 points · 253 comments
- Sep 19, 2023Windows Subsystem for Linux 2.0 release74 points · 67 comments
- Mar 29, 2026WSL's GitHub repository is being hit with a wave of Chinese spam issues9 points · 1 comment
- Feb 3, 2025Microsoft/WSL pull requests taken over by malicious GH action8 points · 1 comment
19 more on Hacker News
- Mar 28, 2023WSL2 Freeze Issue6 points · 2 comments
- May 19, 2025Windows Subsystem for Linux (WSL)5 points · 3 comments
- Feb 3, 2025Microsoft's WSL PRs rewritten with pro-Palestine messages4 points
- Nov 8, 2023Missing source code – GPL compliance? #1074 points · 1 comment
- May 20, 2025WSL(Windows Subsystem for Linux) is now open source3 points · 2 comments
- Apr 7, 2025F2FS in Microsoft's WSL2? Closed without any word3 points · 1 comment
- Dec 7, 2023WSL freeze seems fixed in 2.0.123 points · 4 comments
- Feb 6, 2021Wsl2 sometime corrupt .zsh_history and Git (insider build fix)3 points
- Feb 5, 2020Windows 10 Build 19555 causes problem to WSL 23 points
- Jun 25, 2026Bring back human2 points
- Jun 12, 2022A Windows Engineer Talking about WSL (#issuecomment-425272829)2 points
- Nov 24, 2020WSL2 needs serial port workarounds for Arduino and ESP322 points
- Sep 29, 2026WSL 3.0.11 point
- Sep 17, 2026My first open source feature request1 point
- Jan 13, 2026Chinese localization Issue: command line arguments are translated1 point
- Jul 15, 2022WSL 2 Filesystem Performance is Not Yet Fixed After 3 years1 point
- Nov 4, 2021Git pull/push stuck forever on WSL21 point · 2 comments
- Nov 28, 2020WSL2 serial ports don't work, workarounds for Arduino and ESP321 point
- Jun 8, 2020Nested Virtualization for WSL2 VM #41931 point
On GitHub · 20
- Jun 13, 2019[WIP] Windows Subsystem for Linux — NixOS/nixpkgs17 reactions · 13 comments
- Jul 31, 2024Load kernel modules — nix-community/NixOS-WSL5 reactions · 13 comments
- Jun 27, 2024Do not DNAT packets from WSL2's loopback0 — moby/moby4 reactions · 15 comments
- May 12, 2025Change XDG_RUNTIME_DIR mode from 0777 to 0700 — microsoft/wslg3 reactions · 4 comments
- Feb 25, 2025Don't open exclusive handles when reading shortcuts — microsoft/PowerToys3 reactions · 7 comments
15 more on GitHub
- Jan 31, 2023connect over stdio — containers/gvisor-tap-vsock3 reactions · 10 comments
- Sep 21, 2022Stop restarting processes if they exit more than 10 times in a minute — microsoft/wslg3 reactions · 2 comments
- Oct 18, 2017[Hyper-cli] embed hpm — vercel/hyper3 reactions · 8 comments
- Jun 30, 2026Add support for WSL Containers runtime — microsoft/dcp2 reactions · 4 comments
- Jul 3, 2025Switch WSLg to use new wslinfo --vm-id functonality — microsoft/wslg2 reactions
- May 31, 2024Update Windows.gitignore — github/gitignore2 reactions · 2 comments
- Sep 23, 2022Native systemd support — nix-community/NixOS-WSL2 reactions · 3 comments
- Jan 1, 2022Retry rename on EACCES — esy/esy2 reactions · 2 comments
- Oct 9, 2021Support manually configured resolv.conf — Opticos/GWSL-Source2 reactions · 3 comments
- Feb 18, 2021add additional cause of error 0x80370102 - CPU does not support SLAT — MicrosoftDocs/WSL2 reactions · 2 comments
- Sep 8, 2026fix(wsl2): disable WSLg on headless managed leases — openclaw/crabbox1 reaction · 2 comments
- Aug 25, 2026Fix bug #80056: SPL directory iterators lose entries on 9p filesystems — php/php-src1 reaction
- Aug 24, 2026feat: add WSLC (Windows WSL2 Container) runtime support — ys-ll/uniterm1 reaction
- Mar 5, 2026fix: use `performance.now` to measure test timeout duration — vitest-dev/vitest1 reaction · 4 comments
- Jun 29, 2022Fixes #129, make use of windows git.exe on /mnt/* directory(works only WSL) — justjanne/powerline-go1 reaction
On Bluesky · 10
- May 19, 2025Microsoft made Windows Subsystem for Linux open source (WSL) github.com/microsoft/WSL — @cyberciti.biz139 likes and reposts · 10 replies
- May 19, 2025GitHub - microsoft/WSL: Windows Subsystem for Linux https://github.com/microsoft/WSL — @tech-trending.bsky.social6 likes and reposts
- Jun 22, 2025オープンソースになったWSL実装はこちら。 — @matsuu.bsky.social2 likes and reposts
- May 19, 2025WSLのオープンソース化やばい github.com/microsoft/WSL — @qittu.bsky.social2 likes and reposts
- Mar 29, 2026https://github.com/microsoft/WSL — @tom-doerr.bsky.social1 likes and repost
5 more on Bluesky
- May 21, 2025💎 Hidden Gem! 💎 (1000+ new stars) 📦 microsoft / WSL ⭐ 23,852 (+4,368) 🗒 C++ Windows Subsystem for Linux — @github-trending.bsky.social1 likes and repost · 1 reply
- May 20, 2025| microsoft/WSL: Windows Subsystem for Linux github.com/microsoft/WSL — @knoike.bsky.social1 likes and repost
- May 19, 2025Ahora WSL de Microsoft es open source: github.com/microsoft/WSL — @fuenrob.bsky.social1 likes and repost
- May 19, 2025WSL goes open source… github.com/microsoft/WSL — @ajeetraina.bsky.social1 likes and repost
- Jan 17, 2026(There kind of is a Microsoft Linux :v) — @sigvat.maanebedotten.no0 likes and reposts · 1 reply
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
28 rules. About 0 are common, 4 are distinctive, and 24 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
24
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Windows types: Keep as-is (LPCWSTR, HRESULT, DWORD, ULONG, GUID)
- Very specific: line 22
Use WIL (Windows Implementation Libraries) macros — never bare if (FAILED(hr)):
- Very specific: line 42
Use WIL smart pointers — never raw CloseHandle() or manual cleanup:
- Very specific: line 62
Use wil::srwlock (Slim Reader/Writer locks) with SAL annotations:
- Very specific: line 71
Use MultiByteToWide() / WideToMultiByte() from stringshared.h for conversions
- Very specific: line 72
Use std::format() for formatting (the repo defines std::formatter<std::wstring, char> for wide-to-narrow support)
- Very specific: line 77
Use macros from defs.h to declare copy/move behavior:
- Very specific: line 86
Use #pragma once (no traditional #ifndef include guards)
- Very specific: line 89
Use .h for C-compatible headers, .hpp for C++-only headers
- Distinctive: line 94
Use this single-line format for new files:
- Very specific: line 103
Use wsl::shared::Localization::MessageXxx() static methods for user-facing strings
- Very specific: line 104
Use EMIT_USER_WARNING(Localization::MessageXxx(...)) for non-fatal config warnings
- Very specific: line 105
All new user-facing strings must have entries in localization/strings/en-US/Resources.resw
- Very specific: line 119
Prefer constexpr checks over #ifdef where possible:
- Very specific: line 138
When modifying service interfaces (src/windows/service/inc/):
- Very specific: line 148
When adding settings to src/shared/configfile/:
- Very specific: line 150
Use the ConfigKey template class for type-safe parsing
- Very specific: line 233
Use WSL_TEST_CLASS(Name) — not raw BEGIN_TEST_CLASS
- Very specific: line 234
Use VERIFY_* macros for assertions (VERIFY_ARE_EQUAL, VERIFY_IS_TRUE, etc.)
- Very specific: line 236
Test infrastructure is in test/windows/Common.h
- Very specific: line 252
Run all tests: bin\<platform>\<target>\test.bat
- Very specific: line 254
Run specific test: bin\<platform>\<target>\test.bat /name:<class>::<test>
- Very specific: line 261
Wait for debugger (manual attach): /waitfordebugger
- Very specific: line 284
Note: Only works after Windows build (requires localization/strings/en-US/Resources.resw)
- Distinctive: line 291
Always run before committing:
- Distinctive: line 348
Use WPA (Windows Performance Analyzer) for ETL traces
- Very specific: line 390
Run cmake . to generate solution
- Distinctive: line 396
Run validation commands as needed
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Windows Subsystem for Linux (WSL)
ALWAYS reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
WSL is the Windows Subsystem for Linux - a compatibility layer for running Linux binary executables natively on Windows. This repository contains the core Windows components that enable WSL functionality.
Coding Conventions
Naming
- Classes/Structs:
PascalCase(e.g.,ConsoleProgressBar,DeviceHostProxy) - Functions/Methods:
PascalCase()(e.g.,GetFamilyName(),MultiByteToWide()) - Member variables:
m_camelCase(e.g.,m_isOutputConsole,m_outputHandle) - Local variables:
camelCase(e.g.,distroGuidString,asyncResponse) - Constants:
c_camelCasewithconstexpr(e.g.,constexpr size_t c_progressBarWidth = 58;) - Namespaces: lowercase with
::nesting (e.g.,wsl::windows::common::registry) - Enums:
PascalCaseValue(e.g.,LxssDistributionStateInstalled) - Windows types: Keep as-is (
LPCWSTR,HRESULT,DWORD,ULONG,GUID)
Error Handling
Use WIL (Windows Implementation Libraries) macros — never bare if (FAILED(hr)):
THROW_IF_FAILED(hr)— throw on HRESULT failureTHROW_HR_IF(hr, condition)— conditional throwTHROW_HR_IF_MSG(hr, condition, fmt, ...)— conditional throw with messageTHROW_IF_NULL_ALLOC(ptr)— throw on null allocationTHROW_LAST_ERROR_IF(condition)— throw last Win32 errorRETURN_IF_FAILED(hr)— return HRESULT on failure (no throw)RETURN_LAST_ERROR_IF_EXPECTED(condition)— expected failure pathLOG_IF_FAILED(hr)— log but don't throwCATCH_LOG()— catch and log exceptions
For user-facing errors, set a localized message before throwing:
THROW_HR_WITH_USER_ERROR(E_INVALIDARG, Localization::MessageConfigInvalidBoolean(name, value));At API boundaries (COM interfaces), return HRESULT with out params. Internal code throws exceptions.
Memory Management and RAII
Use WIL smart pointers — never raw CloseHandle() or manual cleanup:
wil::unique_handle— kernel handleswil::com_ptr<T>— COM objectswil::unique_hfile— file handleswil::unique_hkey— registry keyswil::unique_event— eventswil::unique_hlocal_string— HLOCAL stringswil::unique_cotaskmem_string— CoTaskMem strings
For non-standard resource types, use wil::unique_any<Type, Deleter, Fn>.
For cleanup scopes, use wil::scope_exit:
auto cleanup = wil::scope_exit([&] { registry::DeleteKey(LxssKey, guid.c_str()); });
// ... work ...
cleanup.release(); // dismiss on successSynchronization
Use wil::srwlock (Slim Reader/Writer locks) with SAL annotations:
mutable wil::srwlock m_lock;
_Guarded_by_(m_lock) std::vector<Entry> m_entries;Strings
std::wstring/std::wstring_vieware dominant throughout the codebase- Use
MultiByteToWide()/WideToMultiByte()fromstringshared.hfor conversions - Use
std::format()for formatting (the repo definesstd::formatter<std::wstring, char>for wide-to-narrow support) - The
STRING_TO_WIDE_STRING()macro handles compile-time conversion
Copy/Move Semantics
Use macros from defs.h to declare copy/move behavior:
NON_COPYABLE(MyClass);
NON_MOVABLE(MyClass);
DEFAULT_MOVABLE(MyClass);Headers
- Use
#pragma once(no traditional#ifndefinclude guards) - In Windows C++ components, every
.cppfile must start with#include "precomp.h" - Linux-side code (
src/linux/) does not use precompiled headers - Use
.hfor C-compatible headers,.hppfor C++-only headers - Include order is enforced by
.clang-format(precomp first, then system, then project)
Copyright Headers
Use this single-line format for new files:
// Copyright (C) Microsoft Corporation. All rights reserved.Some older files use the block format (/*++ Copyright (c) Microsoft. All rights reserved. ... --*/). Match the surrounding files in the same directory when editing.
Localization
- Use
wsl::shared::Localization::MessageXxx()static methods for user-facing strings - Use
EMIT_USER_WARNING(Localization::MessageXxx(...))for non-fatal config warnings - All new user-facing strings must have entries in
localization/strings/en-US/Resources.resw - In Resources.resw comments, use
{Locked="..."}to prevent translation of.wslconfigproperty key names - Localized files are generated by a separate localization team and regenerated downstream, so translation edits in a GitHub PR cannot be merged (they would be overwritten). This covers the per-locale
localization/strings/<locale>/Resources.reswUI strings and the per-localeintune/<locale>/WSL.admlpolicy templates (anything other than theen-USsources and the neutralintune/WSL.admx). Filing a GitHub issue is the correct path for contributors; seeCONTRIBUTING.md. Ignore this guidance for automated localization-service PRs that are generated by that pipeline. - Community localization reports come in as both GitHub issues and pull requests - when triaging, look for both and file a tracking Bug for each. These are tracked via Bugs in the GCS Azure DevOps project, not merged directly. See
.github/copilot/localization-bugs.mdfor the project coordinates, required fields, andaz boardsworkflow.
Telemetry and Logging
WSL_LOG(Name, ...)— standard trace eventWSL_LOG_DEBUG(Name, ...)— debug-only (compiled out in release viaif constexpr)WSL_LOG_TELEMETRY(Name, Tag, ...)— metrics with privacy tag and version info- Provider:
g_hTraceLoggingProvider, initialized viaWslTraceLoggingInitialize()
Platform Conditionals
Prefer constexpr checks over #ifdef where possible:
if constexpr (wsl::shared::Debug) { /* debug-only code */ }
if constexpr (wsl::shared::Arm64) { /* ARM64-specific code */ }For compiler-specific code, use #ifdef _MSC_VER (Windows) / #ifdef __GNUC__ (Linux).
Formatting
Enforced by .clang-format:
- 130 character column limit
- 4-space indentation, no tabs
- Allman-style braces (opening brace on new line for classes, functions, structs, control statements)
- Left-aligned pointers (
int* ptr, notint *ptr) InsertBraces: true— all control statements must have braces
IDL / COM Conventions
When modifying service interfaces (src/windows/service/inc/):
- Interface attributes on separate lines:
[uuid(...), pointer_default(unique), object] - String params:
[in, unique] LPCWSTRwith[string]for marshaled strings - Handle params:
[in, system_handle(sh_file)] HANDLE - User-facing errors: pass
[in, out] LXSS_ERROR_INFO* Error - ABI stability applies only to SDK-facing and public surfaces.
WSLCCompat.idl(the WSLC SDK-facing layer) and the public plugin API (WslPluginApi.h) must stay backward compatible: do not add, remove, or reorder methods on their existing interfaces, and do not change struct layouts. Introduce a new versioned interface with a new IID instead. Every other interface (IWSLCSessioninwslc.idl, the interfaces inwslservice.idl, etc.) is internal and non-stable: rebuilt and shipped in lockstep with its only clients, so appending new methods to those is fine. - Custom error codes:
WSL_E_xxxviaMAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, WSL_E_BASE + N)
Config File (.wslconfig) Conventions
When adding settings to src/shared/configfile/:
- Format is
.gitconfig-style INI:[section],key = value,#comments,\line continuation - Use the
ConfigKeytemplate class for type-safe parsing - Supported types:
bool,int(hex/octal),std::string,std::wstring,MemoryString,MacAddress, enum maps - Report invalid values with
EMIT_USER_WARNING(Localization::MessageConfigXxx(...)) - New settings require a corresponding localization string in Resources.resw
Repository Navigation
Key Directories
src/windows/— Main Windows WSL service componentssrc/linux/— Linux-side WSL componentssrc/shared/— Shared code between Windows and Linuxtest/windows/— Windows-based tests (TAEF framework)test/linux/unit_tests/— Linux unit test suitedoc/— Documentation source (MkDocs)tools/— Build and deployment scriptsdistributions/— Distribution validation and metadatalocalization/— Localized string resources
Namespace → Directory Map
| Namespace | Location |
wsl::shared:: | src/shared/ |
wsl::windows::common:: | src/windows/common/ |
wsl::windows::service:: | src/windows/service/exe/ |
wsl::core:: | src/windows/service/exe/ |
wsl::core::networking:: | src/windows/common/ + src/windows/service/exe/ |
wsl::linux:: | src/linux/init/ |
Key Files
src/shared/inc/defs.h— Shared platform definitions (NON_COPYABLE, Debug, Arm64, etc.)src/shared/inc/stringshared.h— String conversion utilitiessrc/windows/common/WslTelemetry.h— Telemetry macrossrc/windows/common/ExecutionContext.h— Error context and user-facing error macrossrc/windows/service/inc/wslservice.idl— Main service COM interface definitionssrc/windows/service/inc/wslc.idl— Container COM interface definitionssrc/windows/inc/WslPluginApi.h— Plugin API headersrc/shared/configfile/configfile.h— Config file parser.clang-format— Code formatting rules (130 col, 4-space indent, Allman braces)
Building and Deploying
Critical Platform Requirements
- Full builds ONLY work on Windows with Visual Studio and Windows SDK 26100
- DO NOT attempt to build the main WSL components on Linux — they require Windows-specific APIs, MSBuild, and Visual Studio toolchain
- Many validation and development tasks CAN be performed on Linux (documentation, formatting, Python validation scripts)
Windows Build Requirements
- CMake >= 3.25 (
winget install Kitware.CMake) - Visual Studio with these components:
- Windows SDK 26100
- MSBuild
- Universal Windows platform support for v143 build tools (X64 and ARM64)
- MSVC v143 - VS 2022 C++ ARM64 build tools (Latest + Spectre) (X64 and ARM64)
- C++ core features
- C++ ATL for latest v143 tools (X64 and ARM64)
- C++ Clang compiler for Windows
- .NET desktop development
- .NET WinUI app development tools
- Enable Developer Mode in Windows Settings OR run with Administrator privileges (required for symbolic link support)
Building WSL (Windows Only)
- Clone the repository
- Generate Visual Studio solution:
cmake . - Build:
cmake --build . -- -mOR openwsl.slnin Visual Studio
Build parameters:
cmake . -A arm64— Build for ARM64cmake . -DCMAKE_BUILD_TYPE=Release— Release buildcmake . -DBUILD_BUNDLE=TRUE— Build bundle MSIX package (requires ARM64 built first)
Deploying WSL (Windows Only)
- Install MSI:
bin\<platform>\<target>\wsl.msi - OR use script:
powershell tools\deploy\deploy-to-host.ps1 - For Hyper-V VM:
powershell tools\deploy\deploy-to-vm.ps1 -VmName <vm> -Username <user> -Password <pass>
Testing
Writing Tests (TAEF Framework)
Tests use TAEF. See .github/copilot/test.md for detailed patterns and macros.
Key points:
- Use
WSL_TEST_CLASS(Name)— not rawBEGIN_TEST_CLASS - Use
VERIFY_*macros for assertions (VERIFY_ARE_EQUAL,VERIFY_IS_TRUE, etc.) - Skip macros:
WSL1_TEST_ONLY(),WSL2_TEST_ONLY(),SKIP_TEST_ARM64() - Test infrastructure is in
test/windows/Common.h
Running Tests (Windows Only)
CRITICAL: ALWAYS build the ENTIRE project before running tests:
cmake --build . -- -m
bin\<platform>\<target>\test.batWhy full build is required:
- Tests depend on multiple components (libwsl.dll, wsltests.dll, wslservice.exe, etc.)
- Partial builds will cause test failures
- DO NOT skip the full build step even if only one file changed
Test execution:
- Run all tests:
bin\<platform>\<target>\test.bat - Run subset:
bin\<platform>\<target>\test.bat /name:*UnitTest* - Run specific test:
bin\<platform>\<target>\test.bat /name:<class>::<test> - WSL1 tests: Add
-Version 1flag - Fast mode (after first run): Add
-fflag (requireswsl --set-default test_distro) - Requires Administrator privileges
Test debugging:
- Attach WinDbgX automatically:
/attachdebugger - Wait for debugger (manual attach):
/waitfordebugger - Break on failure:
/breakonfailure - Run in-process:
/inproc
Linux Unit Tests (Linux Only)
- Location:
test/linux/unit_tests/ - Build script:
test/linux/unit_tests/build_tests.sh - Note: Requires specific Linux build environment setup not covered in main build process
Cross-Platform Validation Tasks
Documentation (Works on Linux/Windows)
- Install tools:
pip install mkdocs-mermaid2-plugin mkdocs --break-system-packages - Build docs:
mkdocs build -f doc/mkdocs.yml - Output location:
doc/site/ - Note: May show warnings about mermaid CDN access on restricted networks
Code Formatting and Validation
- Format all source (Windows, requires
cmake .first):.\FormatSource.ps1 - Format check (Linux/cross-platform):
clang-format --dry-run --style=file <files> - Validate copyright headers:
python3 tools/devops/validate-copyright-headers.py- Note: Will report missing headers in generated/dependency files (
_deps/), which is expected
- Note: Will report missing headers in generated/dependency files (
- Validate localization:
python3 tools/devops/validate-localization.py- Note: Only works after Windows build (requires
localization/strings/en-US/Resources.resw)
- Note: Only works after Windows build (requires
Distribution Validation (Limited on Linux)
- Validate distribution info:
python3 distributions/validate.py distributions/DistributionInfo.json - Note: May fail on Linux due to network restrictions accessing distribution URLs
Pre-commit Checklist
Always run before committing:
.\FormatSource.ps1to verify formatting on changed C++ filespython3 tools/devops/validate-copyright-headers.py(ignore_deps/warnings)mkdocs build -f doc/mkdocs.ymlif documentation changed- Full Windows build if core components changed
Note: The .gitignore properly excludes build artifacts (*.sln, *.dll, *.pdb, obj/, bin/, etc.) — do not commit these files.
Frequently Used Commands
Windows Development
# Initial setup
cmake .
cmake --build . -- -m
# Deploy and test
powershell tools\deploy\deploy-to-host.ps1
wsl --version
# Run tests
bin\x64\debug\test.batCross-Platform Validation
# Documentation
mkdocs build -f doc/mkdocs.yml
# Code formatting (Windows)
.\FormatSource.ps1
# Copyright header validation (reports expected issues in _deps/)
python3 tools/devops/validate-copyright-headers.py
# Distribution validation (may fail on networks without external access)
python3 distributions/validate.py distributions/DistributionInfo.jsonDebugging and Logging
ETL Tracing (Windows Only)
# Collect traces
wpr -start diagnostics\wsl.wprp -filemode
# [reproduce issue]
wpr -stop logs.ETL
# Available profiles:
# - WSL (default) - General WSL tracing
# - WSL-Storage - Enhanced storage tracing
# - WSL-Networking - Comprehensive networking tracing
# - WSL-HvSocket - HvSocket-specific tracing
# Example: wpr -start diagnostics\wsl.wprp!WSL -filemodeLog Analysis Tools
- Use WPA (Windows Performance Analyzer) for ETL traces
- Key providers:
Microsoft.Windows.Lxss.Manager,Microsoft.Windows.Subsystem.Lxss - For graphical/audio (WSLg) issues, see
.github/copilot/wslg-logs.md.collect-wsl-logs.ps1gathers WSLg logs (/mnt/wslg: weston.log, pulseaudio.log, wlog.log, stderr.log, versions.txt) into awslg/folder usingwsl.exe --system --user root; crash dumps (%TEMP%\wsl-crashes, legacy/mnt/wslg/dumps) are only collected with-Dump. WSLg code lives in https://github.com/microsoft/wslg, not this repo.
Debug Console (Linux)
Add to %USERPROFILE%\.wslconfig:
[wsl2]
debugConsole=trueCommon Debugging Commands
- Debug shell:
wsl --debug-shell - Collect WSL logs:
powershell diagnostics\collect-wsl-logs.ps1 - Network logs:
powershell diagnostics\collect-wsl-logs.ps1 -LogProfile networking
Timing and Timeout Guidelines
NEVER CANCEL these operations — always wait for completion:
| Operation | Typical Duration | Minimum Timeout |
| Full Windows build | 20-45 minutes | 60+ minutes |
| Full test suite | 30-60 minutes | 90+ minutes |
| Unit test subset | 5-15 minutes | 30+ minutes |
| Documentation build | ~0.5 seconds | 5+ minutes |
| Distribution validation | 2-5 minutes | 15+ minutes |
CI/CD Integration
GitHub Actions
- distributions.yml — Validates distribution metadata (Linux)
- documentation.yml — Builds and deploys docs (Linux)
- modern-distributions.yml — Tests modern distribution support
Development Environment Setup
Windows (Full Development)
- Install Visual Studio with required components (listed above)
- Install CMake 3.25+
- Enable Developer Mode
- Clone repository
- Run
cmake .to generate solution
Linux (Documentation/Validation Only)
- Install Python 3.8+
- Install docs tools:
pip install mkdocs-mermaid2-plugin mkdocs - Clone repository
- Run validation commands as needed
Remember: This is a Windows-focused project. While some tasks can be performed on Linux, full WSL development requires Windows with Visual Studio.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

