Compare commits

...

59 Commits

Author SHA1 Message Date
Blue
1897d055dd
Rethink the Accept() logic to differentiate between errors and cancellation (#14156)
* Bring relay changes

* Redesign Accept() logic to differenciate between cancellation and errors

* Prepare for PR

* Apply PR feedback
2026-02-04 11:02:25 -08:00
Ben Hillis
8ae97be650
virtiofs: exit QueryVirtiofsMountSource early if virtiofs disabled (#14149)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-03 18:02:54 -08:00
Blue
404aec60ba
Remove invalid asserts from WslMirroredNetworking.cpp (#14151) 2026-02-03 16:05:44 -08:00
Blue
dc82161f7a
Document various tips to iterate faster when building & deploying WSL (#14146) 2026-02-03 11:07:27 -08:00
Ben Hillis
8aadbb4da5
DNS: Simplify dns logic and switch to using 'search' instead of 'domain' which is obsolete. (#14133)
* DNS: Simplify dns logic and switch to using 'search' instead of 'domain'
which is obsolete.

* add optional header for natnetworking

* format

* extend configuration test for virtioproxy networking mode

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-02 16:06:46 -08:00
Arch Linux Technical User
b8e9351958
archlinux: Release 2026.02.01.158360 (#14143)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2026-02-02 11:10:55 -08:00
Blue
cf742f0186
Localization change from build: 138754557 (#14140)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-01-31 07:52:22 -08:00
Ben Hillis
4096e6d77d
virtiofs: add support for mounting directories (not just full volumes) (#14073)
* virtiofs: add support for mounting directories (not just full volumes)

* disable virtiofs tests for now

* spelling

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-29 09:16:54 -08:00
Blue
b5c11b15e4
Localization change from build: 138626054 (#14127)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-01-29 08:07:56 -08:00
Blue
05603c86ed
Localization change from build: 138543929 (#14122)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-01-28 09:01:25 -08:00
Ben Hillis
a057ee63ab
cleanup: cleanup for virtio networking dns (#14111)
* cleanup: cleanup for virtio networking dns

* simplify

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-27 11:14:30 -08:00
Blue
608ce7d8f2
Localization change from build: 138459409 (#14114)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-01-27 08:18:42 -08:00
Craig Loewen
49856a2633
Updated enable virtualization error message (#14110)
* Updated enable virtualization error message

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ben Hillis <benhillis@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-26 13:38:45 -08:00
Ben Hillis
081388c5f5
virtiofs: add support for statx syscall (#14087)
* virtiofs: add support for statx syscall

* add statx drvfs test

* skip statx drvfs test on wsl1

* skip stax tests on smb and fat

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-23 14:09:41 -08:00
Ben Hillis
d8cd707384
cleanup: refactor wslrelay and other minor cleanup (#14099)
* cleanup: refactor wslrelay and other minor cleanup

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-23 13:33:31 -08:00
Ben Hillis
b9b108c548
tracing: combine collect-wsl-logs.ps1 and collect-networking-logs.ps1 (#14089)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-22 11:18:54 -08:00
Ben Hillis
e663585eeb
cleanup: refactor console helper class (#14091)
* cleanup: refactor console helper class

* make opening CONIN and CONOUT non-fatal

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-22 11:18:46 -08:00
Ben Hillis
546233d531
cleanup: update GuestDeviceManager to not require passing in class IDs. (#14093)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-22 11:18:39 -08:00
Ben Hillis
a03462f50b
Fix issue with svccommio incorrectly resetting console state in the move operator (#14083)
The ConsoleInput and ConsoleOutput classes used = default move operations, which caused the moved-from temporary's destructor to restore the original console mode (re-enabling ENABLE_PROCESSED_INPUT) after the object was moved into the std::optional. The fix uses emplace() to construct objects directly in-place, avoiding moves entirely. Move operations are now deleted to prevent future misuse.

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-20 13:27:25 -08:00
Ben Hillis
4b23185dfe
cleanup: fix UserConfig.cmake.sample in master branch (#14076)
* cleanup: fix UserConfig.cmake.sample in master branch

* remove incorrect wsldevicehost.dll handling, wix file always uses the version from the bin folder

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-16 15:30:05 -08:00
Ben Hillis
116f8d6bf5
Packages: Update Microsoft.WSLg version 1.0.73 (#14066)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-16 11:11:35 -08:00
Blue
76d040c3b4
Remove configfile dependency on common (#14071) 2026-01-16 10:52:54 -08:00
Ben Hillis
e2a7b1d168
cleanup: refactor svccommio class (#13843)
* cleanup: refactor svccommio class

* add logging if setting code page fails

* pr feedback

* remove unneeded if

* remove unneeded if

* pr feedbacK'

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-14 12:24:04 -08:00
Ben Hillis
87ed36a1e4
diagnostics: combine wprp files in a single one with profiles (#14048)
* diagnostics: combine wprp files in a single one with profiles

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-14 09:26:46 -08:00
Blue
21e60dcfb2
Localization change from build: 137534777 (#14059)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-01-13 15:46:54 -08:00
rfu-cn
2a84749f91
Update eLxr distribution name (#14032)
Keep command-line install/unregister eLxr operations consistent
2026-01-13 17:09:24 -05:00
Blue
0a2f80d2cd
Localization change from build: 137487010 (#14057)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-01-13 10:56:13 -08:00
Ben Hillis
d27b648830
Update to Azure Linux 3 (#14049)
* Update StartDhcpClient to use dhcpcd which is the Azure Linux 3 equivalent
* Update Microsoft.WSLg to version 1.0.72 which moves to Azure Linux 3
2026-01-13 09:15:15 -08:00
Ben Hillis
5e09668fb7
TEST: Add testcases to validated bridged networking connectivity (#14042)
* TEST: Add testcases to validated bridged networking connectivity

* minor bridged test updates

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-09 13:56:01 -08:00
rfu-cn
94df1253b2
Add eLxr official WSL image to the distribution manifest (#14022)
Update DistributionInfo.json to add "eLxr" section to "ModenDistributions".
This commit adds eLxr to the Microsoft WSL's official distribution manifest,
allowing users to pull and install it in an automated way (`wsl --install eLxr`).
2026-01-06 14:31:16 -08:00
Scott Bradnick
e31c701ce9
Update openSUSE Tumbleweed v20260106.0 (#14024)
Updating .appx and .wsl offerings.
2026-01-06 14:30:26 -08:00
Ben Hillis
6f47fa9b20
diagnostics: improve logging of hcs helper utilities on debug builds (#13971)
* diagnostics: improve logging of hcs helper utilities on debug builds

* implement pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-01-06 10:07:02 -08:00
Blue
02105ba11f
Add WindowsTerminal.enabled to the list of config keys for wsl-distribution.conf (#14021) 2026-01-05 13:49:50 -08:00
Arch Linux Technical User
a5b990e91a
archlinux: Release 2026.01.01.156076 (#14011)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2026-01-02 10:29:35 -08:00
Blue
7ced2d6bd1
Localization change from build: 136690255 (#14003)
Co-authored-by: WSL localization <noreply@microsoft.com>
2025-12-31 10:42:35 -08:00
Ben Hillis
cec99af70a
tracing: add WSLA trace provider to wsl.wprp (#13953)
* tracing: add WSLA trace provider to wsl.wprp

* Initial plan

* Add wslaservice to Profile section in wsl.wprp

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>
2025-12-23 13:06:46 -08:00
g0tmi1k
d04166095f
Bump Kali to 2025.4 (#13961)
Release notes: https://www.kali.org/blog/kali-linux-2025-4-release/
2025-12-23 12:12:55 -08:00
Ben Hillis
f459aef63d
virtiofs: enable test case for mapping virtiofs MAP_PRIVATE (#13964)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-23 09:26:20 -08:00
Masanari Mizuno
f3125bb3a3
docs: Fix version typos in dev-loop.md (#13950) 2025-12-22 11:47:19 -08:00
Salman Chishti
ab0b076db4
Upgrade GitHub Actions to latest versions (#13896) 2025-12-22 11:46:49 -08:00
Ben Hillis
f4b67e3cb4
cleanup: switch drvfs.cpp to use common MountUtil helper (#13890)
* cleanup: switch drvfs.cpp to use common MountUtil helper

* adjust mount.drvfs error logging

* adjust mount.drvfs error logging

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-19 13:34:35 -08:00
Ben Hillis
cb8bc9af67
cleanup: hcs logging improvements (#13942)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-19 13:23:59 -08:00
Ben Hillis
a4f1f7a147
cleanup: add scsi disks during VM creation (#13939)
* cleanup: add scsi disks during VM creation

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-18 19:05:08 -08:00
Ben Hillis
77a35b9a0c
virtiofs: enable additional test cases and skip one racey test (#13933)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-17 14:02:07 -08:00
Ben Hillis
c5fd672847
test: add more path translation variations (#13927)
* test: add more path translation variations

* Update test/windows/SimpleTests.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-16 18:53:04 -08:00
Ben Hillis
d0609393e4
[GH 13837] Remove trailing slash from $XDG_RUNTIME_DIR (#13929)
* [GH 13837] Remove trailing slash from $XDG_RUNTIME_DIR

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-16 18:52:15 -08:00
Blue
1e3ef15f6d
Remove the explicit desktop field when creating a Windows process (#13930) 2025-12-16 18:49:22 -08:00
Ben Hillis
f02f8ef91c
cleanup: remove duplicate AppId registration for wsldevicehost.dll (#13928)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-16 16:30:46 -08:00
Ben Hillis
d48d374c8c
test: extend networking test coverage (#13914)
* test: extend coverage of virtioproxy networking mode

* test: add dns test variations to all networking classes

* remove bridged dns variations

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-16 14:20:26 -08:00
Ben Hillis
c6ac7433b1
Fix minor typo in UserConfig.cmake.sample (.exe instead of .dll) (#13926)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-16 11:37:03 -08:00
Ben Hillis
e24df7e0d1
Resolve issue with buttons on notifications not working correctly (#13921)
* Resolve issue with buttons on notifications not working correctly

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-15 20:50:49 -08:00
Ben Hillis
180d811099
Resolve issue with config file writing sections outside of their expected header. (#13898)
* Resolve issue with config file writing sections outside of their expected header.

* add more writewslconfig variations

* formatting

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-15 13:03:02 -08:00
Blue
9ed5c130f4
Localization change from build: 135812430 (#13905)
* Localization change from build: 135812430

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* remove unused string

---------

Co-authored-by: WSL localization <noreply@microsoft.com>
Co-authored-by: Ben Hillis <benhillis@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-15 13:36:56 -05:00
Ben Hillis
b4c0ced6b8
cleanup: minor tweaks to path translation failed messages (#13892)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-13 10:59:55 -08:00
Ben Hillis
f1e20b21c9
Clean up localhost relay implementation to not rely on procfs parsing. (#13836)
* Clean up localhost relay implementation to not rely on procfs parsing.

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-12 14:18:07 -08:00
Ben Hillis
7f8422654e
test: fix and issue with the test-setup.ps1 script that was preventing it from being run from some version of powershell (#13834)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-12 14:16:47 -08:00
Blue
00b76b1d4b
Notice change from build: 135617549 (#13879)
Co-authored-by: WSL notice <noreply@microsoft.com>
2025-12-12 10:46:46 -08:00
Ben Hillis
8c166d7383
cleanup: remove stale version of wsl.wprp (#13861)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-11 15:37:57 -08:00
Ben Hillis
19f06f9f51
virtiofs: fix an issue where if the VM is launched by an elevated user, non-elevated shells will have elevated virtiofs access. (#13877)
* virtiofs: fix an issue where if the VM is launched by an elevated user, non-elevated shells will have elevated virtiofs access.

* rename keelAlive -> keepAlive

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-12-11 15:21:27 -08:00
118 changed files with 9112 additions and 8314 deletions

View File

@ -66,12 +66,30 @@ Build parameters:
## Testing
### Unit Tests (Windows Only - TAEF Framework)
**CRITICAL: ALWAYS build the ENTIRE project before running tests:**
```powershell
# Build everything first - this is required!
cmake --build . -- -m
# Then run tests
bin\<platform>\<target>\test.bat
```
**Why full build is required:**
- Tests depend on multiple components (libwsl.dll, wsltests.dll, wslservice.exe, etc.)
- Partial builds (e.g., only `configfile` or `wsltests`) will cause test failures
- Changed components must be built together to ensure compatibility
- **DO NOT skip the full build step even if only one file changed**
Test execution:
- Run all tests: `bin\<platform>\<target>\test.bat`
- **NEVER CANCEL: Full test suite takes 30-60 minutes. Set timeout to 90+ minutes.**
- Run subset: `bin\<platform>\<target>\test.bat /name:*UnitTest*`
- Run specific test: `bin\<platform>\<target>\test.bat /name:<class>::<test>`
- WSL1 tests: Add `-Version 1` flag
- Fast mode (after first run): Add `-f` flag (requires `wsl --set-default test_distro`)
- **Requires Administrator privileges** - test.bat will fail without admin rights
Test debugging:
- Wait for debugger: `/waitfordebugger`
@ -155,6 +173,13 @@ python3 distributions/validate.py distributions/DistributionInfo.json
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 -filemode
```
### Log Analysis Tools
@ -171,7 +196,7 @@ debugConsole=true
### Common Debugging Commands
- Debug shell: `wsl --debug-shell`
- Collect WSL logs: `powershell diagnostics\collect-wsl-logs.ps1`
- Network logs: `powershell diagnostics\collect-networking-logs.ps1`
- Network logs: `powershell diagnostics\collect-wsl-logs.ps1 -LogProfile networking`
## Critical Timing and Timeout Guidelines

View File

@ -26,7 +26,7 @@ jobs:
run: mkdocs build -f doc/mkdocs.yml
shell: bash
- uses: actions/upload-pages-artifact@v3
- uses: actions/upload-pages-artifact@v4
with:
path: doc/site

2
.gitignore vendored
View File

@ -44,7 +44,7 @@ bin/
*.nupkg
build/
generated/
Microsoft.WSL.PluginApi.nuspec
*.nuspec
test/linux/unit_tests/wsl_unit_tests
*.dir/
UserConfig.cmake

View File

@ -394,7 +394,7 @@ stages:
Move-Item -Path "bin\x64\cloudtest" -Destination "$(ob_outputDirectory)\testbin\x64\cloudtest"
Move-Item -Path "tools\test\test-setup.ps1" -Destination "$(ob_outputDirectory)\testbin\test-setup.ps1"
Move-Item -Path "tools\test\CloudTest-Setup.bat" -Destination "$(ob_outputDirectory)\testbin\CloudTest-Setup.bat"
Move-Item -Path "tools\wsl.wprp" -Destination "$(ob_outputDirectory)\testbin\wsl.wprp"
Move-Item -Path "diagnostics\wsl.wprp" -Destination "$(ob_outputDirectory)\testbin\wsl.wprp"
Move-Item -Path "test\linux\unit_tests" -Destination "$(ob_outputDirectory)\testbin\unit_tests"
Move-Item -Path bundle\release\* -Destination $(ob_outputDirectory)\bundle

View File

@ -53,13 +53,18 @@ Install [WPR](https://learn.microsoft.com/windows-hardware/test/wpt/windows-perf
To collect WSL networking logs, do the following steps in an administrative powershell prompt:
```
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-networking-logs.ps1" -OutFile collect-networking-logs.ps1
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-networking-logs.ps1
.\collect-wsl-logs.ps1 -LogProfile networking
```
The script will output when log collection starts. Reproduce the problem, then press any key to stop the log collection.
The script will output the path of the log file once done.
For additional network creation logs (restarts WSL), use:
```
.\collect-wsl-logs.ps1 -LogProfile networking -RestartWslReproMode
```
<!-- Preserving anchors -->
<div id="8-detailed-logs"></div>
<div id="9-networking-logs"></div>
@ -79,6 +84,12 @@ Set-ExecutionPolicy Bypass -Scope Process -Force
```
The script will output the path of the log file once done.
For specific scenarios, you can use different log profiles:
- `.\collect-wsl-logs.ps1 -LogProfile storage` - Enhanced storage tracing
- `.\collect-wsl-logs.ps1 -LogProfile networking` - Comprehensive networking tracing (includes packet capture, tcpdump, etc.)
- `.\collect-wsl-logs.ps1 -LogProfile networking -RestartWslReproMode` - Networking tracing with WSL restart for network creation logs
- `.\collect-wsl-logs.ps1 -LogProfile hvsocket` - HvSocket-specific tracing
### 10) Reporting a Windows crash (BSOD)
To collect a kernel crash dump, first run the following command in an elevated command prompt:

View File

@ -643,6 +643,159 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Microsoft.NETCore.App.Runtime.win-arm64 10.0.0 - MIT
Copyright (c) 2021
Copyright (c) Six Labors
(c) Microsoft Corporation
Copyright (c) 2022 FormatJS
Copyright (c) Andrew Arnott
Copyright 2019 LLVM Project
Copyright (c) 1998 Microsoft
Copyright 2018 Daniel Lemire
Copyright (c) .NET Foundation
Copyright 1995-2022 Mark Adler
Copyright 1995-2024 Mark Adler
Copyright (c) 2011, Google Inc.
Copyright (c) 2020 Dan Shechter
(c) 1997-2005 Sean Eron Anderson
Copyright (c) 2015 Andrew Gallant
Copyright (c) 2022, Wojciech Mula
Copyright (c) 2017 Yoshifumi Kawai
Copyright (c) 2022, Geoff Langdale
Copyright (c) 2005-2020 Rich Felker
Copyright (c) 2012-2021 Yann Collet
Copyright (c) Microsoft Corporation
Copyright (c) 2007 James Newton-King
Copyright (c) 1991-2024 Unicode, Inc.
Copyright (c) 2013-2017, Alfred Klomp
Copyright (c) 2018 Nemanja Mijailovic
Copyright 2012 the V8 project authors
Copyright (c) 1999 Lucent Technologies
Copyright (c) 2008-2016, Wojciech Mula
Copyright (c) 2011-2020 Microsoft Corp
Copyright (c) 2015-2017, Wojciech Mula
Copyright (c) 2015-2018, Wojciech Mula
Copyright (c) 2005-2007, Nick Galbreath
Copyright (c) 2015 The Chromium Authors
Copyright (c) 2018 Alexander Chermyanin
Copyright (c) The Internet Society 1997
Copyright (c) 2004-2006 Intel Corporation
Copyright (c) 2011-2015 Intel Corporation
Copyright (c) 2013-2017, Milosz Krajewski
Copyright (c) 2016-2017, Matthieu Darbois
Copyright (c) The Internet Society (2003)
Copyright (c) .NET Foundation Contributors
(c) 1995-2024 Jean-loup Gailly and Mark Adler
Copyright (c) 2020 Mara Bos <m-ou.se@m-ou.se>
Copyright (c) .NET Foundation and Contributors
Copyright (c) 2012 - present, Victor Zverovich
Copyright (c) 2006 Jb Evain (jbevain@gmail.com)
Copyright (c) 2008-2020 Advanced Micro Devices, Inc.
Copyright (c) 2019 Microsoft Corporation, Daan Leijen
Copyright (c) 2011 Novell, Inc (http://www.novell.com)
Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors
Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com
Copyright 1995-2024 Jean-loup Gailly and Mark Adler Qkkbal
Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
Portions (c) International Organization for Standardization 1986
Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang) Disclaimers
Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip
Copyright (c) 1980, 1986, 1993 The Regents of the University of California
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California
Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass
The MIT License (MIT)
Copyright (c) .NET Foundation and Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
Microsoft.NETCore.App.Runtime.win-x64 10.0.0 - MIT
Copyright (c) 2021
Copyright (c) Six Labors
(c) Microsoft Corporation
Copyright (c) 2022 FormatJS
Copyright (c) Andrew Arnott
Copyright 2019 LLVM Project
Copyright (c) 1998 Microsoft
Copyright 2018 Daniel Lemire
Copyright (c) .NET Foundation
Copyright 1995-2022 Mark Adler
Copyright 1995-2024 Mark Adler
Copyright (c) 2011, Google Inc.
Copyright (c) 2020 Dan Shechter
(c) 1997-2005 Sean Eron Anderson
Copyright (c) 2015 Andrew Gallant
Copyright (c) 2022, Wojciech Mula
Copyright (c) 2017 Yoshifumi Kawai
Copyright (c) 2022, Geoff Langdale
Copyright (c) 2005-2020 Rich Felker
Copyright (c) 2012-2021 Yann Collet
Copyright (c) Microsoft Corporation
Copyright (c) 2007 James Newton-King
Copyright (c) 1991-2024 Unicode, Inc.
Copyright (c) 2013-2017, Alfred Klomp
Copyright (c) 2018 Nemanja Mijailovic
Copyright 2012 the V8 project authors
Copyright (c) 1999 Lucent Technologies
Copyright (c) 2008-2016, Wojciech Mula
Copyright (c) 2011-2020 Microsoft Corp
Copyright (c) 2015-2017, Wojciech Mula
Copyright (c) 2015-2018, Wojciech Mula
Copyright (c) 2005-2007, Nick Galbreath
Copyright (c) 2015 The Chromium Authors
Copyright (c) 2018 Alexander Chermyanin
Copyright (c) The Internet Society 1997
Copyright (c) 2004-2006 Intel Corporation
Copyright (c) 2011-2015 Intel Corporation
Copyright (c) 2013-2017, Milosz Krajewski
Copyright (c) 2016-2017, Matthieu Darbois
Copyright (c) The Internet Society (2003)
Copyright (c) .NET Foundation Contributors
(c) 1995-2024 Jean-loup Gailly and Mark Adler
Copyright (c) 2020 Mara Bos <m-ou.se@m-ou.se>
Copyright (c) .NET Foundation and Contributors
Copyright (c) 2012 - present, Victor Zverovich
Copyright (c) 2006 Jb Evain (jbevain@gmail.com)
Copyright (c) 2008-2020 Advanced Micro Devices, Inc.
Copyright (c) 2019 Microsoft Corporation, Daan Leijen
Copyright (c) 2011 Novell, Inc (http://www.novell.com)
Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors
Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com
Copyright 1995-2024 Jean-loup Gailly and Mark Adler Qkkbal
Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
Portions (c) International Organization for Standardization 1986
Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang) Disclaimers
Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip
Copyright (c) 1980, 1986, 1993 The Regents of the University of California
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California
Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass
The MIT License (MIT)

View File

@ -2,26 +2,36 @@
message(STATUS "Loading user configuration")
# # Uncomment to enable development packages (smaller, faster to install)
# # Note: system.vhd fails to mount if symlink / hardlink, so COPY is needed.
# Uncomment to enable development packages (smaller, faster to install)
# # Note: .vhd files fail to mount via symlink / hardlink, so COPY is needed.
# set(WSL_DEV_BINARY_PATH "C:/wsldev")
# file(MAKE_DIRECTORY ${WSL_DEV_BINARY_PATH})
# file(CREATE_LINK "${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/kernel" "${WSL_DEV_BINARY_PATH}/kernel" SYMBOLIC)
# file(COPY_FILE "${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/system.vhd" "${WSL_DEV_BINARY_PATH}/system.vhd" ONLY_IF_DIFFERENT)
# file(COPY_FILE "${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/modules.vhd" "${WSL_DEV_BINARY_PATH}/modules.vhd" ONLY_IF_DIFFERENT)
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/msrdc.exe" "${WSL_DEV_BINARY_PATH}/msrdc.exe" SYMBOLIC)
# file(CREATE_LINK "${WSLG_SOURCE_DIR}/wslg.rdp" "${WSL_DEV_BINARY_PATH}/wslg.rdp" SYMBOLIC)
# file(CREATE_LINK "${WSLG_SOURCE_DIR}/wslg_desktop.rdp" "${WSL_DEV_BINARY_PATH}/wslg_desktop.rdp" SYMBOLIC)
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdclientax.dll" "${WSL_DEV_BINARY_PATH}/rdclientax.dll" SYMBOLIC)
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdpnanoTransport.dll" "${WSL_DEV_BINARY_PATH}/rdpnanoTransport.dll" SYMBOLIC)
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/RdpWinStlHelper.dll" "${WSL_DEV_BINARY_PATH}/RdpWinStlHelper.dll" SYMBOLIC)
# file(CREATE_LINK "${MSAL_SOURCE_DIR}/${TARGET_PLATFORM}/msal.wsl.proxy.exe" "${WSL_DEV_BINARY_PATH}/msal.wsl.proxy.exe" SYMBOLIC)
# file(CREATE_LINK "${BIN}/wsldevicehost.dll" "${WSL_DEV_BINARY_PATH}/wsldevicehost.exe" SYMBOLIC)
# file(CREATE_LINK "${DIRECT3D_SOURCE_DIR}/lib/${TARGET_PLATFORM}" "${WSL_DEV_BINARY_PATH}/lib" SYMBOLIC)
# foreach(LANG ${SUPPORTED_LANGS})
# file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/${LANG}" "${WSL_DEV_BINARY_PATH}/${LANG}" SYMBOLIC)
# endforeach()
if(WSL_DEV_BINARY_PATH)
file(MAKE_DIRECTORY ${WSL_DEV_BINARY_PATH})
file(CREATE_LINK "${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/kernel" "${WSL_DEV_BINARY_PATH}/kernel" SYMBOLIC)
file(COPY_FILE "${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/system.vhd" "${WSL_DEV_BINARY_PATH}/system.vhd" ONLY_IF_DIFFERENT)
file(COPY_FILE "${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/modules.vhd" "${WSL_DEV_BINARY_PATH}/modules.vhd" ONLY_IF_DIFFERENT)
# read-only VHDs need to be world readable to mount successfully.
execute_process(
COMMAND icacls.exe "${WSL_DEV_BINARY_PATH}/system.vhd" "/grant:r" "Everyone:(R)" /Q
COMMAND icacls.exe "${WSL_DEV_BINARY_PATH}/modules.vhd" "/grant:r" "Everyone:(R)" /Q
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMAND_ERROR_IS_FATAL ANY)
file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/msrdc.exe" "${WSL_DEV_BINARY_PATH}/msrdc.exe" SYMBOLIC)
file(CREATE_LINK "${WSLG_SOURCE_DIR}/wslg.rdp" "${WSL_DEV_BINARY_PATH}/wslg.rdp" SYMBOLIC)
file(CREATE_LINK "${WSLG_SOURCE_DIR}/wslg_desktop.rdp" "${WSL_DEV_BINARY_PATH}/wslg_desktop.rdp" SYMBOLIC)
file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdclientax.dll" "${WSL_DEV_BINARY_PATH}/rdclientax.dll" SYMBOLIC)
file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdpnanoTransport.dll" "${WSL_DEV_BINARY_PATH}/rdpnanoTransport.dll" SYMBOLIC)
file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/RdpWinStlHelper.dll" "${WSL_DEV_BINARY_PATH}/RdpWinStlHelper.dll" SYMBOLIC)
file(CREATE_LINK "${MSAL_SOURCE_DIR}/${TARGET_PLATFORM}/msal.wsl.proxy.exe" "${WSL_DEV_BINARY_PATH}/msal.wsl.proxy.exe" SYMBOLIC)
file(CREATE_LINK "${DIRECT3D_SOURCE_DIR}/lib/${TARGET_PLATFORM}" "${WSL_DEV_BINARY_PATH}/lib" SYMBOLIC)
foreach(LANG ${SUPPORTED_LANGS})
file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/${LANG}" "${WSL_DEV_BINARY_PATH}/${LANG}" SYMBOLIC)
endforeach()
endif()
# # Uncomment to skip building, packaging and installing wslsettings
# set(WSL_BUILD_WSL_SETTINGS false)

View File

@ -1,319 +0,0 @@
#Requires -RunAsAdministrator
[CmdletBinding()]
Param (
$RestartWslReproMode = $false
)
function Collect-WindowsNetworkState {
param (
$ReproStep
)
# Collect host networking state relevant for WSL
# Using a try/catch for commands below, as some of them do not exist on all OS versions
try
{
Get-NetAdapter -includeHidden | select Name,ifIndex,NetLuid,InterfaceGuid,Status,MacAddress,MtuSize,InterfaceType,Hidden,HardwareInterface,ConnectorPresent,MediaType,PhysicalMediaType | Out-File -FilePath "$folder/Get-NetAdapter_$ReproStep.log" -Append
}
catch {}
try
{
& netsh nlm query all $folder/nlmquery_"$ReproStep".log
}
catch {}
try
{
Get-NetIPConfiguration -All -Detailed | Out-File -FilePath "$folder/Get-NetIPConfiguration_$ReproStep.log" -Append
}
catch {}
try
{
Get-NetRoute | Out-File -FilePath "$folder/Get-NetRoute_$ReproStep.log" -Append
}
catch {}
try
{
Get-NetFirewallHyperVVMCreator | Out-File -FilePath "$folder/Get-NetFirewallHyperVVMCreator_$ReproStep.log" -Append
}
catch {}
try
{
Get-NetFirewallHyperVVMSetting -PolicyStore ActiveStore | Out-File -FilePath "$folder/Get-NetFirewallHyperVVMSetting_ActiveStore_$ReproStep.log" -Append
}
catch {}
try
{
Get-NetFirewallHyperVProfile -PolicyStore ActiveStore | Out-File -FilePath "$folder/Get-NetFirewallHyperVProfile_ActiveStore_$ReproStep.log" -Append
}
catch {}
try
{
Get-NetFirewallHyperVRule -PolicyStore ActiveStore | Out-File -FilePath "$folder/Get-NetFirewallHyperVRule_ActiveStore_$ReproStep.log" -Append
}
catch {}
try
{
Get-NetFirewallRule -PolicyStore ActiveStore | Out-File -FilePath "$folder/Get-NetFirewallRule_ActiveStore_$ReproStep.log" -Append
}
catch {}
try
{
Get-NetFirewallProfile -PolicyStore ActiveStore | Out-File -FilePath "$folder/Get-NetFirewallProfile_ActiveStore_$ReproStep.log" -Append
}
catch {}
try
{
Get-NetFirewallHyperVPort | Out-File -FilePath "$folder/Get-NetFirewallHyperVPort_$ReproStep.log" -Append
}
catch {}
try
{
& hnsdiag.exe list all 2>&1 > $folder/hnsdiag_list_all_"$ReproStep".log
}
catch {}
try
{
& hnsdiag.exe list endpoints -df 2>&1 > $folder/hnsdiag_list_endpoints_"$ReproStep".log
}
catch {}
try
{
foreach ($port in Get-NetFirewallHyperVPort)
{
& vfpctrl.exe /port $port.PortName /get-port-state 2>&1 > "$folder/vfp-port-$($port.PortName)-get-port-state_$ReproStep.log"
& vfpctrl.exe /port $port.PortName /list-rule 2>&1 > "$folder/vfp-port-$($port.PortName)-list-rule_$ReproStep.log"
}
}
catch {}
try
{
& vfpctrl.exe /list-vmswitch-port 2>&1 > $folder/vfpctrl_list_vmswitch_port_"$ReproStep".log
}
catch {}
try
{
Get-VMSwitch | select Name,Id,SwitchType | Out-File -FilePath "$folder/Get-VMSwitch_$ReproStep.log" -Append
}
catch {}
try
{
Get-NetUdpEndpoint | Out-File -FilePath "$folder/Get-NetUdpEndpoint_$ReproStep.log" -Append
}
catch {}
}
$folder = "WslNetworkingLogs-" + (Get-Date -Format "yyyy-MM-dd_HH-mm-ss")
mkdir -p $folder
$logProfile = "$folder/wsl_networking.wprp"
$networkingBashScript = "$folder/networking.sh"
# Detect the super user first.
# Actually it's not definite that the super user is named "root". Instead, a user with uid=0 is what we are looking for. See #11693.
$superUser = & wsl.exe -- id -nu 0 # user name of the super user.
# Copy/Download supporting files
if (Test-Path "$PSScriptRoot/wsl_networking.wprp")
{
Copy-Item "$PSScriptRoot/wsl_networking.wprp" $logProfile
}
else
{
Write-Host -ForegroundColor Yellow "wsl_networking.wprp not found in the current directory. Downloading it from GitHub."
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/wsl_networking.wprp" -OutFile $logProfile
}
if (Test-Path "$PSScriptRoot/networking.sh")
{
Copy-Item "$PSScriptRoot/networking.sh" $networkingBashScript
}
else
{
Write-Host -ForegroundColor Yellow "networking.sh not found in the current directory. Downloading it from GitHub."
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/networking.sh" -OutFile $networkingBashScript
}
# Retrieve WSL version and wslconfig file
get-appxpackage MicrosoftCorporationII.WindowsSubsystemforLinux > $folder/appxpackage.txt
$wslconfig = "$env:USERPROFILE/.wslconfig"
if (Test-Path $wslconfig)
{
Copy-Item $wslconfig $folder
}
# Collect Linux & Windows network state before the repro
& wsl.exe -u $superUser -e $networkingBashScript 2>&1 > $folder/linux_network_configuration_before.log
Collect-WindowsNetworkState "before_repro"
if ($RestartWslReproMode)
{
# The WSL HNS network is created once per boot. Resetting it to collect network creation logs.
# Note: The below HNS command applies only to WSL in NAT mode
Get-HnsNetwork | Where-Object {$_.Name -eq 'WSL' -Or $_.Name -eq 'WSL (Hyper-V firewall)'} | Remove-HnsNetwork
# Stop WSL.
net.exe stop WslService
if(-not $?)
{
net.exe stop LxssManager
}
}
# Start logging.
$wprOutputLog = "$folder/wpr.txt"
wpr.exe -start $logProfile -filemode 2>&1 >> $wprOutputLog
if ($LastExitCode -Ne 0)
{
Write-Host -ForegroundColor Yellow "Log collection failed to start (exit code: $LastExitCode), trying to reset it."
wpr.exe -cancel 2>&1 >> $wprOutputLog
wpr.exe -start $logProfile -filemode 2>&1 >> $wprOutputLog
if ($LastExitCode -Ne 0)
{
Write-Host -ForegroundColor Red "Couldn't start log collection (exitCode: $LastExitCode)"
}
}
# Start packet capture using pktmon
pktmon start -c --flags 0x1A --file-name "$folder/pktmon.etl" | out-null
# Start WFP capture
netsh wfp capture start file="$folder/wfpdiag.cab"
# Start tcpdump. Using a try/catch as tcpdump might not be installed
$tcpdumpProcess = $null
try
{
$tcpdumpProcess = Start-Process wsl.exe -ArgumentList "-u $superUser tcpdump -n -i any -e -vvv > $folder/tcpdump.log" -PassThru
}
catch {}
try
{
Write-Host -NoNewLine -ForegroundColor Green "Log collection is running. Please reproduce the problem and press any key to save the logs."
$KeysToIgnore =
16, # Shift (left or right)
17, # Ctrl (left or right)
18, # Alt (left or right)
20, # Caps lock
91, # Windows key (left)
92, # Windows key (right)
93, # Menu key
144, # Num lock
145, # Scroll lock
166, # Back
167, # Forward
168, # Refresh
169, # Stop
170, # Search
171, # Favorites
172, # Start/Home
173, # Mute
174, # Volume Down
175, # Volume Up
176, # Next Track
177, # Previous Track
178, # Stop Media
179, # Play
180, # Mail
181, # Select Media
182, # Application 1
183 # Application 2
$Key = $null
while ($Key -Eq $null -Or $Key.VirtualKeyCode -Eq $null -Or $KeysToIgnore -Contains $Key.VirtualKeyCode)
{
if ([console]::KeyAvailable)
{
$Key = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
}
else
{
Start-Sleep -Seconds 1
}
}
Write-Host "`nSaving logs..."
}
finally
{
try
{
wsl.exe -u $superUser killall tcpdump
if ($tcpdumpProcess -ne $null)
{
Wait-Process -InputObject $tcpdumpProcess -Timeout 10
}
}
catch {}
netsh wfp capture stop
pktmon stop | out-null
wpr.exe -stop $folder/logs.etl 2>&1 >> $wprOutputLog
}
# Collect Linux & Windows network state after the repro
& wsl.exe -u $superUser -e $networkingBashScript 2>&1 > $folder/linux_network_configuration_after.log
Collect-WindowsNetworkState "after_repro"
try
{
# Collect HNS events from past 24 hours
$events = Get-WinEvent -ProviderName Microsoft-Windows-Host-Network-Service | Where-Object { $_.TimeCreated -ge ((Get-Date) - (New-TimeSpan -Day 1)) }
($events | ForEach-Object { '{0},{1},{2},{3}' -f $_.TimeCreated, $_.Id, $_.LevelDisplayName, $_.Message }) -join [environment]::NewLine | Out-File -FilePath "$folder/hns_events.log" -Append
}
catch {}
# Collect the old Tcpip6 registry values - as they can break WSL if DisabledComponents is set to 0xff
# see https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows
try
{
Get-Item HKLM:SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters | Out-File -FilePath "$folder/tcpip6_parameters.log" -Append
}
catch {}
# Collect the setup and NetSetup log files
$netSetupPath = "$env:WINDIR/logs/netsetup"
if (Test-Path $netSetupPath)
{
Copy-Item $netSetupPath/* $folder
}
$setupApiPath = "$env:WINDIR/inf/setupapi.dev.log"
if (Test-Path $setupApiPath)
{
Copy-Item $setupApiPath $folder
}
Remove-Item $logProfile
Remove-Item $networkingBashScript
$logArchive = "$(Resolve-Path $folder).zip"
Compress-Archive -Path $folder -DestinationPath $logArchive
Remove-Item $folder -Recurse
Write-Host -ForegroundColor Green "Logs saved in: $logArchive. Please attach that file to the GitHub issue."

View File

@ -3,40 +3,120 @@
[CmdletBinding()]
Param (
$LogProfile = $null,
[switch]$Dump = $false
[switch]$Dump = $false,
[switch]$RestartWslReproMode = $false
)
Set-StrictMode -Version Latest
function Collect-WindowsNetworkState {
param (
$Folder,
$ReproStep
)
# Collect host networking state relevant for WSL
# Using a try/catch for commands below, as some of them do not exist on all OS versions
try { Get-NetAdapter -includeHidden | select Name,ifIndex,NetLuid,InterfaceGuid,Status,MacAddress,MtuSize,InterfaceType,Hidden,HardwareInterface,ConnectorPresent,MediaType,PhysicalMediaType | Out-File -FilePath "$Folder/Get-NetAdapter_$ReproStep.log" -Append } catch {}
try { & netsh nlm query all $Folder/nlmquery_"$ReproStep".log } catch {}
try { Get-NetIPConfiguration -All -Detailed | Out-File -FilePath "$Folder/Get-NetIPConfiguration_$ReproStep.log" -Append } catch {}
try { Get-NetRoute | Out-File -FilePath "$Folder/Get-NetRoute_$ReproStep.log" -Append } catch {}
try { Get-NetFirewallHyperVVMCreator | Out-File -FilePath "$Folder/Get-NetFirewallHyperVVMCreator_$ReproStep.log" -Append } catch {}
try { Get-NetFirewallHyperVVMSetting -PolicyStore ActiveStore | Out-File -FilePath "$Folder/Get-NetFirewallHyperVVMSetting_ActiveStore_$ReproStep.log" -Append } catch {}
try { Get-NetFirewallHyperVProfile -PolicyStore ActiveStore | Out-File -FilePath "$Folder/Get-NetFirewallHyperVProfile_ActiveStore_$ReproStep.log" -Append } catch {}
try { Get-NetFirewallHyperVRule -PolicyStore ActiveStore | Out-File -FilePath "$Folder/Get-NetFirewallHyperVRule_ActiveStore_$ReproStep.log" -Append } catch {}
try { Get-NetFirewallRule -PolicyStore ActiveStore | Out-File -FilePath "$Folder/Get-NetFirewallRule_ActiveStore_$ReproStep.log" -Append } catch {}
try { Get-NetFirewallProfile -PolicyStore ActiveStore | Out-File -FilePath "$Folder/Get-NetFirewallProfile_ActiveStore_$ReproStep.log" -Append } catch {}
try { Get-NetFirewallHyperVPort | Out-File -FilePath "$Folder/Get-NetFirewallHyperVPort_$ReproStep.log" -Append } catch {}
try { & hnsdiag.exe list all 2>&1 > $Folder/hnsdiag_list_all_"$ReproStep".log } catch {}
try { & hnsdiag.exe list endpoints -df 2>&1 > $Folder/hnsdiag_list_endpoints_"$ReproStep".log } catch {}
try {
foreach ($port in Get-NetFirewallHyperVPort) {
& vfpctrl.exe /port $port.PortName /get-port-state 2>&1 > "$Folder/vfp-port-$($port.PortName)-get-port-state_$ReproStep.log"
& vfpctrl.exe /port $port.PortName /list-rule 2>&1 > "$Folder/vfp-port-$($port.PortName)-list-rule_$ReproStep.log"
}
} catch {}
try { & vfpctrl.exe /list-vmswitch-port 2>&1 > $Folder/vfpctrl_list_vmswitch_port_"$ReproStep".log } catch {}
try { Get-VMSwitch | select Name,Id,SwitchType | Out-File -FilePath "$Folder/Get-VMSwitch_$ReproStep.log" -Append } catch {}
try { Get-NetUdpEndpoint | Out-File -FilePath "$Folder/Get-NetUdpEndpoint_$ReproStep.log" -Append } catch {}
}
$folder = "WslLogs-" + (Get-Date -Format "yyyy-MM-dd_HH-mm-ss")
mkdir -p $folder | Out-Null
if ($LogProfile -eq $null -Or ![System.IO.File]::Exists($LogProfile))
# Check if LogProfile is a custom file path or a profile name
if ($LogProfile -ne $null -And [System.IO.File]::Exists($LogProfile))
{
if ($LogProfile -eq $null)
# User provided a custom .wprp file path - use it directly
$wprpFile = $LogProfile
$wprpProfile = $null # Use default profile in the file
}
else
{
# Map log profile names to WPRP profile names
$wprpProfile = "WSL"
if ($LogProfile -eq "storage")
{
$url = "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/wsl.wprp"
$wprpProfile = "WSL-Storage"
}
elseif ($LogProfile -eq "storage")
elseif ($LogProfile -eq "networking")
{
$url = "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/wsl_storage.wprp"
$wprpProfile = "WSL-Networking"
}
elseif ($LogProfile -eq "hvsocket")
{
$url = "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/wsl_hvsocket.wprp"
$wprpProfile = "WSL-HvSocket"
}
else
elseif ($LogProfile -ne $null)
{
Write-Error "Unknown log profile: $LogProfile"
Write-Error "Unknown log profile: $LogProfile. Valid options are: storage, networking, hvsocket, or a path to a custom .wprp file"
exit 1
}
$LogProfile = "$folder/wsl.wprp"
try {
Invoke-WebRequest -UseBasicParsing $url -OutFile $LogProfile
# Use the consolidated wsl.wprp file, attempt to use local copy first.
$wprpFile = "$folder/wsl.wprp"
if (Test-Path "$PSScriptRoot/wsl.wprp")
{
Copy-Item "$PSScriptRoot/wsl.wprp" $wprpFile
}
catch {
throw
else
{
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/wsl.wprp" -OutFile $wprpFile
}
}
# Networking-specific setup
if ($LogProfile -eq "networking")
{
# Copy/download networking.sh script
$networkingBashScript = "$folder/networking.sh"
if (Test-Path "$PSScriptRoot/networking.sh")
{
Copy-Item "$PSScriptRoot/networking.sh" $networkingBashScript
}
else
{
Write-Host -ForegroundColor Yellow "networking.sh not found in the current directory. Downloading it from GitHub."
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/networking.sh" -OutFile $networkingBashScript
}
# Detect the super user (uid=0, not necessarily named "root" - see #11693)
$superUser = & wsl.exe -- id -nu 0
# Collect Linux & Windows network state before the repro
& wsl.exe -u $superUser -e $networkingBashScript 2>&1 > $folder/linux_network_configuration_before.log
Collect-WindowsNetworkState -Folder $folder -ReproStep "before_repro"
if ($RestartWslReproMode)
{
# The WSL HNS network is created once per boot. Resetting it to collect network creation logs.
# Note: The below HNS command applies only to WSL in NAT mode
Get-HnsNetwork | Where-Object {$_.Name -eq 'WSL' -Or $_.Name -eq 'WSL (Hyper-V firewall)'} | Remove-HnsNetwork
# Stop WSL
net.exe stop WslService
if(-not $?) { net.exe stop LxssManager }
}
}
@ -71,19 +151,47 @@ if (Test-Path $uninstallLogs)
$wprOutputLog = "$folder/wpr.txt"
wpr.exe -start $LogProfile -filemode 2>&1 >> $wprOutputLog
# Build wpr command - if wprpProfile is set, use profile syntax, otherwise use file only
if ($wprpProfile -ne $null)
{
$wprCommand = "$wprpFile!$wprpProfile"
}
else
{
$wprCommand = $wprpFile
}
wpr.exe -start $wprCommand -filemode 2>&1 >> $wprOutputLog
if ($LastExitCode -Ne 0)
{
Write-Host -ForegroundColor Yellow "Log collection failed to start (exit code: $LastExitCode), trying to reset it."
wpr.exe -cancel 2>&1 >> $wprOutputLog
wpr.exe -start $LogProfile -filemode 2>&1 >> $wprOutputLog
wpr.exe -start $wprCommand -filemode 2>&1 >> $wprOutputLog
if ($LastExitCode -Ne 0)
{
Write-Host -ForegroundColor Red "Couldn't start log collection (exitCode: $LastExitCode)"
}
}
# Start networking-specific captures
$tcpdumpProcess = $null
if ($LogProfile -eq "networking")
{
pktmon start -c --flags 0x1A --file-name "$folder/pktmon.etl" | out-null
netsh wfp capture start file="$folder/wfpdiag.cab"
# Ensure WSL is running before collecting network state
& wsl.exe -- true 2>&1 | Out-Null
# Start tcpdump (may not be installed)
try
{
$tcpdumpProcess = Start-Process wsl.exe -ArgumentList "-u $superUser tcpdump -n -i any -e -vvv > $folder/tcpdump.log" -WindowStyle Hidden -PassThru
}
catch {}
}
try
{
Write-Host -NoNewLine "Log collection is running. Please "
@ -129,9 +237,65 @@ try
}
finally
{
# Stop networking-specific captures
if ($LogProfile -eq "networking")
{
try
{
wsl.exe -u $superUser killall tcpdump
if ($tcpdumpProcess -ne $null)
{
Wait-Process -InputObject $tcpdumpProcess -Timeout 10
}
}
catch {}
netsh wfp capture stop
pktmon stop | out-null
}
wpr.exe -stop $folder/logs.etl 2>&1 >> $wprOutputLog
}
# Networking-specific post-repro collection
if ($LogProfile -eq "networking")
{
# Collect Linux & Windows network state after the repro
& wsl.exe -u $superUser -e $networkingBashScript 2>&1 > $folder/linux_network_configuration_after.log
Collect-WindowsNetworkState -Folder $folder -ReproStep "after_repro"
try
{
# Collect HNS events from past 24 hours
$events = Get-WinEvent -ProviderName Microsoft-Windows-Host-Network-Service | Where-Object { $_.TimeCreated -ge ((Get-Date) - (New-TimeSpan -Day 1)) }
($events | ForEach-Object { '{0},{1},{2},{3}' -f $_.TimeCreated, $_.Id, $_.LevelDisplayName, $_.Message }) -join [environment]::NewLine | Out-File -FilePath "$folder/hns_events.log" -Append
}
catch {}
# Collect the old Tcpip6 registry values - as they can break WSL if DisabledComponents is set to 0xff
# see https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows
try
{
Get-Item HKLM:SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters | Out-File -FilePath "$folder/tcpip6_parameters.log" -Append
}
catch {}
# Collect the setup and NetSetup log files
$netSetupPath = "$env:WINDIR/logs/netsetup"
if (Test-Path $netSetupPath)
{
Copy-Item $netSetupPath/* $folder
}
$setupApiPath = "$env:WINDIR/inf/setupapi.dev.log"
if (Test-Path $setupApiPath)
{
Copy-Item $setupApiPath $folder
}
Remove-Item $networkingBashScript
}
if ($Dump)
{
$Assembly = [PSObject].Assembly.GetType('System.Management.Automation.WindowsErrorReporting')

View File

@ -1,35 +1,51 @@
<?xml version="1.0"?>
<!--
Available Profiles (use profile name with wpr -start):
- WSL: General WSL tracing (default)
- WSL-Storage: WSL with enhanced storage tracing
- WSL-Networking: WSL with comprehensive networking tracing
- WSL-HvSocket: WSL with HvSocket-specific tracing
Example: wpr -start wsl.wprp!WSL-Networking -filemode
-->
<WindowsPerformanceRecorder Version="1">
<Profiles>
<!-- Event Collectors -->
<EventCollector Id="Collector" Name="Collector">
<BufferSize Value="256"/>
<Buffers Value="1024"/>
<BufferSize Value="512"/>
<Buffers Value="4096"/>
</EventCollector>
<EventProvider Id="lxcore_kernel" Name="0CD1C309-0878-4515-83DB-749843B3F5C9"/>
<EventProvider Id="lxcore_user" Name="D90B9468-67F0-5B3B-42CC-82AC81FFD960"/>
<EventProvider Id="lxcore_service" Name="B99CDB5A-039C-5046-E672-1A0DE0A40211"/>
<EventProvider Id="wsl_devicehost" Name="9d6c7b9e-2581-4d8a-b8c5-b90b4a17094a"/>
<EventProvider Id="wslclient" Name="8cbb7724-7223-5d6f-8137-564dac45104d"/>
<EventProvider Id="wslapi" Name="beb94edf-1a7b-5058-0696-ff9e6b1798d1"/>
<EventProvider Id="vm_chipset" Name="de9ba731-7f33-4f44-98c9-6cac856b9f83"/>
<EventProvider Id="vmcompute_dll" Name="AF7FD3A7-B248-460C-A9F5-FEC39EF8468C"/>
<EventProvider Id="vmcompute" Name="17103E3F-3C6E-4677-BB17-3B267EB5BE57"/>
<EventProvider Id="vmmm" Name="6066F867-7CA1-4418-85FD-36E3F9C0600C"/>
<EventProvider Id="vmwp" Name="51DDFA29-D5C8-4803-BE4B-2ECB715570FE"/>
<!-- Event Providers -->
<EventProvider Id="9p" Name="e13c8d52-b153-571f-78c5-1d4098af2a1e"/>
<EventProvider Id="9p_errors" Name="06C601B3-6957-4F8C-A15F-74875B24429D" />
<EventProvider Id="p9rdr" Name="bb1d36f0-e0e0-48cc-9493-fef0e3d0b28c" />
<EventProvider Id="mup" Name="20c46239-d059-4214-a11e-7d6769cbe020" />
<EventProvider Id="rfsmon" Name="51734B23-5B7E-4892-BA8E-45BC110B735C" />
<EventProvider Id="hyperv_storage" Name="c7ad62c6-5c99-5a1b-bbc4-0821ae5b765e" />
<EventProvider Id="hns" Name="0c885e0d-6eb6-476c-a048-2457eed3a5c1" />
<EventProvider Id="netmgmt" Name="93f693dc-9163-4dee-af64-d855218af242" />
<EventProvider Id="aad_WPP" Name="4DE9BC9C-B27A-43C9-8994-0915F1A5E24F" />
<EventProvider Id="basecsp_WPP" Name="133A980D-035D-4E2D-B250-94577AD8FCED" />
<EventProvider Id="BCRYPT_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473302" />
<EventProvider Id="BFE_WPP" Name="106B464A-8043-46B1-8CB8-E92A0CD7A560" />
<EventProvider Id="CAPI1_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473305" />
<EventProvider Id="CHAT_WPP" Name="9B52E09F-0C58-4EAF-877F-70F9B54A7946" />
<EventProvider Id="cloudap_WPP" Name="EC3CA551-21E9-47D0-9742-1195429831BB" />
<EventProvider Id="CNG_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473303" />
<EventProvider Id="credssp_WPP" Name="6165F3E2-AE38-45D4-9B23-6B4818758BD9" />
<EventProvider Id="CRYPTOWINRT_WPP" Name="786396CD-2FF3-53D3-D1CA-43E41D9FB73B" />
<EventProvider Id="dclocator_WPP" Name="CA030134-54CD-4130-9177-DAE76A3C5791" />
<EventProvider Id="digest_WPP" Name="FB6A424F-B5D6-4329-B9B5-A975B3A93EAD" />
<EventProvider Id="DNS_WPP" Name="609151DD-04F5-4DA7-974C-FC6947EAA323" />
<EventProvider Id="dpapis_WPP" Name="EA3F84FC-03BB-540E-B6AA-9664F81A31FB" />
<EventProvider Id="EventProvider_HvSocketTraceProvider" Name="B2ED3BDB-CD74-5B2C-F660-85079CA074B3" NonPagedMemory="true">
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EventProvider_Microsoft.Windows.EMPS.Enrollment" Name="E74EFD1A-B62D-4B83-AB00-66F4A166A2D3" />
<EventProvider Id="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment" Name="F9E3B648-9AF1-4DC3-9A8E-BF42C0FBCE9A" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.AppDownload" Name="0BBE6221-EF09-4A3F-82EE-BE00DBB6A98A" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.Datastore" Name="42C60CEA-0FE7-4541-A86B-9E11F95BD9BF" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.PhoneProvisioner" Name="B876B1FC-C7F1-443E-9012-86677F7DE580" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.PPOEM" Name="7EDBED09-1FF7-4FEE-B8C3-5DB694420830" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.API" Name="82ADD491-01D7-4B85-9EAD-192C3CAACA23" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.CommandCsp" Name="00BB69FC-60BC-4502-9438-25608F375CCB" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.CSP" Name="16E12400-A2D8-44B7-9479-004568EC7819" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Engine" Name="A6A847B7-4429-49AA-BBA6-2AD8C191AC8C" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Handlers" Name="0383D92C-2337-4F25-A0B5-A51767F04746" />
@ -38,127 +54,481 @@
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Platform" Name="B1F30020-8BC3-4888-BB1B-4DD681F24209" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Plugin.Engine" Name="55239D60-0EB6-495B-874E-15DE5D5F9A70" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Plugin.RemovableMedia" Name="B55883E6-6C45-45C2-AB9D-800BB7B66B13" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvTool" Name="2BF4B6BA-556E-4D05-8534-CAFEDF19FED8" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.CommandCsp" Name="00BB69FC-60BC-4502-9438-25608F375CCB" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch" Name="08FACCFA-125D-4ED6-B0B7-B4A1A912E693" />
<EventProvider Id="EventProvider_Microsoft.Windows.EMPS.Enrollment" Name="E74EFD1A-B62D-4B83-AB00-66F4A166A2D3" />
<EventProvider Id="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment" Name="F9E3B648-9AF1-4DC3-9A8E-BF42C0FBCE9A" />
<EventProvider Id="Microsoft.Windows.HyperV.Vid" Name="1111450B-DACC-40A3-84AB-F7DBA4A6E63A" NonPagedMemory="true"/>
<EventProvider Id="Microsoft-Windows-HyperV-Vid" Name="5931D877-4860-4ee7-A95C-610A5F0D1407" NonPagedMemory="true" />
<EventProvider Id="virtdisk_wpp" Name="e14dcdd9-d1ec-4dc3-8395-a606df8ef115" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="virtdisk" Name="4D20DF22-E177-4514-A369-F1759FEEDEB3" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp" Name="E2816346-87F4-4F85-95C3-0C79409AA89D" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFD" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp_wpp" Name="3c70c3b0-2fae-41d3-b68d-8f7fcaf79adb" NonPagedMemory="true" Level="5">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="storvsp" Name="10b3d268-9782-49a4-aacc-a93c5482cb6f" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="HyperV_SyntheticStorage" Name="EDACD782-2564-4497-ADE6-7199377850F2" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="HyperV_EmulatedStorage" Name="86E15E01-EDF1-4AC7-89CF-B19563FD6894" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvTool" Name="2BF4B6BA-556E-4D05-8534-CAFEDF19FED8" />
<EventProvider Id="EventProvider_Telemetry_StorVSP" Name="544d0787-9f6d-432e-8414-e035a8b0541d">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="EventProvider_Trace_Vhdmp" Name="dc284fb3-1eab-4854-828a-b25417280280" Level="3">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="gMSAClient_WPP" Name="2D45EC97-EF01-4D4F-B9ED-EE3F4D3C11F3" />
<EventProvider Id="hns" Name="0c885e0d-6eb6-476c-a048-2457eed3a5c1" />
<EventProvider Id="HTTP_sys_WPP" Name="20F61733-57F1-4127-9F48-4AB7A9308AE2" />
<EventProvider Id="HyperV_EmulatedStorage" Name="86E15E01-EDF1-4AC7-89CF-B19563FD6894" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="hyperv_storage" Name="c7ad62c6-5c99-5a1b-bbc4-0821ae5b765e" />
<EventProvider Id="HyperV_SyntheticStorage" Name="EDACD782-2564-4497-ADE6-7199377850F2" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="idcommon_WPP" Name="B1108F75-3252-4B66-9239-80FD47E06494" />
<EventProvider Id="idlisten_WPP" Name="D93FE84A-795E-4608-80EC-CE29A96C8658" />
<EventProvider Id="idstore_WPP" Name="82C7D3DF-434D-44FC-A7CC-453A8075144E" />
<EventProvider Id="IPNat" Name="AE3F6C6D-BF2A-4291-9D07-59E661274EE3" />
<EventProvider Id="kdc_WPP" Name="1BBA8B19-7F31-43C0-9643-6E911F79A06B" />
<EventProvider Id="kerb_WPP" Name="6B510852-3583-4E2D-AFFE-A67F9F223438" />
<EventProvider Id="KerbClientShared_WPP" Name="FACB33C4-4513-4C38-AD1E-57C1F6828FC0" />
<EventProvider Id="KerbComm_WPP" Name="60A7AB7A-BC57-43E9-B78A-A1D516577AE3" />
<EventProvider Id="kps_WPP" Name="97A38277-13C0-4394-A0B2-2A70B465D64F" />
<EventProvider Id="livessp_WPP" Name="C10B942D-AE1B-4786-BC66-052E5B4BE40E" />
<EventProvider Id="LsaAudit_WPP" Name="DAA76F6A-2D11-4399-A646-1D62B7380F15" />
<EventProvider Id="LsaDs_WPP" Name="169EC169-5B77-4A3E-9DB6-441799D5CACB" />
<EventProvider Id="LsaIso_WPP" Name="366B218A-A5AA-4096-8131-0BDAFCC90E93" />
<EventProvider Id="LsaTrace_WPP" Name="D0B639E0-E650-4D1D-8F39-1580ADE72784" />
<EventProvider Id="lxcore_kernel" Name="0CD1C309-0878-4515-83DB-749843B3F5C9"/>
<EventProvider Id="lxcore_service" Name="B99CDB5A-039C-5046-E672-1A0DE0A40211"/>
<EventProvider Id="lxcore_user" Name="D90B9468-67F0-5B3B-42CC-82AC81FFD960"/>
<EventProvider Id="Microsoft_OneCore_NetworkingTriage_GetConnected" Name="60523747-6516-48B7-84B1-3264FA2CB359" />
<EventProvider Id="Microsoft_OneCore_NetworkingTriage_OnDemand" Name="ABB1FC61-49BA-4CC3-809F-7ABE1F8BA315" />
<EventProvider Id="Microsoft_OneCore_NetworkingTriage_RoutePolicyManagement" Name="923C0FFD-7933-4B52-8A49-121ABF2DC357" />
<EventProvider Id="Microsoft_OSG_OSS_CredProvFramework_ReportResultStop_WPP" Name="8DB3086D-116F-5BED-CFD5-9AFDA80D28EA" />
<EventProvider Id="Microsoft_OSG_Wininet_WPP" Name="1A211EE8-52DB-4AF0-BB66-FB8C9F20B0E2" />
<EventProvider Id="Microsoft_Quic_ETW" Name="ff15e657-4f26-570e-88ab-0796b258d11c" />
<EventProvider Id="Microsoft_Web_Platform_WPP" Name="FF32ADA1-5A4B-583C-889E-A3C027B201F5" />
<EventProvider Id="Microsoft_Windows_AppModel_Exec_WPP" Name="EB65A492-86C0-406A-BACE-9912D595BD69" />
<EventProvider Id="Microsoft_Windows_BranchCacheClientEventProvider" Name="e837619c-a2a8-4689-833f-47b48ebd2442" />
<EventProvider Id="Microsoft_Windows_BranchCacheEventProvider" Name="dd85457f-4e2d-44a5-a7a7-6253362e34dc" />
<EventProvider Id="Microsoft_Windows_BrokerInfrastructure_WPP" Name="63B6C2D2-0440-44DE-A674-AA51A251B123" />
<EventProvider Id="Microsoft_Windows_CAPI2_WPP" Name="5BBCA4A8-B209-48DC-A8C7-B23D3E5216FB" />
<EventProvider Id="Microsoft_Windows_CertificateServices_Deployment_WPP" Name="B2D1F576-2E85-4489-B504-1861C40544B3" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_AutoEnrollment_WPP" Name="F0DB7EF8-B6F3-4005-9937-FEB77B9E1B43" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_CertEnroll_WPP" Name="54164045-7C50-4905-963F-E5BC1EEF0CCA" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_CredentialRoaming_WPP" Name="89A2278B-C662-4AFF-A06C-46AD3F220BCA" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_Lifecycle_System_WPP" Name="BC0669E1-A10D-4A78-834E-1CA3C806C93B" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_Lifecycle_User_WPP" Name="BEA18B89-126F-4155-9EE4-D36038B02680" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_WPP" Name="73370BD6-85E5-430B-B60A-FEA1285808A7" />
<EventProvider Id="Microsoft_Windows_CertificationAuthorityClient_CertCli_WPP" Name="98BF1CD3-583E-4926-95EE-A61BF3F46470" />
<EventProvider Id="Microsoft_Windows_CertPolEng_WPP" Name="AF9CC194-E9A8-42BD-B0D1-834E9CFAB799" />
<EventProvider Id="Microsoft_Windows_DeviceManagement_Enterprise_Diagnostics_Provider_WPP" Name="3DA494E4-0FE2-415C-B895-FB5265C5C83B" />
<EventProvider Id="Microsoft_Windows_DeviceManagement_SCEP_WPP" Name="D5A5B540-C580-4DEE-8BB4-185E34AA00C5" />
<EventProvider Id="Microsoft_Windows_DM_Enrollment_Provider_WPP" Name="9FBF7B95-0697-4935-ADA2-887BE9DF12BC" />
<EventProvider Id="Microsoft_Windows_DNS_Client" Name="1c95126e-7eea-49a9-a3fe-a378b03ddb4d" />
<EventProvider Id="Microsoft_Windows_DNS_Client_Configuration_PowerShell" Name="563a50d8-3536-4c8a-a361-b37af04094ec" />
<EventProvider Id="Microsoft_Windows_DNS_Client_WinRNR" Name="b923f87a-b069-42b5-bd32-35623aba1c48" />
<EventProvider Id="Microsoft_Windows_HttpService" Name="dd5ef90a-6398-47a4-ad34-4dcecdef795f" />
<EventProvider Id="Microsoft_Windows_LiveId_WPP" Name="05F02597-FE85-4E67-8542-69567AB8FD4F" />
<EventProvider Id="Microsoft_Windows_MicrosoftAccount_TBProvider_WPP" Name="5836994D-A677-53E7-1389-588AD1420CC5" />
<EventProvider Id="Microsoft_Windows_ProcessStateManager_WPP" Name="D49918CF-9489-4BF1-9D7B-014D864CF71F" />
<EventProvider Id="Microsoft_Windows_ResourceManager_WPP" Name="4180C4F7-E238-5519-338F-EC214F0B49AA" />
<EventProvider Id="Microsoft_Windows_Runtime_Web_Http" Name="41877cb4-11fc-4188-b590-712c143c881d" />
<EventProvider Id="Microsoft_Windows_Security_AADAuthHelper_WPP" Name="9EBB3B15-B094-41B1-A3B8-0F141B06BADD" />
<EventProvider Id="Microsoft_Windows_Security_AADCloudAPPlugin_WPP" Name="556045FD-58C5-4A97-9881-B121F68B79C5" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_BioCredProv_WPP" Name="9DADD79B-D556-53F2-67C4-129FA62B7512" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_Client_WPP" Name="1B5106B1-7622-4740-AD81-D9C6EE74F124" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_CredentialProvider_Face_WPP" Name="1D480C11-3870-4B19-9144-47A53CD973BD" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_FingerprintCredential_WPP" Name="225B3FED-0356-59D1-1F82-EED163299FA8" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_Service_WPP" Name="39A5AA08-031D-4777-A32D-ED386BF03470" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_Trustlet_WPP" Name="9DF19CFA-E122-5343-284B-F3945CCD65B2" />
<EventProvider Id="Microsoft_Windows_Security_Credentials_UserConsentVerifier_WPP" Name="507C53AE-AF42-5938-AEDE-4A9D908640ED" />
<EventProvider Id="Microsoft_Windows_Security_DevCredClient_WPP" Name="78983C7D-917F-58DA-E8D4-F393DECF4EC0" />
<EventProvider Id="Microsoft_Windows_Security_DevCredProv_WPP" Name="7955D36A-450B-5E2A-A079-95876BCA450A" />
<EventProvider Id="Microsoft_Windows_Security_DevCredSvc_WPP" Name="C3FEB5BF-1A8D-53F3-AAA8-44496392BF69" />
<EventProvider Id="Microsoft_Windows_Security_DevCredTask_WPP" Name="86D5FE65-0564-4618-B90B-E146049DEBF4" />
<EventProvider Id="Microsoft_Windows_Security_DevCredWinRt_WPP" Name="36FF4C84-82A2-4B23-8BA5-A25CBDFF3410" />
<EventProvider Id="Microsoft_Windows_Security_DeviceLock_WPP" Name="2056054C-97A6-5AE4-B181-38BC6B58007E" />
<EventProvider Id="Microsoft_Windows_Security_Fido_WPP" Name="08B15CE7-C9FF-5E64-0D16-66589573C50F" />
<EventProvider Id="Microsoft_Windows_Security_LsaSrv_WPP" Name="4D9DFB91-4337-465A-A8B5-05A27D930D48" />
<EventProvider Id="Microsoft_Windows_Security_NGC_CredProv_WPP" Name="CAC8D861-7B16-5B6B-5FC0-85014776BDAC" />
<EventProvider Id="Microsoft_Windows_Security_NGC_CryptNgc_WPP" Name="6D7051A0-9C83-5E52-CF8F-0ECAF5D5F6FD" />
<EventProvider Id="Microsoft_Windows_Security_NGC_CSP_WPP" Name="89F392FF-EE7C-56A3-3F61-2D5B31A36935" />
<EventProvider Id="Microsoft_Windows_Security_NGC_KeyCredMgr_WPP" Name="34646397-1635-5D14-4D2C-2FEBDCCCF5E9" />
<EventProvider Id="Microsoft_Windows_Security_NGC_KeyStaging_WPP" Name="9B223F67-67A1-5B53-9126-4593FE81DF25" />
<EventProvider Id="Microsoft_Windows_Security_NGC_KspSvc_WPP" Name="B66B577F-AE49-5CCF-D2D7-8EB96BFD440C" />
<EventProvider Id="Microsoft_Windows_Security_NGC_Local_WPP" Name="3B9DBF69-E9F0-5389-D054-A94BC30E33F7" />
<EventProvider Id="Microsoft_Windows_Security_NGC_LocalAccountMigPlugin_WPP" Name="CDD94AC7-CD2F-5189-E126-2DEB1B2FACBF" />
<EventProvider Id="Microsoft_Windows_Security_NGC_NgcCtnr_WPP" Name="0ABA6892-455B-551D-7DA8-3A8F85225E1A" />
<EventProvider Id="Microsoft_Windows_Security_NGC_NgcCtnrSvc_WPP" Name="9DF6A82D-5174-5EBF-842A-39947C48BF2A" />
<EventProvider Id="Microsoft_Windows_Security_NGC_NgcIsoCtnr_WPP" Name="CDC6BEB9-6D78-5138-D232-D951916AB98F" />
<EventProvider Id="Microsoft_Windows_Security_NGC_PopKeySrv_WPP" Name="1D6540CE-A81B-4E74-AD35-EEF8463F97F5" />
<EventProvider Id="Microsoft_Windows_Security_NGC_Recovery_WPP" Name="9D4CA978-8A14-545E-C047-A45991F0E92F" />
<EventProvider Id="Microsoft_Windows_Security_NGC_Trustlet_WPP" Name="C0B2937D-E634-56A2-1451-7D678AA3BC53" />
<EventProvider Id="Microsoft_Windows_Security_TokenBroker_WPP" Name="077B8C4A-E425-578D-F1AC-6FDF1220FF68" />
<EventProvider Id="Microsoft_Windows_Shell_CloudDomainJoin_Client_WPP" Name="AA02D1A4-72D8-5F50-D425-7402EA09253A" />
<EventProvider Id="Microsoft_Windows_Shell_CloudExperienceHost_WPP" Name="D0034F5E-3686-5A74-DC48-5A22DD4F3D5B" />
<EventProvider Id="Microsoft_Windows_WBioSrvc_WPP" Name="34BEC984-F11F-4F1F-BB9B-3BA33C8D0132" />
<EventProvider Id="Microsoft_Windows_WebIO" Name="50b3e73c-9370-461d-bb9f-26f32d68887d" />
<EventProvider Id="Microsoft_Windows_WinHttp" Name="7d44233d-3055-4b9c-ba64-0d47ca40a232" />
<EventProvider Id="Microsoft_Windows_WinINet" Name="43d1a55c-76d6-4f7e-995c-64c711e5cafe" />
<EventProvider Id="Microsoft_Windows_Winsock_NameResolution" Name="55404E71-4DB9-4DEB-A5F5-8F86E46DDE56" />
<EventProvider Id="Microsoft-Windows-DHCP-Client" Name="15A7A4F8-0072-4EAB-ABAD-F98A4D666AED" />
<EventProvider Id="Microsoft-Windows-DHCPv6-Client" Name="6A1F2B00-6A90-4C38-95A5-5CAB3B056778" />
<EventProvider Id="Microsoft-Windows-Host-Network-Management" Name="93f693dc-9163-4dee-af64-d855218af242" />
<EventProvider Id="Microsoft-Windows-Hyper-V-VfpExt" Name="9F2660EA-CFE7-428F-9850-AECA612619B0"/>
<EventProvider Id="Microsoft-Windows-Hyper-V-VmSwitch" Name="67DC0D66-3695-47C0-9642-33F76F7BD7AD"/>
<EventProvider Id="Microsoft-Windows-HyperV-Vid" Name="5931D877-4860-4ee7-A95C-610A5F0D1407" NonPagedMemory="true" />
<EventProvider Id="Microsoft-Windows-Overlay-HNSPlugin" Name="564368D6-577B-4af5-AD84-1C54464848E6" />
<EventProvider Id="Microsoft-Windows-SharedAccess_NAT" Name="A6F32731-9A38-4159-A220-3D9B7FC5FE5D" />
<EventProvider Id="Microsoft-Windows-TCPIP" Name="2f07e2ee-15db-40f1-90ef-9d7ba282188a" NonPagedMemory="true" EventKey="true" Strict="true"/>
<EventProvider Id="Microsoft-Windows-WinNat" Name="66C07ECD-6667-43FC-93F8-05CF07F446EC" />
<EventProvider Id="Microsoft.Windows.HostNetworkingService.PrivateCloudPlugin" Name="D0E4BC17-34C7-43fc-9A72-D89A59D6979A" />
<EventProvider Id="Microsoft.Windows.Hyper.V.NetSetupHelper" Name="94DEB9D1-0A52-449B-B368-41E4426B4F36"/>
<EventProvider Id="Microsoft.Windows.Hyper.V.VmsIf" Name="6C28C7E5-331B-4437-9C69-5352A2F7F296" />
<EventProvider Id="Microsoft.Windows.HyperV.Compute" Name="80CE50DE-D264-4581-950D-ABADEEE0D340" />
<EventProvider Id="Microsoft.Windows.HyperV.Socket" Name="b2ed3bdb-cd74-5b2c-f660-85079ca074b3"/>
<EventProvider Id="Microsoft.Windows.HyperV.Vid" Name="1111450B-DACC-40A3-84AB-F7DBA4A6E63A" NonPagedMemory="true"/>
<EventProvider Id="Microsoft.Windows.Networking.FlowSteering" Name="662abf07-6dda-5b25-c2c5-345236dbb2d2"/>
<EventProvider Id="mpssvcService" Name="5EEFEBDB-E90C-423a-8ABF-0241E7C5B87D" />
<EventProvider Id="MsQuic_WPP" Name="620FD025-BE51-42EF-A5C0-50F13F183AD9" />
<EventProvider Id="msxml_WPP" Name="927821F8-D9E6-42E2-84F2-949E18256F3A" />
<EventProvider Id="mup" Name="20c46239-d059-4214-a11e-7d6769cbe020" />
<EventProvider Id="NCRYPT_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473301" />
<EventProvider Id="NCRYPTSSLP_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473304" />
<EventProvider Id="ndis_wpp" Name="DD7A21E6-A651-46D4-B7C2-66543067B869"/>
<EventProvider Id="negoexts_WPP" Name="5AF52B0D-E633-4EAD-828A-4B85B8DAAC2B" />
<EventProvider Id="Netio_WPP" Name="EB004A05-9B1A-11D4-9123-0050047759BC" />
<EventProvider Id="netmgmt" Name="93f693dc-9163-4dee-af64-d855218af242" />
<EventProvider Id="ntlm_WPP" Name="5BBB6C18-AA45-49B1-A15F-085F7ED0AA90" />
<EventProvider Id="NtlmShared_WPP" Name="AC69AE5B-5B21-405F-8266-4424944A43E9" />
<EventProvider Id="p9rdr" Name="bb1d36f0-e0e0-48cc-9493-fef0e3d0b28c" NonPagedMemory="true" Strict="true"/>
<EventProvider Id="pku2u_WPP" Name="2A6FAF47-5449-4805-89A3-A504F3E221A6" />
<EventProvider Id="PortTrackerServer_WPP" Name="090bf343-4490-42d3-b273-8af174d314fb" />
<EventProvider Id="rfsmon" Name="51734B23-5B7E-4892-BA8E-45BC110B735C" />
<EventProvider Id="SharedAccessWPP" Name="9B322459-4AD9-4F81-8EEA-DC77CDD18CA6" />
<EventProvider Id="storvsp" Name="10b3d268-9782-49a4-aacc-a93c5482cb6f" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="storvsp_io" Name="10b3d268-9782-49a4-aacc-a93c5482cb6f" NonPagedMemory="true">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="storvsp_wpp" Name="f96abc17-6a5e-4a49-a3f4-a2a86fa03846" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="TLS_WPP" Name="37D2C3CD-C5D4-4587-8531-4696C44244C8" />
<EventProvider Id="TokenBinding_WPP" Name="AEF66A73-A765-4421-B348-B7E0FC8C9898" />
<EventProvider Id="TPM_WPP" Name="3A8D6942-B034-48E2-B314-F69C2B4655A3" />
<EventProvider Id="UrlMon_WPP" Name="3FAB3162-24CE-4ED5-B23D-63501544E11D" />
<EventProvider Id="vault_WPP" Name="7FDD167C-79E5-4403-8C84-B7C0BB9923A1" />
<EventProvider Id="vfpext" Name="9F2660EA-CFE7-428F-9850-AECA612619B0" />
<EventProvider Id="vhdmp" Name="E2816346-87F4-4F85-95C3-0C79409AA89D" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFD" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp_wpp" Name="3c70c3b0-2fae-41d3-b68d-8f7fcaf79adb" NonPagedMemory="true" Level="5">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="virtdisk" Name="4D20DF22-E177-4514-A369-F1759FEEDEB3" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="virtdisk_wpp" Name="e14dcdd9-d1ec-4dc3-8395-a606df8ef115" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="vm_chipset" Name="de9ba731-7f33-4f44-98c9-6cac856b9f83"/>
<EventProvider Id="vmcompute" Name="17103E3F-3C6E-4677-BB17-3B267EB5BE57"/>
<EventProvider Id="vmcompute_dll" Name="AF7FD3A7-B248-460C-A9F5-FEC39EF8468C"/>
<EventProvider Id="vmmm" Name="6066F867-7CA1-4418-85FD-36E3F9C0600C"/>
<EventProvider Id="VmSwitch_wpp" Name="1F387CBC-6818-4530-9DB6-5F1058CD7E86"/>
<EventProvider Id="vmwp" Name="51DDFA29-D5C8-4803-BE4B-2ECB715570FE"/>
<EventProvider Id="webauth_WPP" Name="EF98103D-8D3A-4BEF-9DF2-2156563E64FA" />
<EventProvider Id="Webio_WPP" Name="08F93B14-1608-4A72-9CFA-457EECEDBBA7" />
<EventProvider Id="webplatform_WPP" Name="2A3C6602-411E-4DC6-B138-EA19D64F5BBA" />
<EventProvider Id="WinHttp_WPP" Name="B3A7698A-0C45-44DA-B73D-E181C9B5C8E6" />
<EventProvider Id="Wininet_WPP" Name="4E749B6A-667D-4C72-80EF-373EE3246B08" />
<EventProvider Id="WinNatSys" Name="aa7387cf-3639-496a-b3bf-dc1e79a6fc5a" />
<EventProvider Id="Winsock_WPP" Name="1D44957B-7181-4835-B70A-D0B16112A4DE" />
<EventProvider Id="wlidsvc_WPP" Name="3F8B9EF5-BBD2-4C81-B6C9-DA3CDB72D3C5" />
<EventProvider Id="wsl_devicehost" Name="9d6c7b9e-2581-4d8a-b8c5-b90b4a17094a"/>
<EventProvider Id="wslapi" Name="beb94edf-1a7b-5058-0696-ff9e6b1798d1"/>
<EventProvider Id="wslaservice" Name="0383CE62-8F86-4766-AFB2-9D66A7FB1E90"/>
<EventProvider Id="wslclient" Name="8cbb7724-7223-5d6f-8137-564dac45104d"/>
<!-- PROFILE: General WSL Tracing (Default, also serves as base for other profiles) -->
<Profile
Id="WSL.Verbose.File"
Name="WSL"
Description="Traces for all WSL components"
Description="General traces for WSL components"
LoggingMode="File"
DetailLevel="Verbose"
>
<Collectors>
<EventCollectorId Value="Collector">
<EventProviders>
<EventProviderId Value="lxcore_kernel"/>
<EventProviderId Value="lxcore_user"/>
<EventProviderId Value="lxcore_service"/>
<EventProviderId Value="wsl_devicehost"/>
<EventProviderId Value="wslclient"/>
<EventProviderId Value="wslapi"/>
<EventProviderId Value="vm_chipset"/>
<EventProviderId Value="vmcompute_dll"/>
<EventProviderId Value="vmcompute"/>
<EventProviderId Value="vmmm"/>
<EventProviderId Value="vmwp"/>
<EventProviderId Value="9p"/>
<EventProviderId Value="9p_errors"/>
<EventProviderId Value="p9rdr"/>
<EventProviderId Value="mup"/>
<EventProviderId Value="rfsmon"/>
<EventProviderId Value="hyperv_storage"/>
<EventProviderId Value="hns"/>
<EventProviderId Value="netmgmt"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EMPS.Enrollment"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.AppDownload"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.Datastore"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.PhoneProvisioner"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.PPOEM"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.API"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.CommandCsp"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.CSP"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Engine"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Handlers"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Migration"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Platform"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Operations"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Platform"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Plugin.Engine"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Plugin.RemovableMedia"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvTool"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Operations"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.CommandCsp"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EMPS.Enrollment"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment"/>
<EventProviderId Value="Microsoft.Windows.HyperV.Vid"/>
<EventProviderId Value="Microsoft-Windows-HyperV-Vid"/>
<EventProviderId Value="virtdisk"/>
<EventProviderId Value="virtdisk_wpp"/>
<EventProviderId Value="vhdmp"/>
<EventProviderId Value="vhdmp_wpp"/>
<EventProviderId Value="storvsp"/>
<EventProviderId Value="HyperV_SyntheticStorage"/>
<EventProviderId Value="HyperV_EmulatedStorage"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvTool"/>
<EventProviderId Value="EventProvider_Telemetry_StorVSP"/>
<EventProviderId Value="EventProvider_Trace_Vhdmp"/>
<EventProviderId Value="hns"/>
<EventProviderId Value="HyperV_EmulatedStorage"/>
<EventProviderId Value="hyperv_storage"/>
<EventProviderId Value="HyperV_SyntheticStorage"/>
<EventProviderId Value="lxcore_kernel"/>
<EventProviderId Value="lxcore_service"/>
<EventProviderId Value="lxcore_user"/>
<EventProviderId Value="Microsoft-Windows-HyperV-Vid"/>
<EventProviderId Value="Microsoft.Windows.HyperV.Vid"/>
<EventProviderId Value="mup"/>
<EventProviderId Value="netmgmt"/>
<EventProviderId Value="p9rdr"/>
<EventProviderId Value="rfsmon"/>
<EventProviderId Value="storvsp"/>
<EventProviderId Value="vfpext"/>
<EventProviderId Value="vhdmp"/>
<EventProviderId Value="vhdmp_wpp"/>
<EventProviderId Value="virtdisk"/>
<EventProviderId Value="virtdisk_wpp"/>
<EventProviderId Value="vm_chipset"/>
<EventProviderId Value="vmcompute"/>
<EventProviderId Value="vmcompute_dll"/>
<EventProviderId Value="vmmm"/>
<EventProviderId Value="vmwp"/>
<EventProviderId Value="wsl_devicehost"/>
<EventProviderId Value="wslapi"/>
<EventProviderId Value="wslaservice"/>
<EventProviderId Value="wslclient"/>
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
<!-- PROFILE: Storage-focused WSL Tracing -->
<Profile
Id="WSL-Storage.Verbose.File"
Name="WSL-Storage"
Description="WSL traces with enhanced storage providers"
LoggingMode="File"
DetailLevel="Verbose"
Base="WSL.Verbose.File"
>
<Collectors>
<EventCollectorId Value="Collector">
<EventProviders>
<!-- Additional storage-specific providers -->
<EventProviderId Value="storvsp_io"/>
<EventProviderId Value="storvsp_wpp"/>
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
<!-- PROFILE: Networking-focused WSL Tracing -->
<Profile
Id="WSL-Networking.Verbose.File"
Name="WSL-Networking"
Description="WSL traces with comprehensive networking providers"
LoggingMode="File"
DetailLevel="Verbose"
Base="WSL.Verbose.File"
>
<Collectors>
<EventCollectorId Value="Collector">
<EventProviders>
<!-- Additional networking-specific providers -->
<EventProviderId Value="aad_WPP"/>
<EventProviderId Value="basecsp_WPP"/>
<EventProviderId Value="BCRYPT_WPP"/>
<EventProviderId Value="BFE_WPP"/>
<EventProviderId Value="CAPI1_WPP"/>
<EventProviderId Value="CHAT_WPP"/>
<EventProviderId Value="cloudap_WPP"/>
<EventProviderId Value="CNG_WPP"/>
<EventProviderId Value="credssp_WPP"/>
<EventProviderId Value="CRYPTOWINRT_WPP"/>
<EventProviderId Value="dclocator_WPP"/>
<EventProviderId Value="digest_WPP"/>
<EventProviderId Value="DNS_WPP"/>
<EventProviderId Value="dpapis_WPP"/>
<EventProviderId Value="gMSAClient_WPP"/>
<EventProviderId Value="HTTP_sys_WPP"/>
<EventProviderId Value="idcommon_WPP"/>
<EventProviderId Value="idlisten_WPP"/>
<EventProviderId Value="idstore_WPP"/>
<EventProviderId Value="IPNat"/>
<EventProviderId Value="kdc_WPP"/>
<EventProviderId Value="kerb_WPP"/>
<EventProviderId Value="KerbClientShared_WPP"/>
<EventProviderId Value="KerbComm_WPP"/>
<EventProviderId Value="kps_WPP"/>
<EventProviderId Value="livessp_WPP"/>
<EventProviderId Value="LsaAudit_WPP"/>
<EventProviderId Value="LsaDs_WPP"/>
<EventProviderId Value="LsaIso_WPP"/>
<EventProviderId Value="LsaTrace_WPP"/>
<EventProviderId Value="Microsoft_OneCore_NetworkingTriage_GetConnected"/>
<EventProviderId Value="Microsoft_OneCore_NetworkingTriage_OnDemand"/>
<EventProviderId Value="Microsoft_OneCore_NetworkingTriage_RoutePolicyManagement"/>
<EventProviderId Value="Microsoft_OSG_OSS_CredProvFramework_ReportResultStop_WPP"/>
<EventProviderId Value="Microsoft_OSG_Wininet_WPP"/>
<EventProviderId Value="Microsoft_Quic_ETW"/>
<EventProviderId Value="Microsoft_Web_Platform_WPP"/>
<EventProviderId Value="Microsoft_Windows_AppModel_Exec_WPP"/>
<EventProviderId Value="Microsoft_Windows_BranchCacheClientEventProvider"/>
<EventProviderId Value="Microsoft_Windows_BranchCacheEventProvider"/>
<EventProviderId Value="Microsoft_Windows_BrokerInfrastructure_WPP"/>
<EventProviderId Value="Microsoft_Windows_CAPI2_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServices_Deployment_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_AutoEnrollment_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_CertEnroll_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_CredentialRoaming_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_Lifecycle_System_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_Lifecycle_User_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificationAuthorityClient_CertCli_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertPolEng_WPP"/>
<EventProviderId Value="Microsoft_Windows_DeviceManagement_Enterprise_Diagnostics_Provider_WPP"/>
<EventProviderId Value="Microsoft_Windows_DeviceManagement_SCEP_WPP"/>
<EventProviderId Value="Microsoft_Windows_DM_Enrollment_Provider_WPP"/>
<EventProviderId Value="Microsoft_Windows_DNS_Client"/>
<EventProviderId Value="Microsoft_Windows_DNS_Client_Configuration_PowerShell"/>
<EventProviderId Value="Microsoft_Windows_DNS_Client_WinRNR"/>
<EventProviderId Value="Microsoft_Windows_HttpService"/>
<EventProviderId Value="Microsoft_Windows_LiveId_WPP"/>
<EventProviderId Value="Microsoft_Windows_MicrosoftAccount_TBProvider_WPP"/>
<EventProviderId Value="Microsoft_Windows_ProcessStateManager_WPP"/>
<EventProviderId Value="Microsoft_Windows_ResourceManager_WPP"/>
<EventProviderId Value="Microsoft_Windows_Runtime_Web_Http"/>
<EventProviderId Value="Microsoft_Windows_Security_AADAuthHelper_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_AADCloudAPPlugin_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_BioCredProv_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_Client_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_CredentialProvider_Face_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_FingerprintCredential_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_Service_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_Trustlet_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Credentials_UserConsentVerifier_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredClient_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredProv_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredSvc_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredTask_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredWinRt_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DeviceLock_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Fido_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_LsaSrv_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_CredProv_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_CryptNgc_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_CSP_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_KeyCredMgr_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_KeyStaging_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_KspSvc_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_Local_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_LocalAccountMigPlugin_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_NgcCtnr_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_NgcCtnrSvc_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_NgcIsoCtnr_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_PopKeySrv_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_Recovery_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_Trustlet_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_TokenBroker_WPP"/>
<EventProviderId Value="Microsoft_Windows_Shell_CloudDomainJoin_Client_WPP"/>
<EventProviderId Value="Microsoft_Windows_Shell_CloudExperienceHost_WPP"/>
<EventProviderId Value="Microsoft_Windows_WBioSrvc_WPP"/>
<EventProviderId Value="Microsoft_Windows_WebIO"/>
<EventProviderId Value="Microsoft_Windows_WinHttp"/>
<EventProviderId Value="Microsoft_Windows_WinINet"/>
<EventProviderId Value="Microsoft_Windows_Winsock_NameResolution"/>
<EventProviderId Value="Microsoft-Windows-DHCP-Client"/>
<EventProviderId Value="Microsoft-Windows-DHCPv6-Client"/>
<EventProviderId Value="Microsoft-Windows-Host-Network-Management"/>
<EventProviderId Value="Microsoft-Windows-Hyper-V-VfpExt"/>
<EventProviderId Value="Microsoft-Windows-Hyper-V-VmSwitch"/>
<EventProviderId Value="Microsoft-Windows-Overlay-HNSPlugin"/>
<EventProviderId Value="Microsoft-Windows-SharedAccess_NAT"/>
<EventProviderId Value="Microsoft-Windows-TCPIP"/>
<EventProviderId Value="Microsoft-Windows-WinNat"/>
<EventProviderId Value="Microsoft.Windows.HostNetworkingService.PrivateCloudPlugin"/>
<EventProviderId Value="Microsoft.Windows.Hyper.V.NetSetupHelper"/>
<EventProviderId Value="Microsoft.Windows.Hyper.V.VmsIf"/>
<EventProviderId Value="Microsoft.Windows.HyperV.Compute"/>
<EventProviderId Value="Microsoft.Windows.HyperV.Socket"/>
<EventProviderId Value="Microsoft.Windows.Networking.FlowSteering"/>
<EventProviderId Value="mpssvcService"/>
<EventProviderId Value="MsQuic_WPP"/>
<EventProviderId Value="msxml_WPP"/>
<EventProviderId Value="NCRYPT_WPP"/>
<EventProviderId Value="NCRYPTSSLP_WPP"/>
<EventProviderId Value="ndis_wpp"/>
<EventProviderId Value="negoexts_WPP"/>
<EventProviderId Value="Netio_WPP"/>
<EventProviderId Value="ntlm_WPP"/>
<EventProviderId Value="NtlmShared_WPP"/>
<EventProviderId Value="pku2u_WPP"/>
<EventProviderId Value="PortTrackerServer_WPP"/>
<EventProviderId Value="SharedAccessWPP"/>
<EventProviderId Value="TLS_WPP"/>
<EventProviderId Value="TokenBinding_WPP"/>
<EventProviderId Value="TPM_WPP"/>
<EventProviderId Value="UrlMon_WPP"/>
<EventProviderId Value="vault_WPP"/>
<EventProviderId Value="VmSwitch_wpp"/>
<EventProviderId Value="webauth_WPP"/>
<EventProviderId Value="Webio_WPP"/>
<EventProviderId Value="webplatform_WPP"/>
<EventProviderId Value="WinHttp_WPP"/>
<EventProviderId Value="Wininet_WPP"/>
<EventProviderId Value="WinNatSys"/>
<EventProviderId Value="Winsock_WPP"/>
<EventProviderId Value="wlidsvc_WPP"/>
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
<!-- PROFILE: HvSocket-focused WSL Tracing -->
<Profile
Id="WSL-HvSocket.Verbose.File"
Name="WSL-HvSocket"
Description="WSL traces with HvSocket-specific providers"
LoggingMode="File"
DetailLevel="Verbose"
Base="WSL.Verbose.File"
>
<Collectors>
<EventCollectorId Value="Collector">
<EventProviders>
<!-- Additional providers specific to HvSocket profile -->
<EventProviderId Value="EventProvider_HvSocketTraceProvider"/>
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
</Profiles>
</WindowsPerformanceRecorder>
</WindowsPerformanceRecorder>

View File

@ -1,172 +0,0 @@
<?xml version="1.0"?>
<WindowsPerformanceRecorder Version="1">
<Profiles>
<EventCollector Id="Collector" Name="Collector">
<BufferSize Value="512" />
<Buffers Value="10" PercentageOfTotalMemory="true"/>
</EventCollector>
<EventProvider Id="EventProvider_HvSocketTraceProvider" Name="B2ED3BDB-CD74-5B2C-F660-85079CA074B3" NonPagedMemory="true">
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="lxcore_kernel" Name="0CD1C309-0878-4515-83DB-749843B3F5C9"/>
<EventProvider Id="lxcore_user" Name="D90B9468-67F0-5B3B-42CC-82AC81FFD960"/>
<EventProvider Id="lxcore_service" Name="B99CDB5A-039C-5046-E672-1A0DE0A40211"/>
<EventProvider Id="wsl_devicehost" Name="9d6c7b9e-2581-4d8a-b8c5-b90b4a17094a"/>
<EventProvider Id="wslclient" Name="8cbb7724-7223-5d6f-8137-564dac45104d"/>
<EventProvider Id="wslapi" Name="beb94edf-1a7b-5058-0696-ff9e6b1798d1"/>
<EventProvider Id="vm_chipset" Name="de9ba731-7f33-4f44-98c9-6cac856b9f83"/>
<EventProvider Id="vmcompute_dll" Name="AF7FD3A7-B248-460C-A9F5-FEC39EF8468C"/>
<EventProvider Id="vmcompute" Name="17103E3F-3C6E-4677-BB17-3B267EB5BE57"/>
<EventProvider Id="vmmm" Name="6066F867-7CA1-4418-85FD-36E3F9C0600C"/>
<EventProvider Id="vmwp" Name="51DDFA29-D5C8-4803-BE4B-2ECB715570FE"/>
<EventProvider Id="9p" Name="e13c8d52-b153-571f-78c5-1d4098af2a1e"/>
<EventProvider Id="9p_errors" Name="06C601B3-6957-4F8C-A15F-74875B24429D" />
<EventProvider Id="p9rdr" Name="bb1d36f0-e0e0-48cc-9493-fef0e3d0b28c" />
<EventProvider Id="mup" Name="20c46239-d059-4214-a11e-7d6769cbe020" />
<EventProvider Id="rfsmon" Name="51734B23-5B7E-4892-BA8E-45BC110B735C" />
<EventProvider Id="hyperv_storage" Name="c7ad62c6-5c99-5a1b-bbc4-0821ae5b765e" />
<EventProvider Id="hns" Name="0c885e0d-6eb6-476c-a048-2457eed3a5c1" />
<EventProvider Id="netmgmt" Name="93f693dc-9163-4dee-af64-d855218af242" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.AppDownload" Name="0BBE6221-EF09-4A3F-82EE-BE00DBB6A98A" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.Datastore" Name="42C60CEA-0FE7-4541-A86B-9E11F95BD9BF" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.PhoneProvisioner" Name="B876B1FC-C7F1-443E-9012-86677F7DE580" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.PPOEM" Name="7EDBED09-1FF7-4FEE-B8C3-5DB694420830" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.API" Name="82ADD491-01D7-4B85-9EAD-192C3CAACA23" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.CSP" Name="16E12400-A2D8-44B7-9479-004568EC7819" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Engine" Name="A6A847B7-4429-49AA-BBA6-2AD8C191AC8C" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Handlers" Name="0383D92C-2337-4F25-A0B5-A51767F04746" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Migration" Name="A0AF985E-83F9-4E1A-B658-338DCFE27893" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Operations" Name="7F99598F-B2C1-4371-9911-63DEE13B9EB1" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Platform" Name="B1F30020-8BC3-4888-BB1B-4DD681F24209" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Plugin.Engine" Name="55239D60-0EB6-495B-874E-15DE5D5F9A70" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Plugin.RemovableMedia" Name="B55883E6-6C45-45C2-AB9D-800BB7B66B13" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvTool" Name="2BF4B6BA-556E-4D05-8534-CAFEDF19FED8" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.CommandCsp" Name="00BB69FC-60BC-4502-9438-25608F375CCB" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch" Name="08FACCFA-125D-4ED6-B0B7-B4A1A912E693" />
<EventProvider Id="EventProvider_Microsoft.Windows.EMPS.Enrollment" Name="E74EFD1A-B62D-4B83-AB00-66F4A166A2D3" />
<EventProvider Id="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment" Name="F9E3B648-9AF1-4DC3-9A8E-BF42C0FBCE9A" />
<EventProvider Id="Microsoft.Windows.HyperV.Vid" Name="1111450B-DACC-40A3-84AB-F7DBA4A6E63A" NonPagedMemory="true"/>
<EventProvider Id="Microsoft-Windows-HyperV-Vid" Name="5931D877-4860-4ee7-A95C-610A5F0D1407" NonPagedMemory="true" />
<EventProvider Id="virtdisk_wpp" Name="e14dcdd9-d1ec-4dc3-8395-a606df8ef115" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="virtdisk" Name="4D20DF22-E177-4514-A369-F1759FEEDEB3" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp" Name="E2816346-87F4-4F85-95C3-0C79409AA89D" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFD" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp_wpp" Name="3c70c3b0-2fae-41d3-b68d-8f7fcaf79adb" NonPagedMemory="true" Level="5">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="storvsp" Name="10b3d268-9782-49a4-aacc-a93c5482cb6f" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="HyperV_SyntheticStorage" Name="EDACD782-2564-4497-ADE6-7199377850F2" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="HyperV_EmulatedStorage" Name="86E15E01-EDF1-4AC7-89CF-B19563FD6894" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="EventProvider_Telemetry_StorVSP" Name="544d0787-9f6d-432e-8414-e035a8b0541d">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="EventProvider_Trace_Vhdmp" Name="dc284fb3-1eab-4854-828a-b25417280280" Level="3">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<Profile
Id="WSL.Verbose.File"
Name="WSL"
Description="Traces for all WSL components"
LoggingMode="File"
DetailLevel="Verbose"
>
<Collectors>
<EventCollectorId Value="Collector">
<EventProviders>
<EventProviderId Value="lxcore_kernel"/>
<EventProviderId Value="lxcore_user"/>
<EventProviderId Value="lxcore_service"/>
<EventProviderId Value="wsl_devicehost"/>
<EventProviderId Value="wslclient"/>
<EventProviderId Value="wslapi"/>
<EventProviderId Value="vm_chipset"/>
<EventProviderId Value="vmcompute_dll"/>
<EventProviderId Value="vmcompute"/>
<EventProviderId Value="vmmm"/>
<EventProviderId Value="vmwp"/>
<EventProviderId Value="9p"/>
<EventProviderId Value="9p_errors"/>
<EventProviderId Value="p9rdr"/>
<EventProviderId Value="mup"/>
<EventProviderId Value="rfsmon"/>
<EventProviderId Value="hyperv_storage"/>
<EventProviderId Value="hns"/>
<EventProviderId Value="netmgmt"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.AppDownload"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.Datastore"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.PhoneProvisioner"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.PPOEM"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.CSP"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Engine"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Migration"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Platform"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Operations"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Plugin.Engine"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Plugin.RemovableMedia"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvTool"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Operations"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.CommandCsp"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EMPS.Enrollment"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment"/>
<EventProviderId Value="Microsoft.Windows.HyperV.Vid"/>
<EventProviderId Value="Microsoft-Windows-HyperV-Vid"/>
<EventProviderId Value="virtdisk"/>
<EventProviderId Value="virtdisk_wpp"/>
<EventProviderId Value="vhdmp"/>
<EventProviderId Value="vhdmp_wpp"/>
<EventProviderId Value="storvsp"/>
<EventProviderId Value="HyperV_SyntheticStorage"/>
<EventProviderId Value="HyperV_EmulatedStorage"/>
<EventProviderId Value="EventProvider_Telemetry_StorVSP"/>
<EventProviderId Value="EventProvider_Trace_Vhdmp"/>
<EventProviderId Value="EventProvider_HvSocketTraceProvider" />
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
</Profiles>
</WindowsPerformanceRecorder>

View File

@ -1,410 +0,0 @@
<?xml version="1.0"?>
<WindowsPerformanceRecorder Version="1">
<Profiles>
<EventCollector Id="Collector" Name="Collector">
<BufferSize Value="256"/>
<Buffers Value="4096"/>
</EventCollector>
<EventProvider Id="lxcore_kernel" Name="0CD1C309-0878-4515-83DB-749843B3F5C9"/>
<EventProvider Id="lxcore_user" Name="D90B9468-67F0-5B3B-42CC-82AC81FFD960"/>
<EventProvider Id="lxcore_service" Name="B99CDB5A-039C-5046-E672-1A0DE0A40211"/>
<EventProvider Id="wsl_devicehost" Name="9d6c7b9e-2581-4d8a-b8c5-b90b4a17094a"/>
<EventProvider Id="wslclient" Name="8cbb7724-7223-5d6f-8137-564dac45104d"/>
<EventProvider Id="vm_chipset" Name="de9ba731-7f33-4f44-98c9-6cac856b9f83"/>
<EventProvider Id="vmcompute_dll" Name="AF7FD3A7-B248-460C-A9F5-FEC39EF8468C"/>
<EventProvider Id="vmcompute" Name="17103E3F-3C6E-4677-BB17-3B267EB5BE57"/>
<EventProvider Id="vmmm" Name="6066F867-7CA1-4418-85FD-36E3F9C0600C"/>
<EventProvider Id="vmwp" Name="51DDFA29-D5C8-4803-BE4B-2ECB715570FE"/>
<EventProvider Id="9p" Name="e13c8d52-b153-571f-78c5-1d4098af2a1e"/>
<EventProvider Id="9p_errors" Name="06C601B3-6957-4F8C-A15F-74875B24429D" />
<EventProvider Id="p9rdr" Name="bb1d36f0-e0e0-48cc-9493-fef0e3d0b28c" />
<EventProvider Id="mup" Name="20c46239-d059-4214-a11e-7d6769cbe020" />
<EventProvider Id="rfsmon" Name="51734B23-5B7E-4892-BA8E-45BC110B735C" />
<EventProvider Id="hyperv_storage" Name="c7ad62c6-5c99-5a1b-bbc4-0821ae5b765e" />
<EventProvider Id="hns" Name="0c885e0d-6eb6-476c-a048-2457eed3a5c1" />
<EventProvider Id="netmgmt" Name="93f693dc-9163-4dee-af64-d855218af242" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.AppDownload" Name="0BBE6221-EF09-4A3F-82EE-BE00DBB6A98A" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.Datastore" Name="42C60CEA-0FE7-4541-A86B-9E11F95BD9BF" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.PhoneProvisioner" Name="B876B1FC-C7F1-443E-9012-86677F7DE580" />
<EventProvider Id="EventProvider_Microsoft.Windows.Mobile.Provisioning.PPOEM" Name="7EDBED09-1FF7-4FEE-B8C3-5DB694420830" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.API" Name="82ADD491-01D7-4B85-9EAD-192C3CAACA23" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.CSP" Name="16E12400-A2D8-44B7-9479-004568EC7819" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Engine" Name="A6A847B7-4429-49AA-BBA6-2AD8C191AC8C" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Handlers" Name="0383D92C-2337-4F25-A0B5-A51767F04746" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Migration" Name="A0AF985E-83F9-4E1A-B658-338DCFE27893" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Operations" Name="7F99598F-B2C1-4371-9911-63DEE13B9EB1" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Platform" Name="B1F30020-8BC3-4888-BB1B-4DD681F24209" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Plugin.Engine" Name="55239D60-0EB6-495B-874E-15DE5D5F9A70" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.Plugin.RemovableMedia" Name="B55883E6-6C45-45C2-AB9D-800BB7B66B13" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvTool" Name="2BF4B6BA-556E-4D05-8534-CAFEDF19FED8" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.CommandCsp" Name="00BB69FC-60BC-4502-9438-25608F375CCB" />
<EventProvider Id="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch" Name="08FACCFA-125D-4ED6-B0B7-B4A1A912E693" />
<EventProvider Id="EventProvider_Microsoft.Windows.EMPS.Enrollment" Name="E74EFD1A-B62D-4B83-AB00-66F4A166A2D3" />
<EventProvider Id="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment" Name="F9E3B648-9AF1-4DC3-9A8E-BF42C0FBCE9A" />
<EventProvider Id="virtdisk_wpp" Name="e14dcdd9-d1ec-4dc3-8395-a606df8ef115" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="virtdisk" Name="4D20DF22-E177-4514-A369-F1759FEEDEB3" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp" Name="E2816346-87F4-4F85-95C3-0C79409AA89D" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFD" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp_wpp" Name="3c70c3b0-2fae-41d3-b68d-8f7fcaf79adb" NonPagedMemory="true" Level="5">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="LsaAudit_WPP" Name="DAA76F6A-2D11-4399-A646-1D62B7380F15" />
<EventProvider Id="Microsoft_Windows_ResourceManager_WPP" Name="4180C4F7-E238-5519-338F-EC214F0B49AA" />
<EventProvider Id="Microsoft_Windows_Security_NGC_KeyCredMgr_WPP" Name="34646397-1635-5D14-4D2C-2FEBDCCCF5E9" />
<EventProvider Id="Microsoft_Windows_Security_NGC_NgcIsoCtnr_WPP" Name="CDC6BEB9-6D78-5138-D232-D951916AB98F" />
<EventProvider Id="Microsoft_OneCore_NetworkingTriage_OnDemand" Name="ABB1FC61-49BA-4CC3-809F-7ABE1F8BA315" />
<EventProvider Id="wlidsvc_WPP" Name="3F8B9EF5-BBD2-4C81-B6C9-DA3CDB72D3C5" />
<EventProvider Id="Microsoft_Windows_WebIO" Name="50b3e73c-9370-461d-bb9f-26f32d68887d" />
<EventProvider Id="msxml_WPP" Name="927821F8-D9E6-42E2-84F2-949E18256F3A" />
<EventProvider Id="Microsoft_Windows_HttpService" Name="dd5ef90a-6398-47a4-ad34-4dcecdef795f" />
<EventProvider Id="Microsoft_Windows_Security_NGC_Trustlet_WPP" Name="C0B2937D-E634-56A2-1451-7D678AA3BC53" />
<EventProvider Id="Microsoft_Web_Platform_WPP" Name="FF32ADA1-5A4B-583C-889E-A3C027B201F5" />
<EventProvider Id="Microsoft_Windows_Shell_CloudDomainJoin_Client_WPP" Name="AA02D1A4-72D8-5F50-D425-7402EA09253A" />
<EventProvider Id="HTTP_sys_WPP" Name="20F61733-57F1-4127-9F48-4AB7A9308AE2" />
<EventProvider Id="CHAT_WPP" Name="9B52E09F-0C58-4EAF-877F-70F9B54A7946" />
<EventProvider Id="Microsoft_Windows_Security_NGC_NgcCtnrSvc_WPP" Name="9DF6A82D-5174-5EBF-842A-39947C48BF2A" />
<EventProvider Id="Microsoft_Windows_BranchCacheEventProvider" Name="dd85457f-4e2d-44a5-a7a7-6253362e34dc" />
<EventProvider Id="BFE_WPP" Name="106B464A-8043-46B1-8CB8-E92A0CD7A560" />
<EventProvider Id="kerb_WPP" Name="6B510852-3583-4E2D-AFFE-A67F9F223438" />
<EventProvider Id="Microsoft_Windows_Runtime_Web_Http" Name="41877cb4-11fc-4188-b590-712c143c881d" />
<EventProvider Id="Microsoft_Windows_Shell_CloudExperienceHost_WPP" Name="D0034F5E-3686-5A74-DC48-5A22DD4F3D5B" />
<EventProvider Id="NCRYPT_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473301" />
<EventProvider Id="pku2u_WPP" Name="2A6FAF47-5449-4805-89A3-A504F3E221A6" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_Service_WPP" Name="39A5AA08-031D-4777-A32D-ED386BF03470" />
<EventProvider Id="CAPI1_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473305" />
<EventProvider Id="Microsoft_Windows_Security_DevCredTask_WPP" Name="86D5FE65-0564-4618-B90B-E146049DEBF4" />
<EventProvider Id="MsQuic_WPP" Name="620FD025-BE51-42EF-A5C0-50F13F183AD9" />
<EventProvider Id="Microsoft_Windows_Security_DevCredClient_WPP" Name="78983C7D-917F-58DA-E8D4-F393DECF4EC0" />
<EventProvider Id="Microsoft_Windows_Security_NGC_Local_WPP" Name="3B9DBF69-E9F0-5389-D054-A94BC30E33F7" />
<EventProvider Id="Microsoft_Windows_DM_Enrollment_Provider_WPP" Name="9FBF7B95-0697-4935-ADA2-887BE9DF12BC" />
<EventProvider Id="TokenBinding_WPP" Name="AEF66A73-A765-4421-B348-B7E0FC8C9898" />
<EventProvider Id="KerbClientShared_WPP" Name="FACB33C4-4513-4C38-AD1E-57C1F6828FC0" />
<EventProvider Id="Microsoft_OneCore_NetworkingTriage_RoutePolicyManagement" Name="923C0FFD-7933-4B52-8A49-121ABF2DC357" />
<EventProvider Id="ntlm_WPP" Name="5BBB6C18-AA45-49B1-A15F-085F7ED0AA90" />
<EventProvider Id="NCRYPTSSLP_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473304" />
<EventProvider Id="Microsoft_Windows_CAPI2_WPP" Name="5BBCA4A8-B209-48DC-A8C7-B23D3E5216FB" />
<EventProvider Id="DNS_WPP" Name="609151DD-04F5-4DA7-974C-FC6947EAA323" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_CertEnroll_WPP" Name="54164045-7C50-4905-963F-E5BC1EEF0CCA" />
<EventProvider Id="Webio_WPP" Name="08F93B14-1608-4A72-9CFA-457EECEDBBA7" />
<EventProvider Id="TPM_WPP" Name="3A8D6942-B034-48E2-B314-F69C2B4655A3" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_Lifecycle_User_WPP" Name="BEA18B89-126F-4155-9EE4-D36038B02680" />
<EventProvider Id="Microsoft_Windows_MicrosoftAccount_TBProvider_WPP" Name="5836994D-A677-53E7-1389-588AD1420CC5" />
<EventProvider Id="vault_WPP" Name="7FDD167C-79E5-4403-8C84-B7C0BB9923A1" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_Client_WPP" Name="1B5106B1-7622-4740-AD81-D9C6EE74F124" />
<EventProvider Id="Microsoft_Windows_BranchCacheClientEventProvider" Name="e837619c-a2a8-4689-833f-47b48ebd2442" />
<EventProvider Id="CRYPTOWINRT_WPP" Name="786396CD-2FF3-53D3-D1CA-43E41D9FB73B" />
<EventProvider Id="Microsoft_Windows_Security_NGC_CryptNgc_WPP" Name="6D7051A0-9C83-5E52-CF8F-0ECAF5D5F6FD" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_AutoEnrollment_WPP" Name="F0DB7EF8-B6F3-4005-9937-FEB77B9E1B43" />
<EventProvider Id="Microsoft_Windows_CertPolEng_WPP" Name="AF9CC194-E9A8-42BD-B0D1-834E9CFAB799" />
<EventProvider Id="dpapis_WPP" Name="EA3F84FC-03BB-540E-B6AA-9664F81A31FB" />
<EventProvider Id="Microsoft_Windows_CertificationAuthorityClient_CertCli_WPP" Name="98BF1CD3-583E-4926-95EE-A61BF3F46470" />
<EventProvider Id="KerbComm_WPP" Name="60A7AB7A-BC57-43E9-B78A-A1D516577AE3" />
<EventProvider Id="Microsoft_Windows_Security_LsaSrv_WPP" Name="4D9DFB91-4337-465A-A8B5-05A27D930D48" />
<EventProvider Id="Microsoft_Windows_Security_AADAuthHelper_WPP" Name="9EBB3B15-B094-41B1-A3B8-0F141B06BADD" />
<EventProvider Id="TLS_WPP" Name="37D2C3CD-C5D4-4587-8531-4696C44244C8" />
<EventProvider Id="webauth_WPP" Name="EF98103D-8D3A-4BEF-9DF2-2156563E64FA" />
<EventProvider Id="idlisten_WPP" Name="D93FE84A-795E-4608-80EC-CE29A96C8658" />
<EventProvider Id="Winsock_WPP" Name="1D44957B-7181-4835-B70A-D0B16112A4DE" />
<EventProvider Id="Microsoft_Windows_Security_NGC_KspSvc_WPP" Name="B66B577F-AE49-5CCF-D2D7-8EB96BFD440C" />
<EventProvider Id="aad_WPP" Name="4DE9BC9C-B27A-43C9-8994-0915F1A5E24F" />
<EventProvider Id="LsaIso_WPP" Name="366B218A-A5AA-4096-8131-0BDAFCC90E93" />
<EventProvider Id="Microsoft_Windows_Security_TokenBroker_WPP" Name="077B8C4A-E425-578D-F1AC-6FDF1220FF68" />
<EventProvider Id="CNG_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473303" />
<EventProvider Id="NtlmShared_WPP" Name="AC69AE5B-5B21-405F-8266-4424944A43E9" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_Lifecycle_System_WPP" Name="BC0669E1-A10D-4A78-834E-1CA3C806C93B" />
<EventProvider Id="Microsoft_Windows_DeviceManagement_SCEP_WPP" Name="D5A5B540-C580-4DEE-8BB4-185E34AA00C5" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_CredentialProvider_Face_WPP" Name="1D480C11-3870-4B19-9144-47A53CD973BD" />
<EventProvider Id="credssp_WPP" Name="6165F3E2-AE38-45D4-9B23-6B4818758BD9" />
<EventProvider Id="basecsp_WPP" Name="133A980D-035D-4E2D-B250-94577AD8FCED" />
<EventProvider Id="gMSAClient_WPP" Name="2D45EC97-EF01-4D4F-B9ED-EE3F4D3C11F3" />
<EventProvider Id="Microsoft_Windows_Security_DeviceLock_WPP" Name="2056054C-97A6-5AE4-B181-38BC6B58007E" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_FingerprintCredential_WPP" Name="225B3FED-0356-59D1-1F82-EED163299FA8" />
<EventProvider Id="BCRYPT_WPP" Name="A74EFE00-14BE-4EF9-9DA9-1484D5473302" />
<EventProvider Id="idstore_WPP" Name="82C7D3DF-434D-44FC-A7CC-453A8075144E" />
<EventProvider Id="Wininet_WPP" Name="4E749B6A-667D-4C72-80EF-373EE3246B08" />
<EventProvider Id="idcommon_WPP" Name="B1108F75-3252-4B66-9239-80FD47E06494" />
<EventProvider Id="Microsoft_Windows_DNS_Client" Name="1c95126e-7eea-49a9-a3fe-a378b03ddb4d" />
<EventProvider Id="Microsoft_Windows_DNS_Client_Configuration_PowerShell" Name="563a50d8-3536-4c8a-a361-b37af04094ec" />
<EventProvider Id="Microsoft-Windows-DHCP-Client" Name="15A7A4F8-0072-4EAB-ABAD-F98A4D666AED" />
<EventProvider Id="Microsoft-Windows-DHCPv6-Client" Name="6A1F2B00-6A90-4C38-95A5-5CAB3B056778" />
<EventProvider Id="Microsoft_Windows_AppModel_Exec_WPP" Name="EB65A492-86C0-406A-BACE-9912D595BD69" />
<EventProvider Id="Microsoft_Windows_Security_DevCredSvc_WPP" Name="C3FEB5BF-1A8D-53F3-AAA8-44496392BF69" />
<EventProvider Id="Microsoft_Quic_ETW" Name="ff15e657-4f26-570e-88ab-0796b258d11c" />
<EventProvider Id="LsaDs_WPP" Name="169EC169-5B77-4A3E-9DB6-441799D5CACB" />
<EventProvider Id="Microsoft_Windows_WBioSrvc_WPP" Name="34BEC984-F11F-4F1F-BB9B-3BA33C8D0132" />
<EventProvider Id="Microsoft_Windows_Security_AADCloudAPPlugin_WPP" Name="556045FD-58C5-4A97-9881-B121F68B79C5" />
<EventProvider Id="Microsoft_Windows_CertificateServices_Deployment_WPP" Name="B2D1F576-2E85-4489-B504-1861C40544B3" />
<EventProvider Id="Microsoft_Windows_Security_NGC_CSP_WPP" Name="89F392FF-EE7C-56A3-3F61-2D5B31A36935" />
<EventProvider Id="kps_WPP" Name="97A38277-13C0-4394-A0B2-2A70B465D64F" />
<EventProvider Id="WinHttp_WPP" Name="B3A7698A-0C45-44DA-B73D-E181C9B5C8E6" />
<EventProvider Id="Microsoft_Windows_Security_NGC_NgcCtnr_WPP" Name="0ABA6892-455B-551D-7DA8-3A8F85225E1A" />
<EventProvider Id="Microsoft_Windows_Security_DevCredWinRt_WPP" Name="36FF4C84-82A2-4B23-8BA5-A25CBDFF3410" />
<EventProvider Id="Microsoft_Windows_Security_NGC_KeyStaging_WPP" Name="9B223F67-67A1-5B53-9126-4593FE81DF25" />
<EventProvider Id="dclocator_WPP" Name="CA030134-54CD-4130-9177-DAE76A3C5791" />
<EventProvider Id="webplatform_WPP" Name="2A3C6602-411E-4DC6-B138-EA19D64F5BBA" />
<EventProvider Id="Microsoft_Windows_Security_NGC_CredProv_WPP" Name="CAC8D861-7B16-5B6B-5FC0-85014776BDAC" />
<EventProvider Id="Microsoft_Windows_ProcessStateManager_WPP" Name="D49918CF-9489-4BF1-9D7B-014D864CF71F" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_CredentialRoaming_WPP" Name="89A2278B-C662-4AFF-A06C-46AD3F220BCA" />
<EventProvider Id="Microsoft_Windows_LiveId_WPP" Name="05F02597-FE85-4E67-8542-69567AB8FD4F" />
<EventProvider Id="Microsoft_Windows_Security_Fido_WPP" Name="08B15CE7-C9FF-5E64-0D16-66589573C50F" />
<EventProvider Id="Microsoft_Windows_Security_DevCredProv_WPP" Name="7955D36A-450B-5E2A-A079-95876BCA450A" />
<EventProvider Id="kdc_WPP" Name="1BBA8B19-7F31-43C0-9643-6E911F79A06B" />
<EventProvider Id="Microsoft_Windows_Security_Credentials_UserConsentVerifier_WPP" Name="507C53AE-AF42-5938-AEDE-4A9D908640ED" />
<EventProvider Id="Microsoft_OSG_OSS_CredProvFramework_ReportResultStop_WPP" Name="8DB3086D-116F-5BED-CFD5-9AFDA80D28EA" />
<EventProvider Id="livessp_WPP" Name="C10B942D-AE1B-4786-BC66-052E5B4BE40E" />
<EventProvider Id="Netio_WPP" Name="EB004A05-9B1A-11D4-9123-0050047759BC" />
<EventProvider Id="PortTrackerServer_WPP" Name="090bf343-4490-42d3-b273-8af174d314fb" />
<EventProvider Id="mpssvcService" Name="5EEFEBDB-E90C-423a-8ABF-0241E7C5B87D" />
<EventProvider Id="Microsoft_Windows_DNS_Client_WinRNR" Name="b923f87a-b069-42b5-bd32-35623aba1c48" />
<EventProvider Id="digest_WPP" Name="FB6A424F-B5D6-4329-B9B5-A975B3A93EAD" />
<EventProvider Id="Microsoft_Windows_CertificateServicesClient_WPP" Name="73370BD6-85E5-430B-B60A-FEA1285808A7" />
<EventProvider Id="negoexts_WPP" Name="5AF52B0D-E633-4EAD-828A-4B85B8DAAC2B" />
<EventProvider Id="Microsoft_Windows_Security_NGC_LocalAccountMigPlugin_WPP" Name="CDD94AC7-CD2F-5189-E126-2DEB1B2FACBF" />
<EventProvider Id="LsaTrace_WPP" Name="D0B639E0-E650-4D1D-8F39-1580ADE72784" />
<EventProvider Id="Microsoft_Windows_DeviceManagement_Enterprise_Diagnostics_Provider_WPP" Name="3DA494E4-0FE2-415C-B895-FB5265C5C83B" />
<EventProvider Id="Microsoft_OSG_Wininet_WPP" Name="1A211EE8-52DB-4AF0-BB66-FB8C9F20B0E2" />
<EventProvider Id="Microsoft_Windows_Security_NGC_PopKeySrv_WPP" Name="1D6540CE-A81B-4E74-AD35-EEF8463F97F5" />
<EventProvider Id="UrlMon_WPP" Name="3FAB3162-24CE-4ED5-B23D-63501544E11D" />
<EventProvider Id="Microsoft_Windows_WinINet" Name="43d1a55c-76d6-4f7e-995c-64c711e5cafe" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_BioCredProv_WPP" Name="9DADD79B-D556-53F2-67C4-129FA62B7512" />
<EventProvider Id="Microsoft_OneCore_NetworkingTriage_GetConnected" Name="60523747-6516-48B7-84B1-3264FA2CB359" />
<EventProvider Id="Microsoft_Windows_Security_NGC_Recovery_WPP" Name="9D4CA978-8A14-545E-C047-A45991F0E92F" />
<EventProvider Id="Microsoft_Windows_Winsock_NameResolution" Name="55404E71-4DB9-4DEB-A5F5-8F86E46DDE56" />
<EventProvider Id="Microsoft_Windows_WinHttp" Name="7d44233d-3055-4b9c-ba64-0d47ca40a232" />
<EventProvider Id="Microsoft_Windows_Security_Biometrics_Trustlet_WPP" Name="9DF19CFA-E122-5343-284B-F3945CCD65B2" />
<EventProvider Id="cloudap_WPP" Name="EC3CA551-21E9-47D0-9742-1195429831BB" />
<EventProvider Id="Microsoft_Windows_BrokerInfrastructure_WPP" Name="63B6C2D2-0440-44DE-A674-AA51A251B123" />
<EventProvider Id="IPNat" Name="AE3F6C6D-BF2A-4291-9D07-59E661274EE3" />
<EventProvider Id="SharedAccessWPP" Name="9B322459-4AD9-4F81-8EEA-DC77CDD18CA6" />
<EventProvider Id="WinNatSys" Name="aa7387cf-3639-496a-b3bf-dc1e79a6fc5a" />
<EventProvider Id="Microsoft-Windows-TCPIP" Name="2f07e2ee-15db-40f1-90ef-9d7ba282188a" NonPagedMemory="true" EventKey="true" Strict="true"/>
<EventProvider Id="Microsoft-Windows-WinNat" Name="66C07ECD-6667-43FC-93F8-05CF07F446EC" />
<EventProvider Id="Microsoft-Windows-Overlay-HNSPlugin" Name="564368D6-577B-4af5-AD84-1C54464848E6" />
<EventProvider Id="Microsoft.Windows.HyperV.Compute" Name="80CE50DE-D264-4581-950D-ABADEEE0D340" />
<EventProvider Id="Microsoft.Windows.HostNetworkingService.PrivateCloudPlugin" Name="D0E4BC17-34C7-43fc-9A72-D89A59D6979A" />
<EventProvider Id="Microsoft-Windows-Host-Network-Management" Name="93f693dc-9163-4dee-af64-d855218af242" />
<EventProvider Id="Microsoft-Windows-SharedAccess_NAT" Name="A6F32731-9A38-4159-A220-3D9B7FC5FE5D" />
<EventProvider Id="Microsoft.Windows.Hyper.V.VmsIf" Name="6C28C7E5-331B-4437-9C69-5352A2F7F296" />
<EventProvider Id="VmSwitch_wpp" Name="1F387CBC-6818-4530-9DB6-5F1058CD7E86"/>
<EventProvider Id="ndis_wpp" Name="DD7A21E6-A651-46D4-B7C2-66543067B869"/>
<EventProvider Id="Microsoft-Windows-Hyper-V-VmSwitch" Name="67DC0D66-3695-47C0-9642-33F76F7BD7AD"/>
<EventProvider Id="Microsoft.Windows.Hyper.V.NetSetupHelper" Name="94DEB9D1-0A52-449B-B368-41E4426B4F36"/>
<EventProvider Id="Microsoft-Windows-Hyper-V-VfpExt" Name="9F2660EA-CFE7-428F-9850-AECA612619B0"/>
<EventProvider Id="Microsoft.Windows.Networking.FlowSteering" Name="662abf07-6dda-5b25-c2c5-345236dbb2d2"/>
<EventProvider Id="Microsoft.Windows.HyperV.Socket" Name="b2ed3bdb-cd74-5b2c-f660-85079ca074b3"/>
<Profile
Id="WSL.Verbose.File"
Name="WSL"
Description="Traces for all WSL components"
LoggingMode="File"
DetailLevel="Verbose"
>
<Collectors>
<EventCollectorId Value="Collector">
<EventProviders>
<EventProviderId Value="lxcore_kernel"/>
<EventProviderId Value="lxcore_user"/>
<EventProviderId Value="lxcore_service"/>
<EventProviderId Value="wsl_devicehost"/>
<EventProviderId Value="wslclient"/>
<EventProviderId Value="vm_chipset"/>
<EventProviderId Value="vmcompute_dll"/>
<EventProviderId Value="vmcompute"/>
<EventProviderId Value="vmmm"/>
<EventProviderId Value="vmwp"/>
<EventProviderId Value="9p"/>
<EventProviderId Value="9p_errors"/>
<EventProviderId Value="p9rdr"/>
<EventProviderId Value="mup"/>
<EventProviderId Value="rfsmon"/>
<EventProviderId Value="hyperv_storage"/>
<EventProviderId Value="hns"/>
<EventProviderId Value="netmgmt"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.AppDownload"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.Datastore"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.PhoneProvisioner"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Mobile.Provisioning.PPOEM"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.CSP"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Engine"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Migration"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Platform"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Operations"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Plugin.Engine"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Plugin.RemovableMedia"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvTool"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.Operations"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.CommandCsp"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.Provisioning.ProvLaunch"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EMPS.Enrollment"/>
<EventProviderId Value="EventProvider_Microsoft.Windows.EnterpriseManagement.Enrollment"/>
<EventProviderId Value="virtdisk"/>
<EventProviderId Value="virtdisk_wpp"/>
<EventProviderId Value="vhdmp"/>
<EventProviderId Value="vhdmp_wpp"/>
<EventProviderId Value="LsaAudit_WPP"/>
<EventProviderId Value="Microsoft_Windows_ResourceManager_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_KeyCredMgr_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_NgcIsoCtnr_WPP"/>
<EventProviderId Value="Microsoft_OneCore_NetworkingTriage_OnDemand"/>
<EventProviderId Value="wlidsvc_WPP"/>
<EventProviderId Value="Microsoft_Windows_WebIO"/>
<EventProviderId Value="msxml_WPP"/>
<EventProviderId Value="Microsoft_Windows_HttpService"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_Trustlet_WPP"/>
<EventProviderId Value="Microsoft_Web_Platform_WPP"/>
<EventProviderId Value="Microsoft_Windows_Shell_CloudDomainJoin_Client_WPP"/>
<EventProviderId Value="HTTP_sys_WPP"/>
<EventProviderId Value="CHAT_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_NgcCtnrSvc_WPP"/>
<EventProviderId Value="Microsoft_Windows_BranchCacheEventProvider"/>
<EventProviderId Value="BFE_WPP"/>
<EventProviderId Value="kerb_WPP"/>
<EventProviderId Value="Microsoft_Windows_Runtime_Web_Http"/>
<EventProviderId Value="Microsoft_Windows_Shell_CloudExperienceHost_WPP"/>
<EventProviderId Value="NCRYPT_WPP"/>
<EventProviderId Value="pku2u_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_Service_WPP"/>
<EventProviderId Value="CAPI1_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredTask_WPP"/>
<EventProviderId Value="MsQuic_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredClient_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_Local_WPP"/>
<EventProviderId Value="Microsoft_Windows_DM_Enrollment_Provider_WPP"/>
<EventProviderId Value="TokenBinding_WPP"/>
<EventProviderId Value="KerbClientShared_WPP"/>
<EventProviderId Value="Microsoft_OneCore_NetworkingTriage_RoutePolicyManagement"/>
<EventProviderId Value="ntlm_WPP"/>
<EventProviderId Value="NCRYPTSSLP_WPP"/>
<EventProviderId Value="Microsoft_Windows_CAPI2_WPP"/>
<EventProviderId Value="DNS_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_CertEnroll_WPP"/>
<EventProviderId Value="Webio_WPP"/>
<EventProviderId Value="TPM_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_Lifecycle_User_WPP"/>
<EventProviderId Value="Microsoft_Windows_MicrosoftAccount_TBProvider_WPP"/>
<EventProviderId Value="vault_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_Client_WPP"/>
<EventProviderId Value="Microsoft_Windows_BranchCacheClientEventProvider"/>
<EventProviderId Value="CRYPTOWINRT_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_CryptNgc_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_AutoEnrollment_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertPolEng_WPP"/>
<EventProviderId Value="dpapis_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificationAuthorityClient_CertCli_WPP"/>
<EventProviderId Value="KerbComm_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_LsaSrv_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_AADAuthHelper_WPP"/>
<EventProviderId Value="TLS_WPP"/>
<EventProviderId Value="webauth_WPP"/>
<EventProviderId Value="idlisten_WPP"/>
<EventProviderId Value="Winsock_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_KspSvc_WPP"/>
<EventProviderId Value="aad_WPP"/>
<EventProviderId Value="LsaIso_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_TokenBroker_WPP"/>
<EventProviderId Value="CNG_WPP"/>
<EventProviderId Value="NtlmShared_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_Lifecycle_System_WPP"/>
<EventProviderId Value="Microsoft_Windows_DeviceManagement_SCEP_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_CredentialProvider_Face_WPP"/>
<EventProviderId Value="credssp_WPP"/>
<EventProviderId Value="basecsp_WPP"/>
<EventProviderId Value="gMSAClient_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DeviceLock_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_FingerprintCredential_WPP"/>
<EventProviderId Value="BCRYPT_WPP"/>
<EventProviderId Value="idstore_WPP"/>
<EventProviderId Value="Wininet_WPP"/>
<EventProviderId Value="idcommon_WPP"/>
<EventProviderId Value="Microsoft_Windows_DNS_Client"/>
<EventProviderId Value="Microsoft_Windows_DNS_Client_Configuration_PowerShell"/>
<EventProviderId Value="Microsoft-Windows-DHCP-Client"/>
<EventProviderId Value="Microsoft-Windows-DHCPv6-Client"/>
<EventProviderId Value="Microsoft_Windows_AppModel_Exec_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredSvc_WPP"/>
<EventProviderId Value="Microsoft_Quic_ETW"/>
<EventProviderId Value="LsaDs_WPP"/>
<EventProviderId Value="Microsoft_Windows_WBioSrvc_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_AADCloudAPPlugin_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServices_Deployment_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_CSP_WPP"/>
<EventProviderId Value="kps_WPP"/>
<EventProviderId Value="WinHttp_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_NgcCtnr_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredWinRt_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_KeyStaging_WPP"/>
<EventProviderId Value="dclocator_WPP"/>
<EventProviderId Value="webplatform_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_CredProv_WPP"/>
<EventProviderId Value="Microsoft_Windows_ProcessStateManager_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_CredentialRoaming_WPP"/>
<EventProviderId Value="Microsoft_Windows_LiveId_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Fido_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_DevCredProv_WPP"/>
<EventProviderId Value="kdc_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_Credentials_UserConsentVerifier_WPP"/>
<EventProviderId Value="Microsoft_OSG_OSS_CredProvFramework_ReportResultStop_WPP"/>
<EventProviderId Value="livessp_WPP"/>
<EventProviderId Value="Netio_WPP"/>
<EventProviderId Value="PortTrackerServer_WPP"/>
<EventProviderId Value="mpssvcService"/>
<EventProviderId Value="Microsoft_Windows_DNS_Client_WinRNR"/>
<EventProviderId Value="digest_WPP"/>
<EventProviderId Value="Microsoft_Windows_CertificateServicesClient_WPP"/>
<EventProviderId Value="negoexts_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_LocalAccountMigPlugin_WPP"/>
<EventProviderId Value="LsaTrace_WPP"/>
<EventProviderId Value="Microsoft_Windows_DeviceManagement_Enterprise_Diagnostics_Provider_WPP"/>
<EventProviderId Value="Microsoft_OSG_Wininet_WPP"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_PopKeySrv_WPP"/>
<EventProviderId Value="UrlMon_WPP"/>
<EventProviderId Value="Microsoft_Windows_WinINet"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_BioCredProv_WPP"/>
<EventProviderId Value="Microsoft_OneCore_NetworkingTriage_GetConnected"/>
<EventProviderId Value="Microsoft_Windows_Security_NGC_Recovery_WPP"/>
<EventProviderId Value="Microsoft_Windows_Winsock_NameResolution"/>
<EventProviderId Value="Microsoft_Windows_WinHttp"/>
<EventProviderId Value="Microsoft_Windows_Security_Biometrics_Trustlet_WPP"/>
<EventProviderId Value="cloudap_WPP"/>
<EventProviderId Value="Microsoft_Windows_BrokerInfrastructure_WPP"/>
<EventProviderId Value="IPNat"/>
<EventProviderId Value="SharedAccessWPP"/>
<EventProviderId Value="WinNatSys"/>
<EventProviderId Value="Microsoft-Windows-TCPIP"/>
<EventProviderId Value="Microsoft-Windows-WinNat"/>
<EventProviderId Value="Microsoft-Windows-Overlay-HNSPlugin"/>
<EventProviderId Value="Microsoft.Windows.HyperV.Compute"/>
<EventProviderId Value="Microsoft.Windows.HostNetworkingService.PrivateCloudPlugin"/>
<EventProviderId Value="Microsoft-Windows-Host-Network-Management"/>
<EventProviderId Value="Microsoft-Windows-SharedAccess_NAT"/>
<EventProviderId Value="Microsoft.Windows.Hyper.V.VmsIf"/>
<EventProviderId Value="VmSwitch_wpp"/>
<EventProviderId Value="ndis_wpp"/>
<EventProviderId Value="Microsoft-Windows-Hyper-V-VmSwitch"/>
<EventProviderId Value="Microsoft.Windows.Hyper.V.NetSetupHelper"/>
<EventProviderId Value="Microsoft-Windows-Hyper-V-VfpExt"/>
<EventProviderId Value="Microsoft.Windows.Networking.FlowSteering"/>
<EventProviderId Value="Microsoft.Windows.HyperV.Socket"/>
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
</Profiles>
</WindowsPerformanceRecorder>

View File

@ -1,123 +0,0 @@
<?xml version="1.0"?>
<WindowsPerformanceRecorder Version="1">
<Profiles>
<EventCollector Id="Collector" Name="Collector">
<BufferSize Value="256"/>
<Buffers Value="1024"/>
</EventCollector>
<EventProvider Id="lxcore_kernel" Name="0CD1C309-0878-4515-83DB-749843B3F5C9"/>
<EventProvider Id="lxcore_user" Name="D90B9468-67F0-5B3B-42CC-82AC81FFD960"/>
<EventProvider Id="lxcore_service" Name="B99CDB5A-039C-5046-E672-1A0DE0A40211"/>
<EventProvider Id="vm_chipset" Name="de9ba731-7f33-4f44-98c9-6cac856b9f83"/>
<EventProvider Id="vmcompute_dll" Name="AF7FD3A7-B248-460C-A9F5-FEC39EF8468C"/>
<EventProvider Id="vmcompute" Name="17103E3F-3C6E-4677-BB17-3B267EB5BE57"/>
<EventProvider Id="vmmm" Name="6066F867-7CA1-4418-85FD-36E3F9C0600C"/>
<EventProvider Id="vmwp" Name="51DDFA29-D5C8-4803-BE4B-2ECB715570FE"/>
<EventProvider Id="9p" Name="e13c8d52-b153-571f-78c5-1d4098af2a1e"/>
<EventProvider Id="p9rdr" Name="bb1d36f0-e0e0-48cc-9493-fef0e3d0b28c" />
<EventProvider Id="mup" Name="20c46239-d059-4214-a11e-7d6769cbe020" />
<EventProvider Id="rfsmon" Name="51734B23-5B7E-4892-BA8E-45BC110B735C" />
<EventProvider Id="hyperv_storage" Name="c7ad62c6-5c99-5a1b-bbc4-0821ae5b765e" />
<EventProvider Id="hns" Name="0c885e0d-6eb6-476c-a048-2457eed3a5c1" />
<EventProvider Id="netmgmt" Name="93f693dc-9163-4dee-af64-d855218af242" />
<EventProvider Id="storvsp_io" Name="10b3d268-9782-49a4-aacc-a93c5482cb6f" NonPagedMemory="true">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="virtdisk_wpp" Name="e14dcdd9-d1ec-4dc3-8395-a606df8ef115" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="virtdisk" Name="4D20DF22-E177-4514-A369-F1759FEEDEB3" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp" Name="E2816346-87F4-4F85-95C3-0C79409AA89D" NonPagedMemory="true" Level="5">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="vhdmp_wpp" Name="3c70c3b0-2fae-41d3-b68d-8f7fcaf79adb" NonPagedMemory="true" Level="5">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="HyperV_SyntheticStorage" Name="EDACD782-2564-4497-ADE6-7199377850F2" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="HyperV_EmulatedStorage" Name="86E15E01-EDF1-4AC7-89CF-B19563FD6894" Level="6">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="EventProvider_Telemetry_StorVSP" Name="544d0787-9f6d-432e-8414-e035a8b0541d">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="EventProvider_Trace_Vhdmp" Name="dc284fb3-1eab-4854-828a-b25417280280" Level="3">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<EventProvider Id="storvsp_wpp" Name="f96abc17-6a5e-4a49-a3f4-a2a86fa03846" NonPagedMemory="true" Level="4">
<Keywords>
<Keyword Value="0xFFFFFFFFFFFFFFFF" />
</Keywords>
</EventProvider>
<Profile
Id="WSL.Verbose.File"
Name="WSL"
Description="Traces for all WSL components"
LoggingMode="File"
DetailLevel="Verbose"
>
<Collectors>
<EventCollectorId Value="Collector">
<EventProviders>
<EventProviderId Value="lxcore_kernel"/>
<EventProviderId Value="lxcore_user"/>
<EventProviderId Value="lxcore_service"/>
<EventProviderId Value="vm_chipset"/>
<EventProviderId Value="vmcompute_dll"/>
<EventProviderId Value="vmcompute"/>
<EventProviderId Value="vmmm"/>
<EventProviderId Value="vmwp"/>
<EventProviderId Value="9p"/>
<EventProviderId Value="p9rdr"/>
<EventProviderId Value="mup"/>
<EventProviderId Value="rfsmon"/>
<EventProviderId Value="hyperv_storage"/>
<EventProviderId Value="hns"/>
<EventProviderId Value="netmgmt"/>
<EventProviderId Value="storvsp_io"/>
<EventProviderId Value="virtdisk"/>
<EventProviderId Value="virtdisk_wpp"/>
<EventProviderId Value="vhdmp"/>
<EventProviderId Value="vhdmp_wpp"/>
<EventProviderId Value="HyperV_SyntheticStorage"/>
<EventProviderId Value="HyperV_EmulatedStorage"/>
<EventProviderId Value="EventProvider_Telemetry_StorVSP"/>
<EventProviderId Value="EventProvider_Trace_Vhdmp"/>
<EventProviderId Value="storvsp_wpp"/>
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
</Profiles>
</WindowsPerformanceRecorder>

View File

@ -34,12 +34,12 @@
"FriendlyName": "openSUSE Tumbleweed",
"Default": true,
"Amd64Url": {
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250923.0/openSUSE-Tumbleweed-20250922.x86_64-22.59-Build22.59.wsl",
"Sha256": "0x31124e3645d88b079469a57062af795b04922d3baacfb70c6dad2524c2bfc8c0"
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20260106.0/openSUSE-Tumbleweed-20260103.x86_64-1.224-Build1.224.wsl",
"Sha256": "0x394be699da2821b331355f3541e237aa3aa00bc4068f33283d68303d8336d484"
},
"Arm64Url": {
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250923.0/openSUSE-Tumbleweed-20250922.aarch64-22.124-Build22.124.wsl",
"Sha256": "0x0202195a7e03bb45e7ff95e9929b977db899ce85ccaa1195bdab4a74783e9bf7"
"Url": "https://github.com/openSUSE/WSL-instarball/releases/download/v20260106.0/openSUSE-Tumbleweed-20260103.aarch64-2.195-Build2.195.wsl",
"Sha256": "0xbcbb88e957091c425ecb42f3076b8882b5976fd94885e453afaee40de3b79470"
}
},
{
@ -82,12 +82,12 @@
"FriendlyName": "Kali Linux Rolling",
"Default": true,
"Amd64Url": {
"Url": "https://kali.download/wsl-images/kali-2025.3/kali-linux-2025.3-wsl-rootfs-amd64.wsl",
"Sha256": "dda0ff3ffe4465cf2af1061262e44cec5a90c1eccb71fe5ccfb1b0fceb5e23a8"
"Url": "https://kali.download/wsl-images/kali-2025.4/kali-linux-2025.4-wsl-rootfs-amd64.wsl",
"Sha256": "86aba7bb3d74d313e349f9f50d3f6119ee3b1491072920d063f17ce9b3f706ab"
},
"Arm64Url": {
"Url": "https://kali.download/wsl-images/kali-2025.3/kali-linux-2025.3-wsl-rootfs-arm64.wsl",
"Sha256": "e175688d9c305b621e701bb11e54f57ac772aed7fa1d94e3f6cb812c1e5e806f"
"Url": "https://kali.download/wsl-images/kali-2025.4/kali-linux-2025.4-wsl-rootfs-arm64.wsl",
"Sha256": "bd8cdfe340ec596e470b6853ac662382897bc656c0ac3d3096eb399d0780e25e"
}
}
],
@ -166,8 +166,8 @@
"FriendlyName": "Arch Linux",
"Default": true,
"Amd64Url": {
"Url": "https://fastly.mirror.pkgbuild.com/wsl/2025.12.01.153427/archlinux-2025.12.01.153427.wsl",
"Sha256": "8dfe92910a188f191b0af2972bd4bda661178b769ce820a8921e8b7aeae9a517"
"Url": "https://fastly.mirror.pkgbuild.com/wsl/2026.02.01.158360/archlinux-2026.02.01.158360.wsl",
"Sha256": "e3287ab9f0458240fc6a966849dbc69188bdc7ef376dc27d441aef6f13dd45e5"
}
}
],
@ -198,6 +198,17 @@
"Sha256": "a5a2ceb8ca56b7245b909d021b0fd620427db349f02b8ef3b82b741bcb5611cd"
}
}
],
"eLxr": [
{
"Name": "eLxr",
"FriendlyName": "eLxr 12.12.0.0 GNU/Linux",
"Default": true,
"Amd64Url": {
"Url": "https://gitlab.com/api/v4/projects/68007430/packages/generic/wsl/12.12.0.0/eLxr_WSL_AMD64_12.12.0.0.wsl",
"Sha256": "f94e0c44be51550478100ea150b80535f955bf87487d1b964f4636d97478c05d"
}
}
]
},
"Default": "Ubuntu",
@ -318,8 +329,8 @@
"StoreAppId": "9MSSK2ZXXN11",
"Amd64": true,
"Arm64": true,
"Amd64PackageUrl": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250923.0/openSUSE-Tumbleweed-20250922-WSL.x86_64-25265.9.1077.0-Build9.1077.appx",
"Arm64PackageUrl": "https://github.com/openSUSE/WSL-instarball/releases/download/v20250923.0/openSUSE-Tumbleweed-20250922-WSL.aarch64-25265.9.542.0-Build9.542.appx",
"Amd64PackageUrl": "https://github.com/openSUSE/WSL-instarball/releases/download/v20260106.0/openSUSE-Tumbleweed-20260103-WSL.x86_64-26003.9.1368.0-Build9.1368.appx",
"Arm64PackageUrl": "https://github.com/openSUSE/WSL-instarball/releases/download/v20260106.0/openSUSE-Tumbleweed-20260103-WSL.aarch64-26003.9.741.0-Build9.741.appx",
"PackageFamilyName": "46932SUSE.openSUSETumbleweed_022rs5jcyhyac"
}
]

View File

@ -427,7 +427,7 @@ def read_tar(node, file, elf_magic: str):
defaultUid = None
if validate_mode('/etc/wsl-distribution.conf', [oct(0o664), oct(0o644)], 0, 0, follow_symlink=True):
config = validate_config('/etc/wsl-distribution.conf', ['oobe.command', 'oobe.defaultuid', 'shortcut.icon', 'shortcut.enabled', 'oobe.defaultname', 'windowsterminal.profiletemplate'])
config = validate_config('/etc/wsl-distribution.conf', ['oobe.command', 'oobe.defaultuid', 'shortcut.icon', 'shortcut.enabled', 'oobe.defaultname', 'windowsterminal.profiletemplate', 'windowsterminal.enabled'])
if oobe_command := config.get('oobe.command', None):
validate_mode(oobe_command, [oct(0o775), oct(0o755)], 0, 0)

View File

@ -14,6 +14,14 @@ wpr -start wsl.wprp -filemode
wpr -stop logs.ETL
```
The consolidated `wsl.wprp` file includes multiple profiles for different scenarios:
- `WSL` - General WSL tracing (default)
- `WSL-Storage` - Enhanced storage tracing
- `WSL-Networking` - Comprehensive networking tracing
- `WSL-HvSocket` - HvSocket-specific tracing
To use a specific profile, append `!ProfileName` to the wprp file, e.g., `wpr -start wsl.wprp!WSL-Networking -filemode`
Once the log file is saved, you can use [WPA](https://apps.microsoft.com/detail/9n58qrw40dfw?hl=en-US&gl=US) to view the logs.
Notable ETL providers:

View File

@ -4,13 +4,13 @@
The following tools are required to build WSL:
- CMake >= 2.25
- CMake >= 3.25
- Can be installed with `winget install Kitware.CMake`
- Visual Studio with the following components:
- Windows SDK 26100
- MSBuild
- Universal Windows platform support for v143 build tools (X64 and ARM64)
- MSVC v143 - VS 2020 C++ ARM64 build tools (Latest + Spectre) (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
@ -72,3 +72,32 @@ See [debugging](debugging.md) for general debugging instructions.
To attach a debugger to the unit test process, use: `/waitfordebugger` when calling `test.bat`.
Use `/breakonfailure` to automatically break on the first test failure.
## Tips and tricks
**Building and deploying faster**
To iterate faster, create a copy of [```UserConfig.cmake.sample```](https://github.com/microsoft/WSL/blob/master/UserConfig.cmake.sample):
```
copy UserConfig.cmake.sample UserConfig.cmake
```
And uncomment this line:
```
# set(WSL_DEV_BINARY_PATH "C:/wsldev")
```
This will change the build logic to build a smaller package that installs faster.
Also see:
- `WSL_BUILD_THIN_PACKAGE` to build an even smaller package
- `WSL_POST_BUILD_COMMAND` to automatically deploy the package during build
**Code formatting**
Every pull request needs to be clang-formatted before it can be merged.
The code can be manually formatted by running: `powershell .\FormatSource.ps1 -ModifiedOnly $false`.
To automatically check formatting when creating a commit, run: `tools\SetupClangFormat.bat`

View File

@ -292,10 +292,12 @@ a wsl.exe --install &lt;Distro&gt;.</value>
<value>Starší verze distribuce nepodporuje WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WsL2 se v aktuální konfiguraci vašeho počítače nepodporuje.
Povolte volitelnou součást „Platforma virtuálního počítače“ a ujistěte se, že je v systému BIOS povolená virtualizace.
Povolte platformu virtuálních počítačů spuštěním příkazu: wsl.exe --install --no-distribution
Informace najdete na https://aka.ms/enablevirtualization</value>
<value>WSL2 nelze spustit, protože na tomto počítači není povolena virtualizace.
Ujistěte se, že je povolena volitelná součást „Virtual Machine Platform“ a že je virtualizace zapnutá v nastavení firmwaru vašeho počítače.
Povolte „Virtual Machine Platform“ spuštěním: wsl.exe --install --no-distribution
Další informace najdete na https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -730,9 +732,6 @@ Může být nutné restartovat systém, aby se změny projevily.</value>
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Změna velikosti disku se nezdařila.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Cestu se nepodařilo přeložit.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Nebyla nalezena žádná hodnota.</value>
</data>
@ -1060,7 +1059,7 @@ Návrat k sítím NAT.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessagePassVhdFlag" xml:space="preserve">
<value>This looks like a VHD file. Use --vhd to import a VHD instead of a tar.</value>
<value>Vypadá to jako soubor VHD. K importu virtuálního pevného disku místo tar použijte --vhd </value>
<comment>{Locked="--vhd "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDistroStoreInstallFailed" xml:space="preserve">

File diff suppressed because it is too large Load Diff

View File

@ -163,17 +163,17 @@ Mit "wsl.exe {} &lt;Distro&gt;" installieren.
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDistroAlreadySet" xml:space="preserve">
<value>Der Verteilungsname wurde bereits festgelegt.</value>
<value>Der Distributionsname wurde bereits festgelegt.</value>
</data>
<data name="MessageDistroInstallPathAlreadyExists" xml:space="preserve">
<value>Der angegebene Installationsspeicherort wird bereits verwendet.</value>
</data>
<data name="MessageDistroNameAlreadyExists" xml:space="preserve">
<value>Eine Verteilung mit dem angegebenen Namen ist bereits vorhanden. Verwenden Sie --name , um einen anderen Namen zu wählen.</value>
<value>Eine Distribution mit dem angegebenen Namen ist bereits vorhanden. Verwenden Sie --name , um einen anderen Namen zu wählen.</value>
<comment>{Locked="--name "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDistroNotFound" xml:space="preserve">
<value>Es ist keine Verteilung mit dem angegebenen Namen vorhanden.</value>
<value>Es ist keine Distribution mit dem angegebenen Namen vorhanden.</value>
</data>
<data name="MessageElevationNeededToMountDisk" xml:space="preserve">
<value>Zum Bereitstellen eines Datenträgers ist Administratorzugriff erforderlich.</value>
@ -205,7 +205,7 @@ Mit "wsl.exe {} &lt;Distro&gt;" installieren.
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageImportingDistribution" xml:space="preserve">
<value>Verteilung importieren</value>
<value>Distribution importieren</value>
</data>
<data name="MessageDownloadComplete" xml:space="preserve">
<value>{} wurde heruntergeladen.</value>
@ -215,7 +215,7 @@ Mit "wsl.exe {} &lt;Distro&gt;" installieren.
<value>Windows-Subsystem für Linux setzt eine vorherige Installation... fort.</value>
</data>
<data name="MessageInvalidDistributionName" xml:space="preserve">
<value>Ungültiger Verteilungsname: '{}'.
<value>Ungültiger Distributionsname: '{}'.
Um eine Liste gültiger Distributionen abzurufen, verwenden Sie "wsl.exe --list --online'.</value>
<comment>{FixedPlaceholder="{}"}{Locked="--list "}{Locked="--online'"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -295,13 +295,15 @@ und "wsl.exe --install &lt;Distro&gt;".</value>
<value>Die Distribution ist bereits die angeforderte Version.</value>
</data>
<data name="MessageVmModeNotSupported" xml:space="preserve">
<value>WSL 2 wird von der Legacyverteilung nicht unterstützt.</value>
<value>WSL 2 wird von der Legacy Distribution nicht unterstütztt.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 wird von Ihrer aktuellen Computerkonfiguration nicht unterstützt.
Aktivieren Sie die optionale Komponente "Plattform für virtuelle Computer", und stellen Sie sicher, dass die Virtualisierung im BIOS aktiviert ist.
Aktivieren Sie "Plattform für virtuelle Computer", indem Sie ": wsl.exe --install --no-distribution
" ausführen. Weitere Informationen finden Sie unter https://aka.ms/enablevirtualization</value>
<value>WSL2 kann nicht gestartet werden, da die Virtualisierung auf diesem Computer nicht aktiviert ist.
Stellen Sie sicher, dass die optionale Komponente „VM-Plattform“ aktiviert ist und die Virtualisierung in den Firmwareeinstellungen Ihres Computers eingeschaltet ist.
Aktivieren Sie „VM-Plattform“, indem Sie folgenden Befehl ausführen: wsl.exe --install --no-distribution
Weitere Informationen finden Sie unter https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -364,17 +366,17 @@ Beispiel: wslpath 'c:\\users'</value>
Verbrauch:
/l, /list [Option]
Listet registrierte Verteilungen auf.
/all Optional alle Distributionen auflisten, einschließlich Verteilungen, die
Listet registrierte Distributionen auf.
/all Optional alle Distributionen auflisten, einschließlich Distributionen, die
zurzeit installiert oder deinstalliert werden.
/running Listet nur Verteilungen auf, die derzeit ausgeführt werden.
/running Listet nur Distributionen auf, die derzeit ausgeführt werden.
/s, /setdefault &lt;DistributionName&gt;
Legt die Distribution als Standard fest.
/t, /terminate &lt;DistributionName&gt;
Beendet die Verteilung.
Beendet die Distribution.
/u, /unregister &lt;DistributionName&gt;
Hebt die Registrierung der Distribution auf und löscht das Stammdateisystem.</value>
@ -478,7 +480,7 @@ Argumente für die Verwaltung des Windows-Subsystems für Linux:
Den Standardbenutzer der Verteilung festlegen.
--resize &lt;MemoryString&gt;
Passen Sie die Größe des Datenträgers der Verteilung auf die angegebene Größe an.
Passen Sie die Größe des Datenträgers der Distribution auf die angegebene Größe an.
--mount &lt;Disk&gt;
Fügt einen physischen oder virtuellen Datenträger an alle WSL2-Distributionen an und bindet ihn ein.
@ -589,7 +591,7 @@ Argumente für die Verwaltung von Distributionen in Windows-Subsystem für Linux
Beendet die angegebene Distribution.
--unregister &lt;Distro&gt;
Hebt die Registrierung der Verteilung auf und löscht das Stammdateisystem.</value>
Hebt die Registrierung der Distribution auf und löscht das Stammdateisystem.</value>
<comment>{Locked="--exec,"}{Locked="--shell-type "}{Locked="--cd "}{Locked="--distribution,"}{Locked="--distribution-id "}{Locked="--user,"}{Locked="--system
"}{Locked="--help
"}{Locked="--debug-shell
@ -636,7 +638,7 @@ Buildzeit: {}</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageCustomSystemDistroError" xml:space="preserve">
<value>Die in {} angegebene benutzerdefinierte Systemverteilung wurde nicht gefunden oder weist nicht das richtige Format auf.</value>
<value>Die in {} angegebene benutzerdefinierte Systemdistribution wurde nicht gefunden oder weist nicht das richtige Format auf.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageWslgUsage" xml:space="preserve">
@ -690,7 +692,7 @@ Argumente:
<value>Es wird nach Updates gesucht.</value>
</data>
<data name="MessageDistroOnlyAvailableFromStore" xml:space="preserve">
<value>Diese Verteilung ist nur im Microsoft Store verfügbar.</value>
<value>Diese Distribution ist nur im Microsoft Store verfügbar.</value>
</data>
<data name="MessageWslMountNotSupportedOnArm" xml:space="preserve">
<value>wsl.exe --mount auf ARM64 erfordert Windows 27653 oder höher.</value>
@ -726,7 +728,7 @@ Das System muss möglicherweise neu gestartet werden, damit die Änderungen wirk
<value>Für Bridged Networking muss wsl2.vmSwitch eingestellt sein.</value>
</data>
<data name="MessageCouldFetchDistributionList" xml:space="preserve">
<value>Fehler beim Abrufen der Listenverteilung von „{}“. {}</value>
<value>Fehler beim Abrufen der Liste der Distributionen von „{}“. {}</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageFailedToAttachDisk" xml:space="preserve">
@ -736,9 +738,6 @@ Das System muss möglicherweise neu gestartet werden, damit die Änderungen wirk
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Fehler beim Ändern der Größe des Datenträgers.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Fehler beim Übersetzen des Pfads.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Kein Wert gefunden.</value>
</data>
@ -752,7 +751,7 @@ Weitere Informationen finden Sie unter https://aka.ms/wslinstall</value>
<value>Zum Ausführen der Debug-Shell muss wsl.exe als Administrator ausgeführt werden.</value>
</data>
<data name="MessageInstallProcessFailed" xml:space="preserve">
<value>Fehler beim Installationsprozess für die Verteilung „{}“. Exitcode: {}.</value>
<value>Fehler beim Installationsprozess für die Distribution „{}“. Exitcode: {}.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageInvalidGuid" xml:space="preserve">
@ -810,7 +809,7 @@ Weitere Informationen finden Sie unter https://aka.ms/wslinstall</value>
<value>Open EventViewer</value>
</data>
<data name="MessageDistributionNameNeeded" xml:space="preserve">
<value>Diese Verteilung enthält keinen Standardnamen. Verwenden Sie --name , um den Verteilungsnamen zu wählen.</value>
<value>Diese Distribution enthält keinen Standardnamen. Verwenden Sie --name , um den Distributionsnamen zu wählen.</value>
<comment>{Locked="--name "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageArgumentsNotValidTogether" xml:space="preserve">
@ -822,22 +821,22 @@ Weitere Informationen finden Sie unter https://aka.ms/wslinstall</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageInvalidInstallDistributionName" xml:space="preserve">
<value>Ungültiger Verteilungsname: „{}“.</value>
<value>Ungültiger Distributionsname: „{}“.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageUsingLegacyDistribution" xml:space="preserve">
<value>Es wird die Legacy-Verteilungsregistrierung verwendet. Erwägen Sie, stattdessen eine TAR-basierte Verteilung zu verwenden.</value>
<value>Es wird die Legacy-Verteilungsregistrierung verwendet. Erwägen Sie, stattdessen eine TAR-basierte Distribution zu verwenden.</value>
</data>
<data name="MessageLegacyDistributionVersionArgNotSupported" xml:space="preserve">
<value>Ältere Distributionsregistrierungen unterstützen das Argument --version nicht.</value>
<comment>{Locked="--version "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDistributionOverridden" xml:space="preserve">
<value>Die Verteilung "{}" wird durch ein Überschreibungsmanifest bereitgestellt.</value>
<value>Die Distribution "{}" wird durch ein Überschreibungsmanifest bereitgestellt.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageHashMismatch" xml:space="preserve">
<value>Der Verteilungshash stimmt nicht überein. Erwartet: {}, tatsächlicher Hash: {}</value>
<value>Der Distributionshash stimmt nicht überein. Erwartet: {}, tatsächlicher Hash: {}</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageInvalidHexString" xml:space="preserve">
@ -845,11 +844,11 @@ Weitere Informationen finden Sie unter https://aka.ms/wslinstall</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageNotSupportedOnLegacyDistros" xml:space="preserve">
<value>„{}“ wird bei der Installation von Legacy-Verteilungen nicht unterstützt.</value>
<value>„{}“ wird bei der Installation von Legacy-Distributionen nicht unterstützt.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDistributionInstalled" xml:space="preserve">
<value>Die Verteilung wurde erfolgreich installiert. Sie kann über "wsl.exe -d {}" gestartet werden.</value>
<value>Die Distribution wurde erfolgreich installiert. Sie kann über "wsl.exe -d {}" gestartet werden.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageInvalidNumberString" xml:space="preserve">
@ -1043,11 +1042,11 @@ Fallback auf NAT-Netzwerk.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDistributionFailedToStart" xml:space="preserve">
<value>Fehler beim Starten der Verteilung. Fehlercode: {}, Fehlerschritt: {}</value>
<value>Fehler beim Starten der Distribution. Fehlercode: {}, Fehlerschritt: {}</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDiskCorrupted" xml:space="preserve">
<value>Die Verteilung konnte nicht gestartet werden, da der virtuelle Datenträger beschädigt ist.</value>
<value>Die Distribution konnte nicht gestartet werden, da der virtuelle Datenträger beschädigt ist.</value>
</data>
<data name="MessageConfigKeyDuplicated" xml:space="preserve">
<value>Doppelter Konfigurationsschlüssel '{}' in {}:{} (widersprüchlicher Schlüssel: '{}' in {}:{})</value>
@ -1058,11 +1057,11 @@ Fallback auf NAT-Netzwerk.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageWaitingForOobe" xml:space="preserve">
<value>Warten auf den Abschluss des OOBE-Befehls für die Verteilung „{}“...</value>
<value>Warten auf den Abschluss des OOBE-Befehls für die Distribution "{}"...</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageCorruptedDistroRegistration" xml:space="preserve">
<value>Fehler beim Lesen der Eigenschaft "{}" aus der Verteilung {} </value>
<value>Fehler beim Lesen der Eigenschaft "{}" aus der Distribution {} </value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessagePassVhdFlag" xml:space="preserve">
@ -1075,7 +1074,7 @@ Es wird versucht,...</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageNoInstallDefault" xml:space="preserve">
<value>Es wurde keine Standardverteilung konfiguriert. Geben Sie eine Zu installierende Distribution an.</value>
<value>Es wurde keine Standarddistribution konfiguriert. Geben Sie eine Zu installierende Distribution an.</value>
</data>
<data name="MessageConfigVirtio9pDisabled" xml:space="preserve">
<value>wsl2.virtio9p ist deaktiviert und fällt mit vsock-Transport auf 9p zurück.</value>
@ -1087,7 +1086,7 @@ Timeout für diese Eingabeaufforderung in 60 Sekunden.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageFailedToParseTerminalProfile" xml:space="preserve">
<value>Fehler beim Analysieren des Terminalprofils beim Registrieren der Verteilung: {}</value>
<value>Fehler beim Analysieren des Terminalprofils beim Registrieren der Distribution: {}</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageInvalidSize" xml:space="preserve">
@ -1130,7 +1129,7 @@ wsl.exe --manage &lt;DistributionName&gt; --set-sparse true --allow-unsafe</valu
<value>Fehler beim Verarbeiten von „/etc/fstab“ mit „mount -a“.</value>
</data>
<data name="MessageReadOnlyDistro" xml:space="preserve">
<value>Fehler beim Einbinden des Verteilungsdatenträgers. Er wurde schreibgeschützt als Fallback bereitgestellt.
<value>Fehler beim Einbinden des Distributionsdatenträgers. Er wurde schreibgeschützt als Fallback bereitgestellt.
Anweisungen zur Wiederherstellung finden Sie unter: https://aka.ms/wsldiskmountrecovery</value>
</data>
<data name="MessageFailedToTranslate" xml:space="preserve">
@ -1742,13 +1741,13 @@ Sie können auch über die Befehlspalette in VS Code selbst auf weitere VS Code
<value>Aktivieren des abgesicherten Modus</value>
</data>
<data name="Settings_SafeMode.Description" xml:space="preserve">
<value>Führen Sie die WSL im „abgesicherten Modus“ aus, in dem viele Features deaktiviert sind. Dieser Modus ist für die Wiederherstellung von fehlerhaften Verteilungen gedacht.</value>
<value>Führen Sie die WSL im „abgesicherten Modus“ aus, in dem viele Features deaktiviert sind. Dieser Modus ist für die Wiederherstellung von fehlerhaften Distributionen gedacht.</value>
</data>
<data name="Settings_SafeModeToggleSwitch.AutomationProperties.Name" xml:space="preserve">
<value>Aktivieren des abgesicherten Modus.</value>
</data>
<data name="Settings_SafeModeToggleSwitch.AutomationProperties.HelpText" xml:space="preserve">
<value>Führen Sie die WSL im „abgesicherten Modus“ aus, in dem viele Features deaktiviert sind. Dieser Modus ist für die Wiederherstellung von fehlerhaften Verteilungen gedacht.</value>
<value>Führen Sie die WSL im „abgesicherten Modus“ aus, in dem viele Features deaktiviert sind. Dieser Modus ist für die Wiederherstellung von fehlerhaften Distributionen gedacht.</value>
</data>
<data name="Settings_Shell_About.Content" xml:space="preserve">
<value>Info</value>

View File

@ -292,9 +292,11 @@ and 'wsl.exe --install &lt;Distro&gt;' to install.</value>
<value>The Legacy distribution does not support WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 is not supported with your current machine configuration.
Please enable the "Virtual Machine Platform" optional component and ensure virtualisation is enabled in the BIOS.
<value>WSL2 is unable to start since virtualisation is not enabled on this machine.
Please ensure the "Virtual Machine Platform" optional component is enabled and virtualisation is turned on in your computer's firmware settings.
Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution
For information please visit https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -730,9 +732,6 @@ The system may need to be restarted so the changes can take effect.</value>
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Failed to resize disk.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Failed to translate path.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>No value found.</value>
</data>

View File

@ -292,9 +292,11 @@ and 'wsl.exe --install &lt;Distro&gt;' to install.</value>
<value>The Legacy distribution does not support WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 is not supported with your current machine configuration.
Please enable the "Virtual Machine Platform" optional component and ensure virtualization is enabled in the BIOS.
<value>WSL2 is unable to start since virtualization is not enabled on this machine.
Please ensure the "Virtual Machine Platform" optional component is enabled and virtualization is turned on in your computer's firmware settings.
Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution
For information please visit https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -730,9 +732,6 @@ The system may need to be restarted so the changes can take effect.</value>
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Failed to resize disk.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Failed to translate path.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>No value found.</value>
</data>

View File

@ -298,10 +298,12 @@ y "wsl.exe --install &lt;Distro&gt;" para instalar.</value>
<value>La distribución heredada no admite WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 no es compatible con la configuración actual de la máquina.
Se debe habilitar el componente opcional "Plataforma de máquina virtual" y asegurarse de que la virtualización esté habilitada en el BIOS.
Para habilitar la "Plataforma de máquina virtual", se ha de ejecutar: wsl.exe --install --no-distribution
Para obtener más información: https://aka.ms/enablevirtualization</value>
<value>WSL2 no se puede iniciar porque la virtualización no está habilitada en esta máquina.
Asegúrese de que el componente opcional "Plataforma de máquina virtual" esté habilitado y de que la virtualización esté activada en la configuración de firmware del equipo.
Habilitar "Plataforma de máquina virtual" ejecutando: wsl.exe --install --no-distribution
Para obtener información, visite https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -736,9 +738,6 @@ Es posible que sea necesario reiniciar el sistema para que los cambios surtan ef
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Error al cambiar el tamaño del disco.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>No se pudo traducir la ruta de acceso.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>No se encontró ningún valor.</value>
</data>

File diff suppressed because it is too large Load Diff

View File

@ -298,9 +298,11 @@ et 'wsl.exe --install &lt;Distro&gt;' à installer.</value>
<value>La distribution héritée ne prend pas en charge WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 nest pas pris en charge avec votre configuration dordinateur actuelle.
Activez le composant facultatif « Plateforme dordinateur virtuel » et assurez-vous que la virtualisation est activée dans le BIOS.
Activez « Plateforme dordinateur virtuel » en exécutant : wsl.exe --install --no-distribution
<value>WSL2 ne peut pas démarrer, car la virtualisation nest pas activée sur cet ordinateur.
Vérifiez que le composant facultatif « Plateforme dordinateur virtuel » est activé et que la virtualisation est activée dans les paramètres du microprogramme de votre ordinateur.
Activer « Plateforme dordinateur virtuel » en exécutant : wsl.exe --install --no-distribution
Pour plus dinformations, visitez https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -737,9 +739,6 @@ Le système devra peut-être être redémarré pour que les modifications prenne
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Échec de redimensionnement de disque.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Échec de la traduction du chemin daccès.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Valeur non trouvée.</value>
</data>

View File

@ -292,10 +292,12 @@ A 'wsl.exe --list --online' parancs használatával listázhatja az elérhető d
<value>Az örökölt disztribúció nem támogatja a WSL 2-t.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>A jelenlegi számítógép-konfiguráció nem támogatja a WSL2-t.
Engedélyezze a „Virtuálisgép-platform” választható összetevőt, és győződjön meg arról, hogy a virtualizálás engedélyezve van a BIOS-ban.
<value>A WSL2 nem indítható el, mert a virtualizáció nincs engedélyezve ezen a gépen.
Győződjön meg arról, hogy a „Virtuálisgép-platform” választható összetevő engedélyezve van, és a virtualizáció be van kapcsolva a számítógép firmware-beállításaiban.
A „Virtuálisgép-platform” engedélyezéséhez futtassa a következőt: wsl.exe --install --no-distribution
További információért látogasson el a https://aka.ms/enablevirtualization oldalra</value>
További információért látogasson el ide: https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -730,9 +732,6 @@ Lehet, hogy újra kell indítani a rendszert, hogy a módosítások érvénybe l
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Nem sikerült a lemez átméretezése.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Az útvonal fordítása nem sikerült.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Nem található érték.</value>
</data>

View File

@ -298,10 +298,12 @@ e 'wsl.exe --install &lt;Distro&gt;' per l'installazione.</value>
<value>La distribuzione legacy non supporta WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 non è supportato con la configurazione corrente del computer.
Abilitare il componente facoltativo "Piattaforma macchina virtuale" e assicurarsi che la virtualizzazione sia abilitata nel BIOS.
Abilitare "Piattaforma macchina virtuale" eseguendo: wsl.exe --install --no-distribution
Per informazioni, vedere https://aka.ms/enablevirtualization</value>
<value>Impossibile avviare WSL2 perché la virtualizzazione non è abilitata in questo computer.
Verificare che il componente facoltativo "Piattaforma macchina virtuale" sia abilitato e che la virtualizzazione sia attivata nelle impostazioni del firmware del computer.
Abilitare "Virtual Machine Platform" eseguendo: wsl.exe --install --no-distribution
Per informazioni, visitare https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -736,9 +738,6 @@ Potrebbe essere necessario riavviare il sistema per rendere effettive le modific
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Non è possibile ridimensionare il disco.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Non è stato possibile tradurre il percorso.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Nessun valore trovato.</value>
</data>

View File

@ -298,9 +298,11 @@ WSL2 でディスクを強制的に停止してデタッチするには、'wsl.e
<value>レガシ ディストリビューションは WSL 2 をサポートしていません。</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 は、現在のマシン構成ではサポートされていません。
"仮想マシン プラットフォーム" オプション コンポーネントを有効にし、さらに、BIOS で仮想化を有効にしてください。
"仮想マシン プラットフォーム" を有効にするには、次のコマンドを実行します: wsl.exe --install --no-distribution
<value>このコンピューターで仮想化が有効になっていないため、WSL2 を開始できません。
[仮想マシン プラットフォーム] オプション コンポーネントが有効になっており、コンピューターのファームウェア設定で仮想化がオンになっていることを確認してください。
次のコマンドを実行して [仮想マシン プラットフォーム] を有効にします: wsl.exe --install --no-distribution
詳細については、https://aka.ms/enablevirtualization をご覧ください</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -736,9 +738,6 @@ Windows バージョン: {}</value>
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>ディスクのサイズを変更できませんでした。</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>パスを変換できませんでした。</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>値が見つかりません。</value>
</data>

View File

@ -298,10 +298,12 @@ WSL2가 강제로 디스크를 중지하고 분리하려면 'wsl.exe {}'을(를)
<value>레거시 배포에서 WSL 2를 지원하지 않습니다.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2는 현재 컴퓨터 구성에서 지원되지 않습니다.
"가상 머신 플랫폼" 선택적 구성 요소를 사용하도록 설정하고 BIOS에서 가상화가 사용하도록 설정되어 있는지 확인하세요.
실행하여 "가상 머신 플랫폼"을 사용하도록 설정: wsl.exe --install --no-distribution
자세한 내용은 https://aka.ms/enablevirtualization 참조하세요.</value>
<value>가상화가 활성화되지 않은 이 컴퓨터에서는 WSL2를 시작할 수 없습니다.
컴퓨터의 펌웨어 설정에서 ‘가상 머신 플랫폼’ 선택적 구성 요소가 활성화되고, 가상화가 켜져 있는지 확인하세요.
‘가상 머신 플랫폼’을 활성화기 위해 다음 명령 실행: wsl.exe --install --no-distribution
자세한 내용을 알아보려면 https://aka.ms/enablevirtualization을 방문하세요.</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -736,9 +738,6 @@ Windows 버전: {}</value>
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>디스크 크기를 조정하지 못했습니다.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>경로를 변환하지 못했습니다.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>값을 찾을 수 없습니다.</value>
</data>

View File

@ -292,9 +292,11 @@ og "wsl.exe --install &lt;Distro&gt;" som skal installeres.</value>
<value>Eldre distribusjon støtter ikke WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 støttes ikke med gjeldende maskinkonfigurasjon.
Aktiver den valgfrie komponenten Virtual Machine Platform, og kontroller at virtualisering er aktivert i BIOS.
Aktiver Plattform for virtuell maskin ved å kjøre: wsl.exe --install --no-distribution
<value>WSL2 kan ikke starte fordi virtualisering ikke er aktivert på denne maskinen.
Kontroller at den valgfrie komponenten Virtual Machine Platform er aktivert, og at virtualisering er aktivert i datamaskinens fastvareinnstillinger.
Aktiver Virtual Machine Platform ved å kjøre: wsl.exe --install --no-distribution
Hvis du vil ha mer informasjon, kan du gå til https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -730,9 +732,6 @@ Systemet må kanskje startes på nytt slik at endringene kan tre i kraft.</value
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Kan ikke endre størrelsen på disken.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Kan ikke oversette banen.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Finner ingen verdi.</value>
</data>

File diff suppressed because it is too large Load Diff

View File

@ -292,10 +292,12 @@ i "wsl.exe --install &lt;Distro&gt;" do zainstalowania.</value>
<value>Starsza dystrybucja nie obsługuje protokołu WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>Bieżąca konfiguracja komputera nie obsługuje protokołu WSL2.
Włącz opcjonalny składnik "Platforma maszyny wirtualnej" i upewnij się, że wirtualizacja jest włączona w systemie BIOS.
Włącz platformę maszyny wirtualnej, uruchamiając: wsl.exe --install --no-distribution
Aby uzyskać informacje, odwiedź stronę https://aka.ms/enablevirtualization</value>
<value>Nie można uruchomić protokołu WSL2, ponieważ wirtualizacja nie jest włączona na tej maszynie.
Upewnij się, że składnik opcjonalny "Platforma maszyny wirtualnej" jest włączony i że wirtualizacja jest włączona w ustawieniach oprogramowania układowego komputera.
Włącz platformę maszyny wirtualnej, uruchamiając polecenie: wsl.exe --install --no-distribution
Aby uzyskać informacje, odwiedź https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -730,9 +732,6 @@ Może być konieczne ponowne uruchomienie systemu, aby zmiany zostały wprowadzo
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Nie można zmienić rozmiaru dysku.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Nie można przetłumaczyć ścieżki.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Nie znaleziono wartości.</value>
</data>
@ -1060,7 +1059,7 @@ Powrót do sieci NAT.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessagePassVhdFlag" xml:space="preserve">
<value>This looks like a VHD file. Use --vhd to import a VHD instead of a tar.</value>
<value>Wygląda to na plik VHD. Użyj polecenia --vhd aby zaimportować plik VHD zamiast tar.</value>
<comment>{Locked="--vhd "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDistroStoreInstallFailed" xml:space="preserve">

View File

@ -298,9 +298,11 @@ e 'wsl.exe --install &lt;Distro&gt;' para instalar.</value>
<value>A distribuição Herdada não dá suporte a WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>Não há suporte para WSL2 com a configuração atual do computador.
Habilite o componente opcional "Plataforma da Máquina Virtual" e verifique se a virtualização está habilitada no BIOS.
Habilite a "Plataforma da Máquina Virtual" executando: wsl.exe --install --no-distribution
<value>O WSL2 não pode ser iniciado porque a virtualização não está habilitada nesta máquina.
Verifique se o componente opcional "Plataforma da Máquina Virtual" está habilitado e se a virtualização está ativada nas configurações de firmware do computador.
Habilitar a "Plataforma da Máquina Virtual" executando: wsl.exe --install --no-distribution
Para obter informações, visite https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -737,9 +739,6 @@ Talvez seja necessário reiniciar o sistema para que as alterações entrem em v
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Falha ao redimensionar o disco.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Falha ao converter o caminho.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Nenhum valor encontrado.</value>
</data>

View File

@ -292,9 +292,11 @@ e "wsl.exe --install &lt;Distro&gt;" para instalar.</value>
<value>A distribuição legada não suporta o WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>O WSL2 não é suportado com a configuração atual do computador.
Ative o componente opcional "Plataforma de Máquinas Virtuais" e certifique-se de que a virtualização está ativada no BIOS.
Ative a "Plataforma de Máquinas Virtuais" executando: wsl.exe --install --no-distribution
<value>O WSL2 não consegue iniciar porque a virtualização não está ativada nesta máquina.
Certifique-se de que o componente opcional "Plataforma de Máquina Virtual" está ativado e a virtualização está ligada nas definições de firmware do seu computador.
Ative a "Plataforma de Máquina Virtual" ao executar: wsl.exe --install --no-distribution
Para obter informações, visite https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -730,9 +732,6 @@ O sistema poderá ter de ser reiniciado para que as alterações possam ter efei
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Falha ao redimensionar o disco.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Falha ao traduzir caminho.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Não foi encontrado nenhum valor.</value>
</data>

View File

@ -299,10 +299,12 @@
<value>Устаревшее распределение не поддерживает WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 не поддерживается текущей конфигурацией компьютера.
Включите дополнительный компонент "Платформа виртуальной машины" и включите виртуализацию в BIOS.
Чтобы включить компонент "Платформа виртуальной машины", выполните команду wsl.exe --install --no-distribution
Дополнительные сведения см. на странице https://aka.ms/enablevirtualization</value>
<value>Не удалось запустить WSL2, так как на этом компьютере не включена виртуализация.
Убедитесь, что дополнительный компонент "Платформа виртуальной машины" включен и виртуализация включена в параметрах встроенного ПО компьютера.
Включите "Платформу виртуальной машины", выстроив команду: wsl.exe --install --no-distribution
Дополнительные сведения см. в https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -737,9 +739,6 @@
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Не удалось изменить размер диска.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Не удалось преобразовать путь.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Значение не найдено.</value>
</data>

View File

@ -292,9 +292,11 @@ och wsl.exe --install &lt;Distro&gt; att installera.</value>
<value>Den äldre distributionen stöder inte WSL 2.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 stöds inte med den aktuella datorkonfigurationen.
Aktivera den valfria komponenten Virtual Machine Platform och se till att virtualisering har aktiverats i BIOS.
<value>Det går inte att starta WSL2 eftersom virtualisering inte är aktiverat på den här datorn.
Kontrollera att den valfria komponenten Virtual Machine Platform är aktiverad och att virtualisering är aktiverat i datorns inställningar för inbyggd programvara.
Aktivera Virtual Machine Platform genom att köra: wsl.exe --install --no-distribution
Mer information finns på https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -730,9 +732,6 @@ Systemet kan behöva startas om så att ändringarna kan börja gälla.</value>
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Det gick inte att ändra storlek på disken.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Det gick inte att översätta sökvägen.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Inget värde hittades.</value>
</data>

View File

@ -169,7 +169,7 @@ Diski ayırmak için '{} {}' wsl.exe çalıştırın.</value>
<value>Sağlanan yükleme konumu zaten kullanılıyor.</value>
</data>
<data name="MessageDistroNameAlreadyExists" xml:space="preserve">
<value>Sağlanan ada sahip bir dağıtım zaten var. Farklı --name bir ad seçin.</value>
<value>Sağlanan ada sahip bir dağıtım zaten mevcut. Farklı bir ad seçmek için --name komutunu kullanın.</value>
<comment>{Locked="--name "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDistroNotFound" xml:space="preserve">
@ -185,7 +185,7 @@ Diski ayırmak için '{} {}' wsl.exe çalıştırın.</value>
<value>Bu dağıtım sistemi için Linux için Windows Alt Sistemi dosya sisteminin bir kez yükseltilemedi...</value>
</data>
<data name="MessageHigherIntegrity" xml:space="preserve">
<value>Başka bir örnek yükseltilmeyen olarak çalıştığından başlatılamıyor. Yükseltilmiş ve yükseltilmemiş örneklerin aynı anda çalışmasına izin verilmez.</value>
<value>Başka bir örnek yükseltilmeyen olarak çalıştığından başlatılamıyor. Yükseltilmiş ve yükseltilmemiş örneklerin aynı anda çalışmasına izin verilmez.</value>
</data>
<data name="MessageImportFailed" xml:space="preserve">
<value>Dağıtım içeri aktarılamadı.</value>
@ -210,11 +210,11 @@ Diski ayırmak için '{} {}' wsl.exe çalıştırın.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageInstallContinue" xml:space="preserve">
<value>Linux için Windows Alt Sistemi önceki bir yükleme işlemi devam...</value>
<value>Linux için Windows Alt Sistemi, önceki bir kurulumu devam ettiriyor...</value>
</data>
<data name="MessageInvalidDistributionName" xml:space="preserve">
<value>Geçersiz dağıtım adı: '{}'.
Geçerli dağıtımların listesini almak için 'wsl.exe --list --online'.</value>
Geçerli dağıtımların listesini almak için 'wsl.exe --list --online' komutunu kullanın.</value>
<comment>{FixedPlaceholder="{}"}{Locked="--list "}{Locked="--online'"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageInstanceTerminated" xml:space="preserve">
@ -222,12 +222,12 @@ Geçerli dağıtımların listesini almak için 'wsl.exe --list --online'.</valu
</data>
<data name="MessageInvalidCommandLine" xml:space="preserve">
<value>Geçersiz komut satırı bağımsız değişkeni: {}
Desteklenen bağımsız değişkenlerin --help' almak için lütfen '{} öğesini kullanın.</value>
Desteklenen bağımsız değişkenlerin listesini almak için lütfen '{} --help' komutunu kullanın.</value>
<comment>{FixedPlaceholder="{}"}{Locked="--help'"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageMissingArgument" xml:space="preserve">
<value>{} komut satırı bağımsız değişkeni bir değer gerektiriyor.
Desteklenen bağımsız değişkenlerin --help' almak için lütfen '{} öğesini kullanın.</value>
Desteklenen bağımsız değişkenlerin listesini almak için lütfen '{} --help' komutunu kullanın.</value>
<comment>{FixedPlaceholder="{}"}{Locked="--help'"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageInvalidConsole" xml:space="preserve">
@ -292,9 +292,11 @@ ve 'wsl.exe --install &lt;Distro&gt;' kullanın.</value>
<value>Eski dağıtım WSL 2'yi desteklemez.</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>WSL2 geçerli makine yapılandırmanız ile desteklenmiyor.
Lütfen "Sanal Makine Platformu" isteğe bağlı bileşenini etkinleştirin ve sanallaştırmanın BIOS'da etkinleştirildiğinden emin olun.
Şu komutu çalıştırarak "Sanal Makine Platformu"nu wsl.exe --install --no-distribution
<value>Sanallaştırma bu makinede etkinleştirilmediği için WSL2 başlatılamıyor.
Lütfen "Sanal Makine Platformu" isteğe bağlı bileşeninin etkinleştirildiğinden ve sanallaştırmanın bilgisayarınızın üretici yazılımı ayarlarında açık olduğundan emin olun.
"Sanal Makine Platformu" seçeneğini şu komutu çalıştırarak etkinleştirin: wsl.exe --install --no-distribution
Bilgi için lütfen şu adresi ziyaret https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -691,16 +693,16 @@ Bağımsız değişkenler:
<comment>{Locked="--mount "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageUpdateNotNeeded" xml:space="preserve">
<value>Bu uygulamanın en Linux için Windows Alt Sistemi sürümü zaten yüklü.</value>
<value>Linux için Windows Alt Sistemi'nin en son sürümü zaten yüklü.</value>
</data>
<data name="MessageUpdatingToVersion" xml:space="preserve">
<value>Güncelleştirme Linux için Windows Alt Sistemi sürümüne güncelleştiriliyor: {}.</value>
<value>Linux için Windows Alt Sistemi şu sürüme güncelleniyor: {}.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageWslOptionalComponentRequired" xml:space="preserve">
<value>Bu uygulama isteğe bağlı Linux için Windows Alt Sistemi gerektirir.
Şu işlemi çalıştırarak yükleyin: wsl.exe --install --no-distribution
Değişikliklerin etkili olması için sistemin yeniden başlatılması gerekebilir.</value>
Değişikliklerin etkinleşmesi için sistemin yeniden başlatılması gerekebilir.</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -730,16 +732,13 @@ Değişikliklerin etkili olması için sistemin yeniden başlatılması gerekebi
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>Disk yeniden boyutlandırılamadı.</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>Yol çevrilemedi.</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>Değer bulunamadı.</value>
</data>
<data name="MessageOsNotSupported" xml:space="preserve">
<value>{} Windows sürümü, uygulamanın paketlenmiş sürümünü Linux için Windows Alt Sistemi.
Gerekli güncelleştirmeyi Windows Update veya {} aracılığıyla yükleyin
Bilgi için lütfen şu adresi ziyaret https://aka.ms/wslinstall</value>
<value>{} Windows sürümü, paketlenmiş Linux için Windows Alt Sistemi sürümünü desteklemiyor.
Gerekli güncellemeyi Windows Update üzerinden veya şu adresten yükleyin: {}
Daha fazla bilgi için lütfen https://aka.ms/wslinstall adresini ziyaret edin.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageAdministratorAccessRequiredForDebugShell" xml:space="preserve">
@ -804,7 +803,7 @@ Bilgi için lütfen şu adresi ziyaret https://aka.ms/wslinstall</value>
<value>EventViewer'ı aç</value>
</data>
<data name="MessageDistributionNameNeeded" xml:space="preserve">
<value>Bu dağıtım varsayılan bir ad içermiyor. Dağıtım --name seçmek için bu adı kullanın.</value>
<value>Bu dağıtım varsayılan bir ad içermiyor. Dağıtım adını seçmek için --name seçeneğini kullanın.</value>
<comment>{Locked="--name "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageArgumentsNotValidTogether" xml:space="preserve">
@ -820,7 +819,7 @@ Bilgi için lütfen şu adresi ziyaret https://aka.ms/wslinstall</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageUsingLegacyDistribution" xml:space="preserve">
<value>Eski dağıtım kaydı kullanılarak. Bunun yerine tar tabanlı bir dağıtım kullanmayı düşünün.</value>
<value>Eski dağıtım kaydı kullanılıyor. Bunun yerine tar tabanlı bir dağıtım kullanmayı düşünün.</value>
</data>
<data name="MessageLegacyDistributionVersionArgNotSupported" xml:space="preserve">
<value>Eski dağıtım kayıtları bağımsız değişken --version desteklemez.</value>
@ -1060,7 +1059,7 @@ NAT ağ bağlantısına geri dönülüyor.</value>
<comment>{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessagePassVhdFlag" xml:space="preserve">
<value>Bu bir VHD dosyası gibi görünüyor. Katran --vhd VHD içeri aktarın.</value>
<value>Bu bir VHD dosyası gibi görünüyor. Tar yerine VHD dosyasını içeri aktarmak için --vhd kullanın.</value>
<comment>{Locked="--vhd "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageDistroStoreInstallFailed" xml:space="preserve">
@ -1105,7 +1104,7 @@ Hata kodu: {}</value>
<value>Ağ modu sorgulanamadı</value>
</data>
<data name="MessageMismatchedKernelModulesError" xml:space="preserve">
<value>Özelleştirilmiş çekirdek modülleri özelleştirilmiş bir çekirdek belirtilmeden sağlandı. Daha fazla https://aka.ms/wslcustomkernel için lütfen ayrıntılara bakın.</value>
<value>Özelleştirilmiş çekirdek modülleri özelleştirilmiş bir çekirdek belirtilmeden sağlandı. Daha fazla bilgi için lütfen https://aka.ms/wslcustomkernel adresine bakın.</value>
</data>
<data name="MessageDnsTunnelingDisabled" xml:space="preserve">
<value>Küresel Güvenli Erişim İstemcisiyle ilgili mevcut bir uyumluluk sorunu nedeniyle DNS Tünelleme devre dışı bırakıldı.</value>
@ -1124,7 +1123,7 @@ wsl.exe --manage &lt;DistributionName&gt; --set-sparse true --allow-unsafe</valu
<value>/etc/fstab with mount -a işlenemedi.</value>
</data>
<data name="MessageReadOnlyDistro" xml:space="preserve">
<value>Dağıtım diski bağlanırken bir hata oluştu, geri dönüş olarak salt okunur olarak bağlandı.
<value>Dağıtım diski bağlanırken bir hata oluştu, yedek plan olarak salt okunur şekilde bağlandı.
Kurtarma yönergelerine bakın: https://aka.ms/wsldiskmountrecovery</value>
</data>
<data name="MessageFailedToTranslate" xml:space="preserve">
@ -1375,7 +1374,7 @@ Kurtarma yönergelerine bakın: https://aka.ms/wsldiskmountrecovery</value>
<value>Yoksayılan bağlantı noktaları</value>
</data>
<data name="Settings_IgnoredPortsTextBox.AutomationProperties.HelpText" xml:space="preserve">
<value>Yalnızca wsl2.networkingMode yansıtılmış olarak ayarlandığında uygulanabilir. Linux uygulamalarının otomatik olarak iletilen veya Windows'da değerlendirilen bağlantı noktalarına bağlanacak bağlantı noktalarını belirtir. Virgülle ayrılmış bir listede biçimlendirilmelidir, örneğin, 3000, 9000, 9090.</value>
<value>Yalnızca wsl2.networkingMode yansıtılmış olarak ayarlandığında uygulanabilir. Linux uygulamalarının otomatik olarak iletilen veya Windows'ta değerlendirilen bağlantı noktalarına bağlanacak bağlantı noktalarını belirtir. Virgülle ayrılmış bir listede biçimlendirilmelidir, örneğin, 3000, 9000, 9090.</value>
</data>
<data name="Settings_InitialAutoProxyTimeout.Header" xml:space="preserve">
<value>İlk Otomatik Ara Sunucu zaman aşımı</value>
@ -1516,7 +1515,7 @@ Kurtarma yönergelerine bakın: https://aka.ms/wsldiskmountrecovery</value>
<comment>{Locked}Uri to the Working across Windows and Linux file systems documentation</comment>
</data>
<data name="Settings_OOBEDisplayName" xml:space="preserve">
<value>Linux için Windows Alt Sistemi'a hoş geldiniz</value>
<value>Linux için Windows Alt Sistemi'ne hoş geldiniz</value>
</data>
<data name="Settings_OOBEDistroManagement.Description" xml:space="preserve">
<value>WSL, farklı Linux dağıtımlarını denemenin harika bir yoludur.</value>

View File

@ -298,9 +298,11 @@
<value>旧分发不支持 WSL 2。</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>当前计算机配置不支持 WSL2。
请启用“虚拟机平台”可选组件,并确保在 BIOS 中启用虚拟化。
通过运行以下命令启用“虚拟机平台”: wsl.exe --install --no-distribution
<value>WSL2 无法启动,因为此计算机上未启用虚拟化。
请确保计算机固件设置中“虚拟机平台”可选组件已启用,且虚拟化已开启。
启用“虚拟机平台”通过运行: wsl.exe --install --no-distribution
有关信息,请访问 https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
@ -705,8 +707,8 @@ Windows: {}</value>
</data>
<data name="MessageWslOptionalComponentRequired" xml:space="preserve">
<value>此应用程序需要适用于 Linux 的 Windows 子系统可选组件。
通过运行安装它: wsl.exe --install --no-distribution
可能需要重新启动系统才能使更改生效。</value>
通过运行 wsl.exe --install --no-distribution
来安装它可能需要重新启动系统才能使更改生效。</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -736,9 +738,6 @@ Windows: {}</value>
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>未能重设磁盘大小。</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>无法转换路径。</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>找不到值。</value>
</data>
@ -950,7 +949,7 @@ Windows: {}</value>
<value>计算机策略已禁用调试 shell。</value>
</data>
<data name="MessageWSLMountDisabled" xml:space="preserve">
<value>wsl.exe --mount 被计算机策略禁用。</value>
<value>计算机策略已禁用 wsl.exe --mount 。</value>
<comment>{Locked="--mount "}Command line arguments, file names and string inserts should not be translated</comment>
</data>
<data name="MessageWSL1Disabled" xml:space="preserve">

View File

@ -298,10 +298,12 @@
<value>舊版發佈不支援 WSL 2。</value>
</data>
<data name="MessageEnableVirtualization" xml:space="preserve">
<value>您目前的電腦設定不支援 WSL2。
請啟用「虛擬機器平台」選擇性元件,並確保 BIOS 中已啟用虛擬化。
啟用以下項目,以執行 [虛擬機器平台]: wsl.exe --install --no-distribution
如需詳細資訊,請瀏覽 https://aka.ms/enablevirtualization</value>
<value>WSL2 無法啟動,因為此機未啟用虛擬化。
請確保您的電腦韌體設定中啟用了「虛擬機平台」這個選用元件,並且虛擬化功能已開啟。
啟用「虛擬機器平台」時,執行: wsl.exe --install --no-distribution
詳情請造訪 https://aka.ms/enablevirtualization</value>
<comment>{Locked="--install "}{Locked="--no-distribution
"}Command line arguments, file names and string inserts should not be translated</comment>
</data>
@ -736,9 +738,6 @@ Windows 版本: {}</value>
<data name="MessageFailedToResizeDisk" xml:space="preserve">
<value>無法調整磁碟。</value>
</data>
<data name="MessageFailedToTranslatePath" xml:space="preserve">
<value>無法翻譯路徑。</value>
</data>
<data name="MessageNoValueFound" xml:space="preserve">
<value>找不到任何值。</value>
</data>

View File

@ -183,7 +183,7 @@
<!-- WslDeviceHost_VirtioFs (admin) -->
<RegistryKey Root="HKCR" Key="CLSID\{7e6ad219-d1b3-42d5-b8ee-d96324e64ff6}">
<RegistryValue Value="WslDeviceHost_VirtioFs_Admin" Type="string"/>
<RegistryValue Name="AppId" Value="{7F82AD86-755B-4870-86B1-D2E68DFE8A49}" Type="string"/>
<RegistryValue Name="AppId" Value="{17696EAC-9568-4CF5-BB8C-82515AAD6C09}" Type="string"/>
<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wsldevicehost.dll" Type="string"/>
@ -191,15 +191,6 @@
</RegistryKey>
</RegistryKey>
<RegistryKey Root="HKCR" Key="AppID\{7F82AD86-755B-4870-86B1-D2E68DFE8A49}">
<RegistryValue Name="DllSurrogate" Value="" Type="string"/>
<RegistryValue Name="AppIDFlags" Value="2048" Type="integer"/><!--0x800-->
<!-- O:BAG:BAD:(A;;CCDCSW;;;AU)(A;;CCDCSW;;;PS)(A;;CCDCSW;;;SY) -->
<RegistryValue Name="AccessPermission" Value="01000480580000006800000000000000140000000200440003000000000014000B00000001010000000000050B000000000014000B00000001010000000000050A000000000014000B0000000101000000000005120000000102000000000005200000002002000001020000000000052000000020020000" Type="binary" />
<RegistryValue Name="LaunchPermission" Value="01000480580000006800000000000000140000000200440003000000000014000B00000001010000000000050B000000000014000B00000001010000000000050A000000000014000B0000000101000000000005120000000102000000000005200000002002000001020000000000052000000020020000" Type="binary" />
</RegistryKey>
<!-- WslDeviceHost_VirtioFs -->
<RegistryKey Root="HKCR" Key="CLSID\{60285AE6-AAF3-4456-B444-A6C2D0DEDA38}">
<RegistryValue Value="WslDeviceHost_VirtioFs" Type="string" />

View File

@ -18,11 +18,11 @@
<package id="Microsoft.WSL.bsdtar" version="0.0.2-2" />
<package id="Microsoft.WSL.Dependencies.amd64fre" version="10.0.27820.1000-250318-1700.rs-base2-hyp" targetFramework="native" />
<package id="Microsoft.WSL.Dependencies.arm64fre" version="10.0.27820.1000-250318-1700.rs-base2-hyp" targetFramework="native" />
<package id="Microsoft.WSL.DeviceHost" version="1.0.0-20251202.1" />
<package id="Microsoft.WSL.DeviceHost" version="1.1.10-0" />
<package id="Microsoft.WSL.Kernel" version="6.6.114.1-1" targetFramework="native" />
<package id="Microsoft.WSL.LinuxSdk" version="1.20.0" targetFramework="native" />
<package id="Microsoft.WSL.TestDistro" version="2.5.7-47" />
<package id="Microsoft.WSLg" version="1.0.71" />
<package id="Microsoft.WSLg" version="1.0.73" />
<package id="Microsoft.Xaml.Behaviors.WinUI.Managed" version="3.0.0" />
<package id="StrawberryPerl" version="5.32.1.1" />
<package id="vswhere" version="3.1.7" />

View File

@ -315,21 +315,17 @@ void GnsEngine::ProcessDNSChange(Interface& interface, const wsl::shared::hns::D
content << L"nameserver " << server << L"\n";
}
if (!payload.Domain.empty())
{
content << L"domain " << payload.Domain << L"\n";
}
// Use 'search' for DNS suffixes.
// Per resolv.conf(5): "The domain directive is an obsolete name for the search directive
// that handles one search list entry only."
// See: https://man7.org/linux/man-pages/man5/resolv.conf.5.html
if (!payload.Search.empty())
{
content << L"search " << wsl::shared::string::Join(wsl::shared::string::Split(payload.Search, L','), L' ') << L"\n";
}
GNS_LOG_INFO(
"Setting DNS server domain to {}: {} on interfaceName {} ",
payload.Domain.c_str(),
content.str().c_str(),
interface.Name().c_str());
"Setting DNS search to {}: {} on interfaceName {} ", payload.Search.c_str(), content.str().c_str(), interface.Name().c_str());
std::wofstream resolvConf;
resolvConf.exceptions(std::ofstream::badbit | std::ofstream::failbit);

View File

@ -679,12 +679,7 @@ try
//
Config.FeatureFlags = Message->FeatureFlags;
char FeatureFlagsString[10];
snprintf(FeatureFlagsString, sizeof(FeatureFlagsString), "%x", Config.FeatureFlags.value());
if (setenv(WSL_FEATURE_FLAGS_ENV, FeatureFlagsString, 1) < 0)
{
LOG_ERROR("setenv failed {}", errno);
}
UtilSetFeatureFlags(Config.FeatureFlags.value());
//
// Determine the default UID which can be specified in /etc/wsl.conf.
@ -1729,10 +1724,6 @@ Return Value:
if (strcmp(MountEnum.Current().FileSystemType, PLAN9_FS_TYPE) == 0)
{
MountSource = UtilParsePlan9MountSource(MountEnum.Current().SuperOptions);
if (MountSource.empty())
{
continue;
}
}
else if (strcmp(MountEnum.Current().FileSystemType, DRVFS_FS_TYPE) == 0)
{
@ -1741,13 +1732,18 @@ Return Value:
}
else if (strcmp(MountEnum.Current().FileSystemType, VIRTIO_FS_TYPE) == 0)
{
MountSource = UtilParseVirtiofsMountSource(MountEnum.Current().Source);
MountSource = QueryVirtiofsMountSource(MountEnum.Current().Source);
}
else
{
continue;
}
if (MountSource.empty())
{
continue;
}
auto letter = ConfigGetDriveLetter(MountSource);
if (letter.has_value())
{
@ -2412,7 +2408,7 @@ try
NewMountOptions = MountEntry.MountOptions;
NewMountOptions += ',';
if (WSL_USE_VIRTIO_9P(Config))
if (WSL_USE_VIRTIO_9P())
{
//
// Check if the existing mount is a drvfs mount that needs to be remounted.
@ -2445,17 +2441,10 @@ try
NewMountOptions += ',';
}
MountPlan9Filesystem(NewSource, MountEntry.MountPoint, NewMountOptions.c_str(), Message->Admin, Config);
MountPlan9Share(NewSource, MountEntry.MountPoint, NewMountOptions.c_str(), Message->Admin);
}
else if (strcmp(MountEntry.FileSystemType, VIRTIO_FS_TYPE) == 0)
{
std::string_view Source = MountEntry.Source;
std::string_view OldTag = Message->Admin ? LX_INIT_DRVFS_VIRTIO_TAG : LX_INIT_DRVFS_ADMIN_VIRTIO_TAG;
if (!wsl::shared::string::StartsWith(Source, OldTag))
{
continue;
}
RemountVirtioFs(MountEntry.Source, MountEntry.MountPoint, MountEntry.MountOptions, Message->Admin);
}
else

View File

@ -23,8 +23,8 @@ Abstract:
#include "SocketChannel.h"
#include "WslDistributionConfig.h"
#define WSL_USE_VIRTIO_9P(_Config) (WI_IsFlagSet(UtilGetFeatureFlags((_Config)), LxInitFeatureVirtIo9p))
#define WSL_USE_VIRTIO_FS(_Config) (WI_IsFlagSet(UtilGetFeatureFlags((_Config)), LxInitFeatureVirtIoFs))
#define WSL_USE_VIRTIO_9P() (WI_IsFlagSet(UtilGetFeatureFlags(), LxInitFeatureVirtIo9p))
#define WSL_USE_VIRTIO_FS() (WI_IsFlagSet(UtilGetFeatureFlags(), LxInitFeatureVirtIoFs))
#define WSLG_SHARED_FOLDER "wslg"
#define INIT_MAKE_SECURITY(_uid, _gid, _mode) {_uid, _gid, _mode}

View File

@ -220,11 +220,7 @@ int MountWithRetry(const char* Source, const char* Target, const char* FsType, c
Routine Description:
This routine will perform a mount using the /bin/mount binary, and will
retry it if it fails.
N.B. This routine is used for virtio-9p and virtiofs which can transiently
fail to mount if the PCI device isn't ready yet.
This routine performs a mount with retry logic for DrvFs filesystems.
Arguments:
@ -246,52 +242,19 @@ Return Value:
try
{
int Result;
try
//
// Verify the target directory exists before mounting.
//
int Result = access(Target, F_OK);
if (Result < 0)
{
bool PrintWarning = true;
wsl::shared::retry::RetryWithTimeout<void>(
[&]() { THROW_LAST_ERROR_IF(mountutil::MountFilesystem(Source, Target, FsType, Options) < 0); },
std::chrono::milliseconds{100},
std::chrono::seconds{2},
[&]() {
// For virtio-9p, there are two errors that could indicate the PCI device is not ready:
// EBUSY - Returned if all devices with the tag are already in use.
// ENOENT - Returned if there are no devices with the tag, which can happen after the VM first boots.
// In this case, check if the target exists; if it doesn't, ENOENT is for that and there's no reason to retry.
//
// For virtiofs, EINVAL will be returned if the tag is not ready.
auto savedErrno = wil::ResultFromCaughtException();
if (strcmp(FsType, PLAN9_FS_TYPE) == 0)
{
if (errno != EBUSY && (errno != ENOENT || access(Target, F_OK) != 0))
{
errno = savedErrno;
return false;
}
}
else if ((strcmp(FsType, VIRTIO_FS_TYPE) == 0) && (errno != EINVAL))
{
return false;
}
if (PrintWarning)
{
LOG_WARNING("mount: waiting for virtio device {}", Source);
PrintWarning = false;
}
return true;
});
Result = 0;
LOG_STDERR(errno);
}
catch (...)
else
{
errno = wil::ResultFromCaughtException();
auto parsed = mountutil::MountParseFlags(Options);
LOG_ERROR("mount({}, {}, {}, {:#x}, {}) failed: {}", Source, Target, FsType, parsed.MountFlags, parsed.StringOptions.c_str(), strerror(errno));
Result = -1;
auto Parsed = mountutil::MountParseFlags(Options);
Result = UtilMount(Source, Target, FsType, Parsed.MountFlags, Parsed.StringOptions.c_str(), std::chrono::seconds{2});
}
if (ExitCode)
@ -335,70 +298,12 @@ try
{
return MountFilesystem(DRVFS_FS_TYPE, Source, Target, Options, ExitCode);
}
// Use virtiofs if the source of the mount is the root of a drive; otherwise, use 9p.
if (WSL_USE_VIRTIO_FS(Config))
else if (WSL_USE_VIRTIO_FS())
{
if (wsl::shared::string::IsDriveRoot(Source))
{
return MountVirtioFs(Source, Target, Options, Admin, Config, ExitCode);
}
LOG_WARNING("virtiofs is only supported for mounting full drives, using 9p to mount {}", Source);
return MountVirtioFs(Source, Target, Options, Admin, Config, ExitCode);
}
//
// Check if the path is a UNC path.
//
const char* Plan9Source;
std::string UncSource;
if ((strlen(Source) >= PLAN9_UNC_PREFIX_LENGTH) && ((Source[0] == '/') || (Source[0] == '\\')) &&
((Source[1] == '/') || (Source[1] == '\\')))
{
UncSource = PLAN9_UNC_TRANSLATED_PREFIX;
UncSource += &Source[PLAN9_UNC_PREFIX_LENGTH];
Plan9Source = UncSource.c_str();
}
else
{
Plan9Source = Source;
}
//
// Check whether to use the elevated or regular 9p server.
//
bool Elevated = Admin.has_value() ? Admin.value() : IsDrvfsElevated();
//
// Initialize mount options.
//
auto Plan9Options = std::format("{};path={}", PLAN9_ANAME_DRVFS, Plan9Source);
//
// N.B. The cache option is added to the start of this so if the user
// specifies one explicitly, it will override the default.
//
std::string MountOptions = "cache=mmap,";
auto ParsedOptions = ConvertDrvfsMountOptionsToPlan9(Options ? Options : "", Config);
Plan9Options += ParsedOptions.first;
MountOptions += ParsedOptions.second;
//
// Append the 9p mount options to the end of the other mount options and perform the mount operation.
//
MountOptions += Plan9Options;
if (MountPlan9Filesystem(Source, Target, MountOptions.c_str(), Elevated, Config, ExitCode) < 0)
{
return -1;
}
return 0;
return MountPlan9(Source, Target, Options, Admin, Config, ExitCode);
}
CATCH_RETURN_ERRNO()
@ -444,7 +349,7 @@ Return Value:
return ExitCode;
}
int MountPlan9Filesystem(const char* Source, const char* Target, const char* Options, bool Admin, const wsl::linux::WslDistributionConfig& Config, int* ExitCode)
int MountPlan9Share(const char* Source, const char* Target, const char* Options, bool Admin, int* ExitCode)
/*++
@ -472,7 +377,7 @@ Return Value:
{
std::string MountOptions;
if (WSL_USE_VIRTIO_9P(Config))
if (WSL_USE_VIRTIO_9P())
{
Source = Admin ? LX_INIT_DRVFS_ADMIN_VIRTIO_TAG : LX_INIT_DRVFS_VIRTIO_TAG;
MountOptions = std::format("msize=262144,trans=virtio,{}", Options);
@ -489,10 +394,95 @@ Return Value:
MountOptions =
std::format("msize={},trans=fd,rfdno={},wfdno={},{}", LX_INIT_UTILITY_VM_PLAN9_BUFFER_SIZE, Fd.get(), Fd.get(), Options);
return MountFilesystem(PLAN9_FS_TYPE, Source, Target, MountOptions.c_str(), ExitCode);
}
}
int MountPlan9(const char* Source, const char* Target, const char* Options, std::optional<bool> Admin, const wsl::linux::WslDistributionConfig& Config, int* ExitCode)
/*++
Routine Description:
This routine will perform a DrvFs mount using Plan9.
Arguments:
Source - Supplies the mount source.
Target - Supplies the mount target.
Options - Supplies the mount options.
Admin - Supplies an optional boolean to specify if the admin or non-admin share should be used.
Config - Supplies the distribution configuration.
ExitCode - Supplies an optional pointer that receives the exit code.
Return Value:
0 on success, -1 on failure.
--*/
try
{
//
// Check if the path is a UNC path.
//
const char* Plan9Source;
std::string UncSource;
if ((strlen(Source) >= PLAN9_UNC_PREFIX_LENGTH) && ((Source[0] == '/') || (Source[0] == '\\')) &&
((Source[1] == '/') || (Source[1] == '\\')))
{
UncSource = PLAN9_UNC_TRANSLATED_PREFIX;
UncSource += &Source[PLAN9_UNC_PREFIX_LENGTH];
Plan9Source = UncSource.c_str();
}
else
{
Plan9Source = Source;
}
//
// Check whether to use the elevated or regular 9p server.
//
bool Elevated = Admin.has_value() ? Admin.value() : IsDrvfsElevated();
//
// Initialize mount options.
//
auto Plan9Options = std::format("{};path={}", PLAN9_ANAME_DRVFS, Plan9Source);
//
// N.B. The cache option is added to the start of this so if the user
// specifies one explicitly, it will override the default.
//
std::string MountOptions = "cache=mmap,";
auto ParsedOptions = ConvertDrvfsMountOptionsToPlan9(Options ? Options : "", Config);
Plan9Options += ParsedOptions.first;
MountOptions += ParsedOptions.second;
//
// Append the 9p mount options to the end of the other mount options and perform the mount operation.
//
MountOptions += Plan9Options;
if (MountPlan9Share(Source, Target, MountOptions.c_str(), Elevated, ExitCode) < 0)
{
return -1;
}
return 0;
}
CATCH_RETURN_ERRNO()
int MountVirtioFs(const char* Source, const char* Target, const char* Options, std::optional<bool> Admin, const wsl::linux::WslDistributionConfig& Config, int* ExitCode)
/*++
@ -523,7 +513,7 @@ Return Value:
try
{
assert(wsl::shared::string::IsDriveRoot(Source));
assert(WSL_USE_VIRTIO_FS());
//
// Check whether to use the elevated or non-elevated virtiofs server.
@ -553,7 +543,7 @@ try
AddShare.WriteString(AddShare->OptionsOffset, Plan9Options);
//
// Connect to the wsl service to add the virtiofs share.
// Connect to the wsl service to add the virtiofs share. If adding the share fails, fallback to mounting using Plan9.
//
wsl::shared::SocketChannel Channel{UtilConnectVsock(LX_INIT_UTILITY_VM_VIRTIOFS_PORT, true), "VirtoFs"};
@ -564,11 +554,10 @@ try
gsl::span<gsl::byte> ResponseSpan;
const auto& Response = Channel.Transaction<LX_INIT_ADD_VIRTIOFS_SHARE_MESSAGE>(AddShare.Span(), &ResponseSpan);
if (Response.Result != 0)
{
LOG_ERROR("Add virtiofs share for {} failed {}", Source, Response.Result);
return -1;
LOG_WARNING("Add virtiofs share for {} failed {}, falling back to Plan9", Source, Response.Result);
return MountPlan9(Source, Target, Options, Admin, Config, ExitCode);
}
//
@ -607,6 +596,8 @@ Return Value:
try
{
assert(WSL_USE_VIRTIO_FS());
wsl::shared::MessageWriter<LX_INIT_REMOUNT_VIRTIOFS_SHARE_MESSAGE> RemountShare(LxInitMessageRemountVirtioFsDevice);
RemountShare->Admin = Admin;
RemountShare.WriteString(RemountShare->TagOffset, Tag);
@ -633,3 +624,67 @@ try
return MountWithRetry(Tag, Target, VIRTIO_FS_TYPE, Options);
}
CATCH_RETURN_ERRNO()
std::string QueryVirtiofsMountSource(const char* Tag)
/*++
Routine Description:
This routine takes a virtiofs tag and determines the Windows path it refers to.
Arguments:
Tag - Supplies the virtiofs tag to query.
Return Value:
The mount source, an empty string on failure.
--*/
try
{
if (!WSL_USE_VIRTIO_FS())
{
return {};
}
//
// Validate the tag is a GUID.
//
const auto Guid = wsl::shared::string::ToGuid(Tag);
if (!Guid)
{
return {};
}
wsl::shared::MessageWriter<LX_INIT_QUERY_VIRTIOFS_SHARE_MESSAGE> QueryShare(LxInitMessageQueryVirtioFsDevice);
QueryShare.WriteString(QueryShare->TagOffset, Tag);
//
// Connect to the host and send the query request.
//
wsl::shared::SocketChannel Channel{UtilConnectVsock(LX_INIT_UTILITY_VM_VIRTIOFS_PORT, true), "QueryVirtioFs"};
if (Channel.Socket() < 0)
{
return {};
}
gsl::span<gsl::byte> ResponseSpan;
const auto& Response = Channel.Transaction<LX_INIT_QUERY_VIRTIOFS_SHARE_MESSAGE>(QueryShare.Span(), &ResponseSpan);
if (Response.Result != 0)
{
LOG_ERROR("Query virtiofs share for {} failed {}", Tag, Response.Result);
return {};
}
return wsl::shared::string::FromSpan(ResponseSpan, Response.TagOffset);
}
catch (...)
{
LOG_CAUGHT_EXCEPTION();
return {};
}

View File

@ -23,9 +23,12 @@ int MountDrvfs(const char* Source, const char* Target, const char* Options, std:
int MountDrvfsEntry(int Argc, char* Argv[]);
int MountPlan9Filesystem(
const char* Source, const char* Target, const char* Options, bool Admin, const wsl::linux::WslDistributionConfig& Config, int* ExitCode = nullptr);
int MountPlan9Share(const char* Source, const char* Target, const char* Options, bool Admin, int* ExitCode = nullptr);
int MountPlan9(const char* Source, const char* Target, const char* Options, std::optional<bool> Admin, const wsl::linux::WslDistributionConfig& Config, int* ExitCode);
int MountVirtioFs(const char* Source, const char* Target, const char* Options, std::optional<bool> Admin, const wsl::linux::WslDistributionConfig& Config, int* ExitCode = nullptr);
int RemountVirtioFs(const char* Tag, const char* Target, const char* Options, bool Admin);
std::string QueryVirtiofsMountSource(const char* Tag);

View File

@ -690,7 +690,7 @@ try
}
Common->Environment.AddVariable("DBUS_SESSION_BUS_ADDRESS", std::format("unix:path=/run/user/{}/bus", PasswordEntry->pw_uid));
Common->Environment.AddVariable(XDG_RUNTIME_DIR_ENV, std::format("/run/user/{}/", PasswordEntry->pw_uid));
Common->Environment.AddVariable(XDG_RUNTIME_DIR_ENV, std::format("/run/user/{}", PasswordEntry->pw_uid));
}
//

View File

@ -12,6 +12,8 @@
#include <netinet/ip.h>
#include <sys/syscall.h>
#include <linux/unistd.h>
#include <linux/sock_diag.h>
#include <linux/inet_diag.h>
#include <lxwil.h>
#include <linux/if_tun.h>
@ -21,6 +23,8 @@
#include "SecCompDispatcher.h"
#include "seccomp_defs.h"
#include "CommandLine.h"
#include "NetlinkChannel.h"
#include "NetlinkTransactionError.h"
#define TCP_LISTEN 10
@ -145,80 +149,60 @@ void ListenThread(sockaddr_vm hvSocketAddress, int listenSocket)
return;
}
std::vector<sockaddr_storage> ParseTcpFile(int family, FILE* file)
std::vector<sockaddr_storage> QueryListeningSockets(NetlinkChannel& channel)
{
char* line = nullptr;
auto freeLine = wil::scope_exit([&line]() { free(line); });
// Skip the first line which contains a header.
size_t lineLength = 0;
auto bytesRead = getline(&line, &lineLength, file);
THROW_LAST_ERROR_IF(bytesRead < 0);
// Each line contains information about TCP sockets on the system, the fields
// we are interested are for sockets that are or have been listening:
// 1: Socket address and port number
// 3: Socket status
std::vector<sockaddr_storage> sockets{};
while ((bytesRead = getline(&line, &lineLength, file)) != -1)
try
{
sockaddr_storage sock{};
int index = 0;
int status = 0;
for (char *sp, *field = strtok_r(line, " \n", &sp); field != nullptr; field = strtok_r(NULL, " \n", &sp))
inet_diag_req_v2 message{};
message.sdiag_protocol = IPPROTO_TCP;
message.idiag_states = (1 << TCP_LISTEN);
auto onMessage = [&](const NetlinkResponse& response) {
for (const auto& e : response.Messages<inet_diag_msg>(SOCK_DIAG_BY_FAMILY))
{
const auto* payload = e.Payload();
sockaddr_storage sock{};
if (payload->idiag_family == AF_INET)
{
auto* ipv4 = reinterpret_cast<sockaddr_in*>(&sock);
ipv4->sin_family = AF_INET;
ipv4->sin_addr.s_addr = payload->id.idiag_src[0];
ipv4->sin_port = payload->id.idiag_sport;
}
else if (payload->idiag_family == AF_INET6)
{
auto* ipv6 = reinterpret_cast<sockaddr_in6*>(&sock);
ipv6->sin6_family = AF_INET6;
static_assert(sizeof(ipv6->sin6_addr.s6_addr32) == sizeof(payload->id.idiag_src));
memcpy(ipv6->sin6_addr.s6_addr32, payload->id.idiag_src, sizeof(ipv6->sin6_addr.s6_addr32));
ipv6->sin6_port = payload->id.idiag_sport;
}
sockets.emplace_back(sock);
}
};
// Query IPv4 listening sockets.
{
if (index == 1)
{
int port;
const char* portString = strchr(field, ':');
if (portString == nullptr)
{
break;
}
portString += 1;
port = static_cast<int>(strtol(portString, nullptr, 16));
if (port == 0)
{
break;
}
if (family == AF_INET)
{
sockaddr_in ipv4Sock{};
ipv4Sock.sin_family = family;
ipv4Sock.sin_addr.s_addr = strtol(field, nullptr, 16);
ipv4Sock.sin_port = port;
memcpy(&sock, &ipv4Sock, sizeof(ipv4Sock));
}
else if (family == AF_INET6)
{
sockaddr_in6 ipv6Sock{};
ipv6Sock.sin6_family = family;
ipv6Sock.sin6_port = port;
for (int part = 0; part < 4; ++part)
{
char next[5];
next[4] = 0;
memcpy(next, field + part * 4, 4);
ipv6Sock.sin6_addr.__in6_union.__s6_addr32[part] = strtol(next, nullptr, 16);
}
memcpy(&sock, &ipv6Sock, sizeof(ipv6Sock));
}
}
else if (index == 3)
{
status = static_cast<int>(strtol(field, nullptr, 16));
break;
}
index += 1;
message.sdiag_family = AF_INET;
auto transaction = channel.CreateTransaction(message, SOCK_DIAG_BY_FAMILY, NLM_F_DUMP);
transaction.Execute(onMessage);
}
if ((status == TCP_LISTEN) && (sock.ss_family != 0))
// Query IPv6 listening sockets.
{
sockets.emplace_back(sock);
message.sdiag_family = AF_INET6;
auto transaction = channel.CreateTransaction(message, SOCK_DIAG_BY_FAMILY, NLM_F_DUMP);
transaction.Execute(onMessage);
}
}
catch (const NetlinkTransactionError& e)
{
// Log but don't fail - network state might be temporarily unavailable
LOG_ERROR("Failed to query listening sockets via sock_diag: {}", e.what());
}
return sockets;
}
@ -246,12 +230,12 @@ LX_GNS_PORT_LISTENER_RELAY SockToRelayMessage(const sockaddr_storage& sock)
{
auto ipv4 = reinterpret_cast<const sockaddr_in*>(&sock);
message.Address[0] = ipv4->sin_addr.s_addr;
message.Port = ipv4->sin_port;
message.Port = ntohs(ipv4->sin_port);
}
else if (sock.ss_family == AF_INET6)
{
auto ipv6 = reinterpret_cast<const sockaddr_in6*>(&sock);
message.Port = ipv6->sin6_port;
message.Port = ntohs(ipv6->sin6_port);
memcpy(message.Address, ipv6->sin6_addr.__in6_union.__s6_addr, sizeof(message.Address));
}
return message;
@ -296,53 +280,23 @@ bool IsSameSockAddr(const sockaddr_storage& left, const sockaddr_storage& right)
{
auto leftIpv6 = reinterpret_cast<const sockaddr_in6*>(&left);
auto rightIpv6 = reinterpret_cast<const sockaddr_in6*>(&right);
if (leftIpv6->sin6_port != rightIpv6->sin6_port)
{
return false;
}
for (int part = 0; part < 4; ++part)
{
if (leftIpv6->sin6_addr.__in6_union.__s6_addr32[part] != rightIpv6->sin6_addr.__in6_union.__s6_addr32[part])
{
return false;
}
}
return true;
}
else
{
FATAL_ERROR("Unrecognized socket family {}", left.ss_family);
return false;
return (leftIpv6->sin6_port == rightIpv6->sin6_port && memcmp(&leftIpv6->sin6_addr, &rightIpv6->sin6_addr, sizeof(in6_addr)) == 0);
}
FATAL_ERROR("Unrecognized socket family {}", left.ss_family);
return false;
}
// Start looking for ports bound to localhost or wildcard.
int ScanProcNetTCP(wsl::shared::SocketChannel& channel)
// Monitor listening TCP sockets using sock_diag netlink interface.
int MonitorListeningSockets(wsl::shared::SocketChannel& channel)
{
// Periodically scan procfs for listening TCP sockets.
NetlinkChannel netlinkChannel(SOCK_RAW, NETLINK_SOCK_DIAG);
std::vector<sockaddr_storage> relays{};
int result = 0;
for (;;)
{
std::vector<sockaddr_storage> sockets;
wil::unique_file tcp4File{fopen("/proc/net/tcp", "r")};
if (tcp4File)
{
sockets = ParseTcpFile(AF_INET, tcp4File.get());
}
wil::unique_file tcp6File{fopen("/proc/net/tcp6", "r")};
if (tcp6File)
{
auto ipv6Sockets = ParseTcpFile(AF_INET6, tcp6File.get());
sockets.insert(sockets.end(), ipv6Sockets.begin(), ipv6Sockets.end());
}
if (!tcp4File && !tcp6File)
{
LOG_ERROR("Failed to open /proc/net/tcp and /proc/net/tcp6, closing port relay");
return 1;
}
auto sockets = QueryListeningSockets(netlinkChannel);
// Stop any relays that no longer match listening ports.
std::erase_if(relays, [&](const auto& entry) {
@ -386,9 +340,7 @@ int ScanProcNetTCP(wsl::shared::SocketChannel& channel)
}
// Sleep before scanning again.
//
// TODO: Investigate using EBPF notifications instead of a sleep.
sleep(1);
std::this_thread::sleep_for(std::chrono::seconds(1));
}
return result;
@ -432,7 +384,7 @@ try
if (ScanForPorts)
{
return ScanProcNetTCP(channel);
return MonitorListeningSockets(channel);
}
return 0;

View File

@ -72,8 +72,9 @@ Abstract:
#define CROSS_DISTRO_SHARE_PATH "/mnt/wsl"
#define DEVFS_PATH "/dev"
#define DEVNULL_PATH DEVFS_PATH "/null"
#define DHCLIENT_CONF_PATH "/dhclient.conf"
#define DHCLIENT_PATH "/usr/sbin/dhclient"
#define DHCPCD_CONF_PATH "/dhcpcd.conf"
#define DHCPCD_PATH "/usr/sbin/dhcpcd"
#define DISTRO_PATH "/distro"
#define ETC_PATH "/etc"
#define GPU_SHARE_PREFIX "/gpu_"
@ -1230,11 +1231,12 @@ int StartDhcpClient(int DhcpTimeout)
Routine Description:
Starts the dhcp client daemon.
Starts the dhcp client daemon. Blocks until the initial DHCP lease is acquired,
then the daemon continues running in the background to handle renewals.
Arguments:
None.
DhcpTimeout - Supplies the timeout in seconds for the DHCP request.
Return Value:
@ -1243,37 +1245,21 @@ Return Value:
--*/
{
int ChildPid = UtilCreateChildProcess("dhcp", [DhcpTimeout]() {
int ChildPid = UtilCreateChildProcess("dhcpcd", [DhcpTimeout]() {
//
// Create a new mount namespace for dhclient.
//
THROW_LAST_ERROR_IF(unshare(CLONE_NEWNS) < 0);
//
// When dhclient receives a DHCP response, it calls dhclient-script
// which creates a new file, and then moves it to /etc/resolv.conf.
// Because it's moved, it will overwrite any symlinks / hardlinks.
// Mounting /etc over /share allows resolv.conf to be written to /share.
//
THROW_LAST_ERROR_IF(mount(CROSS_DISTRO_SHARE_PATH, ETC_PATH, NULL, MS_BIND, NULL) < 0);
//
// Write the dhclient.conf config file.
// Write the dhcpcd.conf config file.
//
std::string Config = std::format(
"request subnet-mask, broadcast-address, routers,"
"domain-name, domain-name-servers, domain-search, host-name,"
"interface-mtu;\n"
"timeout {};\n",
"option subnet_mask, routers, broadcast, domain_name, domain_name_servers, domain_search, host_name, interface_mtu\n"
"noarp\n"
"timeout {}\n",
DhcpTimeout);
THROW_LAST_ERROR_IF(WriteToFile(DHCLIENT_CONF_PATH, Config.c_str()) < 0);
THROW_LAST_ERROR_IF(WriteToFile(DHCPCD_CONF_PATH, Config.c_str()) < 0);
execl(DHCLIENT_PATH, DHCLIENT_PATH, "-4", "eth0", "-cf", DHCLIENT_CONF_PATH, NULL);
LOG_ERROR("execl() failed, {}", errno);
execl(DHCPCD_PATH, DHCPCD_PATH, "-w", "-4", "-f", DHCPCD_CONF_PATH, "eth0", NULL);
LOG_ERROR("execl({}) failed, {}", DHCPCD_PATH, errno);
});
if (ChildPid < 0)
@ -1281,12 +1267,7 @@ Return Value:
return -1;
}
//
// Note: dhclient returns when the interface is successfully configured,
// but keeps a daemon running to maintain it.
//
return WaitForChild(ChildPid, DHCLIENT_PATH);
return WaitForChild(ChildPid, DHCPCD_PATH);
}
int StartGuestNetworkService(int GnsFd, wil::unique_fd&& DnsTunnelingFd, uint32_t DnsTunnelingIpAddress)

View File

@ -53,6 +53,7 @@ Abstract:
#define WSL_MOUNT_OPTION_SEP ','
int g_IsVmMode = -1;
static std::optional<int> g_CachedFeatureFlags;
static sigset_t g_originalSignals;
thread_local std::string g_threadName;
@ -902,11 +903,12 @@ try
}
else if (strcmp(MountEnum.Current().FileSystemType, VIRTIO_FS_TYPE) == 0)
{
MountSource = UtilParseVirtiofsMountSource(MountEnum.Current().Source);
MountSource = QueryVirtiofsMountSource(MountEnum.Current().Source);
if (MountSource.empty())
{
continue;
}
MountEnum.Current().Source = MountSource.data();
}
else if (strcmp(MountEnum.Current().FileSystemType, DRVFS_FS_TYPE) == 0)
@ -1118,7 +1120,7 @@ catch (...)
return {};
}
int UtilGetFeatureFlags(const wsl::linux::WslDistributionConfig& Config)
int UtilGetFeatureFlags()
/*++
@ -1129,7 +1131,7 @@ Routine Description:
Arguments:
Config - Supplies the distribution config.
None.
Return Value:
@ -1142,21 +1144,11 @@ Return Value:
// If feature flags are already known, return them.
//
static std::optional<int> g_CachedFeatureFlags;
if (g_CachedFeatureFlags)
{
return *g_CachedFeatureFlags;
}
//
// If an error occurs, just return no features.
//
if (Config.FeatureFlags.has_value())
{
return Config.FeatureFlags.value();
}
//
// Check if the environment variable is present.
//
@ -1166,9 +1158,7 @@ Return Value:
//
int FeatureFlags = LxInitFeatureNone;
const char* FeatureFlagEnv = getenv(WSL_FEATURE_FLAGS_ENV);
if (FeatureFlagEnv != nullptr)
{
FeatureFlags = strtol(FeatureFlagEnv, nullptr, 16);
@ -1176,7 +1166,7 @@ Return Value:
else
{
//
// Query init for the value.
// Query init for the value. If an error occurs, just return no features.
//
wsl::shared::SocketChannel channel{UtilConnectUnix(WSL_INIT_INTEROP_SOCKET), "wslinfo"};
@ -1193,10 +1183,44 @@ Return Value:
FeatureFlags = channel.ReceiveMessage<RESULT_MESSAGE<int32_t>>().Result;
}
g_CachedFeatureFlags = FeatureFlags;
UtilSetFeatureFlags(FeatureFlags, FeatureFlagEnv == nullptr);
return FeatureFlags;
}
void UtilSetFeatureFlags(int FeatureFlags, bool UpdateEnv)
/*++
Routine Description:
This routine sets the feature flags and updates the cached value and environment variable.
Arguments:
FeatureFlags - Supplies the feature flags to set.
UpdateEnv - Supplies a boolean that indicates whether the environment variable should be updated.
Return Value:
None.
--*/
try
{
g_CachedFeatureFlags = FeatureFlags;
if (UpdateEnv)
{
auto FeatureFlagsString = std::format("{:x}", FeatureFlags);
if (setenv(WSL_FEATURE_FLAGS_ENV, FeatureFlagsString.c_str(), 1) < 0)
{
LOG_ERROR("setenv({}, {}, 1) failed {}", WSL_FEATURE_FLAGS_ENV, FeatureFlagsString, errno);
}
}
}
CATCH_LOG()
std::optional<LX_MINI_INIT_NETWORKING_MODE> UtilGetNetworkingMode(void)
/*++
@ -1706,8 +1730,10 @@ Return Value:
//
// Mount the device to the mount point.
//
// N.B. The mount operation is only retried if the mount source does not yet exist,
// which can happen when hot-added devices are not yet available in the guest.
// N.B. The mount operation is retried if:
// - The mount source does not yet exist (hot-added devices)
// - For Plan9 (9p): device is busy or not found
// - For VirtioFS: invalid tag (device not ready)
//
try
@ -1720,7 +1746,23 @@ Return Value:
TimeoutSeconds.value(),
[&]() {
errno = wil::ResultFromCaughtException();
return errno == ENOENT || errno == ENXIO || errno == EIO;
// Generic device not ready errors
if (errno == ENXIO || errno == EIO || errno == ENOENT)
{
return true;
}
// Filesystem-specific device readiness errors
if (Type != nullptr)
{
if ((strcmp(Type, PLAN9_FS_TYPE) == 0 && errno == EBUSY) || (strcmp(Type, VIRTIO_FS_TYPE) == 0 && errno == EINVAL))
{
return true;
}
}
return false;
});
}
else
@ -1731,7 +1773,7 @@ Return Value:
catch (...)
{
errno = wil::ResultFromCaughtException();
LOG_ERROR("mount({}, {}, {}, 0x{}x, {}) failed {}", Source, Target, Type, MountFlags, Options, errno);
LOG_ERROR("mount({}, {}, {}, {:#x}, {}) failed {}", Source, Target, Type, MountFlags, Options, errno);
return -errno;
}
@ -2008,41 +2050,6 @@ Return Value:
return {};
}
std::string UtilParseVirtiofsMountSource(std::string_view Source)
/*++
Routine Description:
This routine parses the mount source to determine the actual source of a
a VirtioFs mount.
Arguments:
Source - Supplies the source string.
Return Value:
The mount source, or NULL if the source is not valid.
--*/
{
std::string MountSource{};
if (wsl::shared::string::StartsWith(Source, LX_INIT_DRVFS_ADMIN_VIRTIO_TAG) && (Source.size() >= sizeof(LX_INIT_DRVFS_ADMIN_VIRTIO_TAG)))
{
MountSource = Source[sizeof(LX_INIT_DRVFS_ADMIN_VIRTIO_TAG) - 1];
MountSource += ":";
}
else if (wsl::shared::string::StartsWith(Source, LX_INIT_DRVFS_VIRTIO_TAG) && (Source.size() >= sizeof(LX_INIT_DRVFS_VIRTIO_TAG)))
{
MountSource = Source[sizeof(LX_INIT_DRVFS_VIRTIO_TAG) - 1];
MountSource += ":";
}
return MountSource;
}
std::vector<char> UtilParseWslEnv(char* NtEnvironment)
/*++
@ -2884,14 +2891,16 @@ Return Value:
std::string TranslatedPath = WslPathTranslate(Path, 0, Mode);
if (TranslatedPath.empty())
{
auto WarningMessage = wsl::shared::Localization::MessageFailedToTranslate(Path);
if (wil::ScopedWarningsCollector::CanCollectWarning())
{
EMIT_USER_WARNING(wsl::shared::Localization::MessageFailedToTranslate(Path));
EMIT_USER_WARNING(std::move(WarningMessage));
}
else
{
LOG_ERROR("Failed to translate {}", Path);
LOG_WARNING("{}", WarningMessage);
}
continue;
}

View File

@ -223,7 +223,9 @@ std::optional<std::string> UtilGetEnv(const char* Name, char* Environment);
std::string UtilGetEnvironmentVariable(const char* Name);
int UtilGetFeatureFlags(const wsl::linux::WslDistributionConfig& Config);
int UtilGetFeatureFlags();
void UtilSetFeatureFlags(int FeatureFlags, bool UpdateEnv = true);
std::optional<LX_MINI_INIT_NETWORKING_MODE> UtilGetNetworkingMode(void);
@ -257,8 +259,6 @@ int UtilParseCgroupsLine(char* Line, char** SubsystemName, bool* Enabled);
std::string UtilParsePlan9MountSource(std::string_view MountOptions);
std::string UtilParseVirtiofsMountSource(std::string_view MountOptions);
std::vector<char> UtilParseWslEnv(char* NtEnvironment);
int UtilProcessChildExitCode(int Status, const char* Name, int ExpectedStatus = 0, bool PrintError = true);

View File

@ -137,7 +137,7 @@ Return Value:
auto translatedPath = WslPathTranslate(value.data(), TRANSLATE_FLAG_ABSOLUTE, TRANSLATE_MODE_UNIX);
if (translatedPath.empty())
{
std::cerr << Localization::MessageFailedToTranslatePath() << "\n";
std::cerr << Localization::MessageFailedToTranslate(value.data()) << "\n";
return 1;
}

View File

@ -240,7 +240,6 @@ int ParseConfigFile(std::vector<ConfigKey>& keys, FILE* file, int flags, const w
{
wint_t ch = 0;
unsigned long line = 0;
size_t newKeyValueInsertPos = 0;
bool trailingComment = false;
bool inQuote = false;
size_t trimmedLength = 0;
@ -328,8 +327,6 @@ NewLine:
if (trailingComment)
{
// Subtract 1 to account for ch being '\n' or WEOF.
newKeyValueInsertPos = configFileOutput.length() - 1;
trailingComment = false;
}
}
@ -390,6 +387,37 @@ NewLine:
break;
case '[':
// We're about to parse a new section. If we have an unwritten key-value
// and the current section matches, write it now before moving to the new section.
if (updateConfigFile && !outputKeyValueUpdated && !removeKey && sectionLength > 0)
{
const auto& outputConfigKey = outputKey.value();
if (outputConfigKey.Matches(key.c_str(), sectionLength))
{
const auto& keyNames = outputConfigKey.GetNames();
// Config key without name.
FAIL_FAST_IF(keyNames.empty());
const auto keyNameUtf8 = keyNames.front();
const auto keyName = wsl::shared::string::MultiByteToWide(keyNameUtf8);
const auto sectionKeySeparatorPos = keyName.find('.');
// Config key without separated section/key name
FAIL_FAST_IF(sectionKeySeparatorPos == std::string_view::npos);
// Config key without section name
FAIL_FAST_IF(sectionKeySeparatorPos == 0);
// Config key without key name
FAIL_FAST_IF(sectionKeySeparatorPos == (keyName.length() - 1));
// Remove any trailing newlines before inserting the new key-value
while (!configFileOutput.empty() && configFileOutput.back() == L'\n')
{
configFileOutput.pop_back();
}
auto keyValue = std::format(L"\n{}={}\n\n", keyName.substr(sectionKeySeparatorPos + 1), outputKey.value().GetValue());
configFileOutput += keyValue;
outputKeyValueUpdated = true;
}
}
goto ParseSection;
default:
@ -418,30 +446,6 @@ NewLine:
}
ParseSection:
if (updateConfigFile && !outputKeyValueUpdated && !removeKey && sectionLength > 0)
{
const auto& outputConfigKey = outputKey.value();
if (outputConfigKey.Matches(key.c_str(), sectionLength))
{
const auto& keyNames = outputConfigKey.GetNames();
// Config key without name.
FAIL_FAST_IF(keyNames.empty());
const auto keyNameUtf8 = keyNames.front();
const auto keyName = wsl::shared::string::MultiByteToWide(keyNameUtf8);
const auto sectionKeySeparatorPos = keyName.find('.');
// Config key without separated section/key name
FAIL_FAST_IF(sectionKeySeparatorPos == std::string_view::npos);
// Config key without section name
FAIL_FAST_IF(sectionKeySeparatorPos == 0);
// Config key without key name
FAIL_FAST_IF(sectionKeySeparatorPos == (keyName.length() - 1));
auto keyValue = std::format(L"\n{}={}", keyName.substr(sectionKeySeparatorPos + 1), outputKey.value().GetValue());
configFileOutput.insert(newKeyValueInsertPos, keyValue);
outputKeyValueUpdated = true;
}
}
// parse [section] ([ is already parsed)
if (updateConfigFile)
{
@ -796,7 +800,6 @@ ValueDone:
// Trim any trailing space.
value.resize(trimmedLength);
SetConfig(keys, key.c_str(), value.c_str(), flags & CFG_DEBUG, filePath, line);
newKeyValueInsertPos = configFileOutput.length();
}
goto NewLine;

View File

@ -1,3 +1,3 @@
add_library(configfile STATIC ${SOURCES} ${HEADERS})
add_dependencies(configfile wslserviceidl localization common)
add_dependencies(configfile wslserviceidl localization)
set_target_properties(configfile PROPERTIES FOLDER common)

View File

@ -22,6 +22,18 @@ Abstract:
#define _wcsicmp wcscasecmp
#endif
#define NON_COPYABLE(Type) \
Type(const Type&) = delete; \
Type& operator=(const Type&) = delete;
#define NON_MOVABLE(Type) \
Type(Type&&) = delete; \
Type& operator=(Type&&) = delete;
#define DEFAULT_MOVABLE(Type) \
Type(Type&&) = default; \
Type& operator=(Type&&) = default;
namespace wsl::shared {
inline constexpr std::uint32_t VersionMajor = WSL_PACKAGE_VERSION_MAJOR;

View File

@ -302,6 +302,7 @@ typedef enum _LX_MESSAGE_TYPE
LxInitMessageAddVirtioFsDevice,
LxInitMessageAddVirtioFsDeviceResponse,
LxInitMessageRemountVirtioFsDevice,
LxInitMessageQueryVirtioFsDevice,
LxInitMessageStartDistroInit,
LxInitMessageCreateLoginSession,
LxInitMessageStopPlan9Server,
@ -1104,6 +1105,17 @@ typedef struct _LX_INIT_REMOUNT_VIRTIOFS_SHARE_MESSAGE
PRETTY_PRINT(FIELD(Header), FIELD(Admin), STRING_FIELD(TagOffset));
} LX_INIT_REMOUNT_VIRTIOFS_SHARE_MESSAGE, *PLX_INIT_REMOUNT_VIRTIOFS_SHARE_MESSAGE;
typedef struct _LX_INIT_QUERY_VIRTIOFS_SHARE_MESSAGE
{
static inline auto Type = LxInitMessageQueryVirtioFsDevice;
using TResponse = LX_INIT_ADD_VIRTIOFS_SHARE_RESPONSE_MESSAGE;
MESSAGE_HEADER Header;
unsigned int TagOffset;
char Buffer[];
PRETTY_PRINT(FIELD(Header), STRING_FIELD(TagOffset));
} LX_INIT_QUERY_VIRTIOFS_SHARE_MESSAGE, *PLX_INIT_QUERY_VIRTIOFS_SHARE_MESSAGE;
//
// The messages that can be sent to mini_init.
//

View File

@ -52,26 +52,6 @@ inline unsigned int CopyToSpan(const std::string_view String, const gsl::span<gs
return PreviousOffset;
}
inline bool IsDriveRoot(const std::string_view Path)
{
bool IsRoot = true;
if (Path.length() == 3)
{
IsRoot &= Path[2] == '\\';
}
if (Path.length() == 2 || Path.length() == 3)
{
IsRoot &= isalpha(Path[0]) && Path[1] == ':';
}
else
{
IsRoot = false;
}
return IsRoot;
}
template <class T>
inline bool EndsWith(const std::basic_string<T>& String, const std::basic_string_view<T> Suffix)
{

View File

@ -1,6 +1,7 @@
set(SOURCES
ConsoleProgressBar.cpp
ConsoleProgressIndicator.cpp
ConsoleState.cpp
DeviceHostProxy.cpp
disk.cpp
Distribution.cpp
@ -32,7 +33,6 @@ set(SOURCES
string.cpp
SubProcess.cpp
svccomm.cpp
svccommio.cpp
WslClient.cpp
WslCoreConfig.cpp
WslCoreFilesystem.cpp
@ -74,6 +74,7 @@ set(HEADERS
../inc/wslrelay.h
ConsoleProgressBar.h
ConsoleProgressIndicator.h
ConsoleState.h
DeviceHostProxy.h
disk.hpp
Distribution.h
@ -107,7 +108,6 @@ set(HEADERS
Stringify.h
SubProcess.h
svccomm.hpp
svccommio.hpp
WslClient.h
WslCoreConfig.h
WslCoreFilesystem.h

View File

@ -0,0 +1,168 @@
/*++
Copyright (c) Microsoft. All rights reserved.
Module Name:
ConsoleState.cpp
Abstract:
This file contains function definitions for the ConsoleState helper class.
--*/
#include "precomp.h"
#include "svccomm.hpp"
#include "ConsoleState.h"
#pragma hdrstop
namespace {
void ChangeConsoleMode(_In_ HANDLE Handle, _In_ DWORD Mode)
{
// Use the invalid parameter error code to detect the v1 console that does not support the provided mode.
// This can be improved in the future when a more elegant solution exists.
//
// N.B. Ignore failures setting the mode if the console has already disconnected.
if (!SetConsoleMode(Handle, Mode))
{
// DISABLE_NEWLINE_AUTO_RETURN is not supported everywhere, if the flag was present fall back and try again.
if (WI_IsFlagSet(Mode, DISABLE_NEWLINE_AUTO_RETURN))
{
Mode = WI_ClearFlag(Mode, DISABLE_NEWLINE_AUTO_RETURN);
if (SetConsoleMode(Handle, Mode))
{
return;
}
}
switch (GetLastError())
{
case ERROR_PIPE_NOT_CONNECTED:
break;
case ERROR_INVALID_PARAMETER:
THROW_HR_MSG(WSL_E_CONSOLE, "SetConsoleMode(0x%x) failed", Mode);
default:
THROW_LAST_ERROR_MSG("SetConsoleMode(0x%x) failed", Mode);
}
}
}
void TrySetConsoleMode(_In_ HANDLE Handle, _In_ DWORD Mode)
try
{
ChangeConsoleMode(Handle, Mode);
}
CATCH_LOG()
} // namespace
namespace wsl::windows::common {
ConsoleState::ConsoleState()
{
// Ensure console state is restored if the constructor throws.
auto cleanup = wil::scope_exit_log(WI_DIAGNOSTICS_INFO, [&]() { RestoreConsoleState(); });
m_InputHandle.reset(
CreateFileW(L"CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr));
if (m_InputHandle)
{
m_SavedInputCodePage = GetConsoleCP();
LOG_IF_WIN32_BOOL_FALSE(SetConsoleCP(CP_UTF8));
// Configure for raw input with VT support.
DWORD mode;
THROW_LAST_ERROR_IF(!GetConsoleMode(m_InputHandle.get(), &mode));
DWORD NewMode = mode;
WI_SetAllFlags(NewMode, ENABLE_WINDOW_INPUT | ENABLE_VIRTUAL_TERMINAL_INPUT);
WI_ClearAllFlags(NewMode, ENABLE_ECHO_INPUT | ENABLE_INSERT_MODE | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT);
ChangeConsoleMode(m_InputHandle.get(), NewMode);
m_SavedInputMode = mode;
}
else
{
LOG_LAST_ERROR_MSG("CreateFileW(CONIN$) failed");
}
m_OutputHandle.reset(
CreateFileW(L"CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr));
if (m_OutputHandle)
{
m_SavedOutputCodePage = GetConsoleOutputCP();
LOG_IF_WIN32_BOOL_FALSE(SetConsoleOutputCP(CP_UTF8));
// Configure for VT output.
DWORD mode;
THROW_LAST_ERROR_IF(!GetConsoleMode(m_OutputHandle.get(), &mode));
DWORD NewMode = mode;
WI_SetAllFlags(NewMode, ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING | DISABLE_NEWLINE_AUTO_RETURN);
ChangeConsoleMode(m_OutputHandle.get(), NewMode);
m_SavedOutputMode = mode;
}
else
{
LOG_LAST_ERROR_MSG("CreateFileW(CONOUT$) failed");
}
cleanup.release();
}
ConsoleState::~ConsoleState()
{
RestoreConsoleState();
}
void ConsoleState::RestoreConsoleState()
{
if (m_InputHandle)
{
if (m_SavedInputCodePage.has_value())
{
LOG_IF_WIN32_BOOL_FALSE(SetConsoleCP(m_SavedInputCodePage.value()));
}
if (m_SavedInputMode.has_value())
{
TrySetConsoleMode(m_InputHandle.get(), m_SavedInputMode.value());
}
}
if (m_OutputHandle)
{
if (m_SavedOutputCodePage.has_value())
{
LOG_IF_WIN32_BOOL_FALSE(SetConsoleOutputCP(m_SavedOutputCodePage.value()));
}
if (m_SavedOutputMode.has_value())
{
TrySetConsoleMode(m_OutputHandle.get(), m_SavedOutputMode.value());
}
}
}
COORD ConsoleState::GetWindowSize() const
{
if (m_OutputHandle)
{
CONSOLE_SCREEN_BUFFER_INFOEX Info{};
Info.cbSize = sizeof(Info);
THROW_IF_WIN32_BOOL_FALSE(GetConsoleScreenBufferInfoEx(m_OutputHandle.get(), &Info));
return {
static_cast<short>(Info.srWindow.Right - Info.srWindow.Left + 1),
static_cast<short>(Info.srWindow.Bottom - Info.srWindow.Top + 1)};
}
LOG_HR_MSG(E_UNEXPECTED, "No console handle available for GetWindowSize");
return {80, 24};
}
} // namespace wsl::windows::common

View File

@ -0,0 +1,46 @@
/*++
Copyright (c) Microsoft. All rights reserved.
Module Name:
ConsoleState.h
Abstract:
This file contains function declarations for the ConsoleState helper class.
--*/
#pragma once
#include <wil/filesystem.h>
#include <wil/result.h>
#include "wslservice.h"
namespace wsl::windows::common {
// RAII wrapper for console state configuration and restoration
class ConsoleState
{
public:
ConsoleState();
~ConsoleState();
ConsoleState(const ConsoleState&) = delete;
ConsoleState& operator=(const ConsoleState&) = delete;
ConsoleState(ConsoleState&&) = delete;
ConsoleState& operator=(ConsoleState&&) = delete;
COORD GetWindowSize() const;
private:
void RestoreConsoleState();
wil::unique_hfile m_InputHandle;
wil::unique_hfile m_OutputHandle;
std::optional<DWORD> m_SavedInputMode{};
std::optional<UINT> m_SavedInputCodePage{};
std::optional<DWORD> m_SavedOutputMode{};
std::optional<UINT> m_SavedOutputCodePage{};
};
} // namespace wsl::windows::common

View File

@ -10,10 +10,16 @@
inline const std::wstring c_defaultDeviceTag = L"default";
// These device types are implemented by the external wsldevicehost vdev.
// These device types and class IDs are implemented by the external wsldevicehost vdev.
DEFINE_GUID(VIRTIO_FS_DEVICE_ID, 0x872270E1, 0xA899, 0x4AF6, 0xB4, 0x54, 0x71, 0x93, 0x63, 0x44, 0x35, 0xAD); // {872270E1-A899-4AF6-B454-7193634435AD}
DEFINE_GUID(VIRTIO_FS_ADMIN_CLASS_ID, 0x7E6AD219, 0xD1B3, 0x42D5, 0xB8, 0xEE, 0xD9, 0x63, 0x24, 0xE6, 0x4F, 0xF6); // {7E6AD219-D1B3-42D5-B8EE-D96324E64FF6}
DEFINE_GUID(VIRTIO_FS_CLASS_ID, 0x60285AE6, 0xAAF3, 0x4456, 0xB4, 0x44, 0xA6, 0xC2, 0xD0, 0xDE, 0xDA, 0x38); // {60285AE6-AAF3-4456-B444-A6C2D0DEDA38}
DEFINE_GUID(VIRTIO_NET_DEVICE_ID, 0xF07010D0, 0x0EA9, 0x447F, 0x88, 0xEF, 0xBD, 0x95, 0x2A, 0x4D, 0x2F, 0x14); // {F07010D0-0EA9-447F-88EF-BD952A4D2F14}
DEFINE_GUID(VIRTIO_NET_CLASS_ID, 0x16479D2E, 0xF0C3, 0x4DBA, 0xBF, 0x7A, 0x04, 0xFF, 0xF0, 0x89, 0x2B, 0x07); // {16479D2E-F0C3-4DBA-BF7A-04FFF0892B07}
DEFINE_GUID(VIRTIO_PMEM_DEVICE_ID, 0xEDBB24BB, 0x5E19, 0x40F4, 0x8A, 0x0F, 0x82, 0x24, 0x31, 0x30, 0x64, 0xFD); // {EDBB24BB-5E19-40F4-8A0F-8224313064FD}
DEFINE_GUID(VIRTIO_PMEM_CLASS_ID, 0xABB755FC, 0x1B86, 0x4255, 0x83, 0xE2, 0xE5, 0x78, 0x7A, 0xBC, 0xF6, 0xC2); // {ABB755FC-1B86-4255-83E2-E5787ABCF6C2}
//
// Provides synchronized access to guest device operations.

View File

@ -26,8 +26,13 @@ static wil::srwlock g_endpointsInUseLock;
static std::vector<GUID> g_endpointsInUse;
NatNetworking::NatNetworking(
HCS_SYSTEM system, wsl::windows::common::hcs::unique_hcn_network&& network, GnsChannel&& gnsChannel, Config& config, wil::unique_socket&& dnsHvsocket) :
m_system(system), m_config(config), m_network(std::move(network)), m_gnsChannel(std::move(gnsChannel))
HCS_SYSTEM system,
wsl::windows::common::hcs::unique_hcn_network&& network,
GnsChannel&& gnsChannel,
Config& config,
wil::unique_socket&& dnsHvsocket,
LPCWSTR dnsOptions) :
m_system(system), m_config(config), m_network(std::move(network)), m_dnsOptions(dnsOptions), m_gnsChannel(std::move(gnsChannel))
{
m_connectivityTelemetryEnabled = config.EnableTelemetry && !WslTraceLoggingShouldDisableTelemetry();
@ -48,7 +53,7 @@ NatNetworking::NatNetworking(
// prioritized means:
// - can only set 3 DNS servers (Linux limitation)
// - when there are multiple host connected interfaces, we need to use the DNS servers from the most-likely-to-be-used interface on the host
m_mirrorDnsInfo.emplace();
m_useMirrorDnsSettings = true;
}
}
@ -337,7 +342,7 @@ void NatNetworking::Initialize()
UpdateDns(endpointProperties.GatewayAddress.c_str());
// if using the shared access DNS proxy, ensure that the shared access service is allowed inbound UDP access.
if (!m_mirrorDnsInfo && !m_dnsTunnelingResolver)
if (!m_useMirrorDnsSettings && !m_dnsTunnelingResolver)
{
// N.B. This rule works around a host OS issue that prevents the DNS proxy from working on older versions of Windows.
ConfigureSharedAccessFirewallRule();
@ -433,38 +438,22 @@ _Requires_lock_held_(m_lock)
void NatNetworking::UpdateDns(std::optional<PCWSTR> gatewayAddress) noexcept
try
{
if (!m_dnsTunnelingResolver && !m_mirrorDnsInfo && !gatewayAddress)
if (!m_dnsTunnelingResolver && !m_useMirrorDnsSettings && !gatewayAddress)
{
return;
}
hns::ModifyGuestEndpointSettingRequest<hns::DNS> notification{};
notification.Settings.Options = LX_INIT_RESOLVCONF_FULL_HEADER;
networking::DnsInfo latestDnsSettings{};
// true if the "domain" entry of /etc/resolv.conf should be configured
// Note: the "domain" entry allows a single DNS suffix to be configured
bool configureLinuxDomain = false;
// NAT mode with DNS tunneling
if (m_dnsTunnelingResolver)
{
latestDnsSettings = HostDnsInfo::GetDnsTunnelingSettings(m_dnsTunnelingIpAddress);
}
// NAT mode without Shared Access DNS proxy
else if (m_mirrorDnsInfo)
else if (m_useMirrorDnsSettings)
{
m_mirrorDnsInfo->UpdateNetworkInformation();
const auto settings = m_mirrorDnsInfo->GetDnsSettings(DnsSettingsFlags::IncludeVpn);
latestDnsSettings.Servers = std::move(settings.Servers);
if (!settings.Domains.empty())
{
latestDnsSettings.Domains.emplace_back(std::move(settings.Domains.front()));
configureLinuxDomain = true;
}
latestDnsSettings = HostDnsInfo::GetDnsSettings(DnsSettingsFlags::IncludeVpn);
}
// NAT mode with Shared Access DNS proxy
else if (gatewayAddress)
@ -475,28 +464,18 @@ try
if (latestDnsSettings != m_trackedDnsSettings)
{
notification.Settings.ServerList = wsl::shared::string::MultiByteToWide(wsl::shared::string::Join(latestDnsSettings.Servers, ','));
if (configureLinuxDomain)
{
WI_ASSERT(!latestDnsSettings.Domains.empty());
notification.Settings.Domain = wsl::shared::string::MultiByteToWide(latestDnsSettings.Domains.front());
}
else
{
notification.Settings.Search = wsl::shared::string::MultiByteToWide(wsl::shared::string::Join(latestDnsSettings.Domains, ','));
}
auto dnsNotification = BuildDnsNotification(latestDnsSettings, m_dnsOptions);
WSL_LOG(
"NatNetworking::UpdateDns",
TraceLoggingValue(notification.Settings.Domain.c_str(), "domain"),
TraceLoggingValue(notification.Settings.Options.c_str(), "options"),
TraceLoggingValue(notification.Settings.Search.c_str(), "search"),
TraceLoggingValue(notification.Settings.ServerList.c_str(), "serverList"));
TraceLoggingValue(dnsNotification.Options.c_str(), "options"),
TraceLoggingValue(dnsNotification.Search.c_str(), "search"),
TraceLoggingValue(dnsNotification.ServerList.c_str(), "serverList"));
hns::ModifyGuestEndpointSettingRequest<hns::DNS> notification{};
notification.RequestType = hns::ModifyRequestType::Update;
notification.ResourceType = hns::GuestEndpointResourceType::DNS;
notification.Settings = notification.Settings;
notification.Settings = std::move(dnsNotification);
m_gnsChannel.SendHnsNotification(ToJsonW(notification).c_str(), m_endpoint.Id);
m_trackedDnsSettings = std::move(latestDnsSettings);

View File

@ -18,7 +18,13 @@ namespace wsl::core {
class NatNetworking final : public INetworkingEngine
{
public:
NatNetworking(HCS_SYSTEM system, wsl::windows::common::hcs::unique_hcn_network&& network, GnsChannel&& gnsChannel, Config& config, wil::unique_socket&& dnsHvsocket);
NatNetworking(
HCS_SYSTEM system,
wsl::windows::common::hcs::unique_hcn_network&& network,
GnsChannel&& gnsChannel,
Config& config,
wil::unique_socket&& dnsHvsocket,
LPCWSTR dnsOptions = LX_INIT_RESOLVCONF_FULL_HEADER);
~NatNetworking() override;
// Note: This class cannot be moved because m_networkNotifyHandle captures a 'this' pointer.
@ -69,12 +75,18 @@ private:
// The latest DNS settings configured in Linux
_Guarded_by_(m_lock) networking::DnsInfo m_trackedDnsSettings {};
// If true, DNS settings are retrieved from host adapters (mirrored mode)
// rather than using the shared access DNS proxy
bool m_useMirrorDnsSettings = false;
// Options/header for /etc/resolv.conf
LPCWSTR m_dnsOptions = nullptr;
GnsChannel m_gnsChannel;
std::shared_ptr<networking::NetworkSettings> m_networkSettings;
networking::EphemeralHcnEndpoint m_endpoint;
ULONG m_networkMtu = 0;
std::optional<networking::HostDnsInfo> m_mirrorDnsInfo;
networking::unique_notify_handle m_networkNotifyHandle{};
};

View File

@ -92,11 +92,6 @@ void SubProcess::SetFlags(DWORD Flag)
WI_SetAllFlags(m_flags, Flag);
}
void SubProcess::SetDesktop(LPCWSTR Desktop)
{
m_desktop = Desktop;
}
void SubProcess::SetToken(HANDLE Token)
{
m_token = Token;

View File

@ -37,7 +37,6 @@ public:
void InheritHandle(HANDLE Handle);
void SetEnvironment(LPVOID Environment);
void SetWorkingDirectory(LPCWSTR Directory);
void SetDesktop(LPCWSTR Desktop);
void SetToken(HANDLE Token);
void SetShowWindow(WORD Show);
void SetFlags(DWORD Flag);

View File

@ -14,12 +14,12 @@ using wsl::core::VirtioNetworking;
static constexpr auto c_loopbackDeviceName = TEXT(LX_INIT_LOOPBACK_DEVICE_NAME);
VirtioNetworking::VirtioNetworking(
GnsChannel&& gnsChannel, bool enableLocalhostRelay, std::shared_ptr<GuestDeviceManager> guestDeviceManager, GUID classId, wil::shared_handle userToken) :
GnsChannel&& gnsChannel, bool enableLocalhostRelay, LPCWSTR dnsOptions, std::shared_ptr<GuestDeviceManager> guestDeviceManager, wil::shared_handle userToken) :
m_guestDeviceManager(std::move(guestDeviceManager)),
m_userToken(std::move(userToken)),
m_gnsChannel(std::move(gnsChannel)),
m_enableLocalhostRelay(enableLocalhostRelay),
m_virtioNetworkClsid(classId)
m_dnsOptions(dnsOptions)
{
}
@ -66,21 +66,22 @@ void VirtioNetworking::Initialize()
device_options << L"gateway_ip=" << default_route;
}
auto dns_servers = m_networkSettings->DnsServersString();
if (!dns_servers.empty())
// Get initial DNS settings for device options.
auto initialDns = networking::HostDnsInfo::GetDnsSettings(networking::DnsSettingsFlags::IncludeVpn);
if (!initialDns.Servers.empty())
{
if (device_options.tellp() > 0)
{
device_options << L";";
}
device_options << L"nameservers=" << dns_servers;
device_options << L"nameservers=" << wsl::shared::string::MultiByteToWide(wsl::shared::string::Join(initialDns.Servers, ','));
}
auto lock = m_lock.lock_exclusive();
// Add virtio net adapter to guest
m_adapterId = m_guestDeviceManager->AddGuestDevice(
VIRTIO_NET_DEVICE_ID, m_virtioNetworkClsid, L"eth0", nullptr, device_options.str().c_str(), 0, m_userToken.get());
VIRTIO_NET_DEVICE_ID, VIRTIO_NET_CLASS_ID, L"eth0", nullptr, device_options.str().c_str(), 0, m_userToken.get());
hns::HNSEndpoint endpointProperties;
endpointProperties.ID = m_adapterId;
@ -105,15 +106,9 @@ void VirtioNetworking::Initialize()
m_gnsChannel.SendHnsNotification(ToJsonW(request).c_str(), m_adapterId);
}
// Update DNS information.
if (!dns_servers.empty())
{
// TODO: DNS domain suffixes
hns::DNS dnsSettings{};
dnsSettings.Options = LX_INIT_RESOLVCONF_FULL_HEADER;
dnsSettings.ServerList = dns_servers;
UpdateDns(std::move(dnsSettings));
}
// Send the initial DNS configuration to GNS and track it.
m_trackedDnsSettings = initialDns;
SendDnsUpdate(initialDns);
if (m_enableLocalhostRelay)
{
@ -127,7 +122,7 @@ void VirtioNetworking::SetupLoopbackDevice()
{
m_localhostAdapterId = m_guestDeviceManager->AddGuestDevice(
VIRTIO_NET_DEVICE_ID,
m_virtioNetworkClsid,
VIRTIO_NET_CLASS_ID,
c_loopbackDeviceName,
nullptr,
L"client_ip=127.0.0.1;client_mac=00:11:22:33:44:55",
@ -228,7 +223,7 @@ int VirtioNetworking::ModifyOpenPorts(_In_ PCWSTR tag, _In_ const SOCKADDR_INET&
}
auto lock = m_lock.lock_exclusive();
const auto server = m_guestDeviceManager->GetRemoteFileSystem(m_virtioNetworkClsid, c_defaultDeviceTag);
const auto server = m_guestDeviceManager->GetRemoteFileSystem(VIRTIO_NET_CLASS_ID, c_defaultDeviceTag);
if (server)
{
std::wstring portString = std::format(L"tag={};port_number={}", tag, addr.Ipv4.sin_port);
@ -264,15 +259,23 @@ try
{
auto lock = m_lock.lock_exclusive();
UpdateMtu();
// Check for DNS changes and send update if needed.
auto currentDns = networking::HostDnsInfo::GetDnsSettings(networking::DnsSettingsFlags::IncludeVpn);
if (currentDns != m_trackedDnsSettings)
{
m_trackedDnsSettings = currentDns;
SendDnsUpdate(currentDns);
}
}
CATCH_LOG();
void VirtioNetworking::UpdateDns(hns::DNS&& dnsSettings)
void VirtioNetworking::SendDnsUpdate(const networking::DnsInfo& dnsSettings)
{
hns::ModifyGuestEndpointSettingRequest<hns::DNS> notification{};
notification.RequestType = hns::ModifyRequestType::Update;
notification.ResourceType = hns::GuestEndpointResourceType::DNS;
notification.Settings = std::move(dnsSettings);
notification.Settings = networking::BuildDnsNotification(dnsSettings, m_dnsOptions);
m_gnsChannel.SendHnsNotification(ToJsonW(notification).c_str(), m_adapterId);
}

View File

@ -13,7 +13,7 @@ namespace wsl::core {
class VirtioNetworking : public INetworkingEngine
{
public:
VirtioNetworking(GnsChannel&& gnsChannel, bool enableLocalhostRelay, std::shared_ptr<GuestDeviceManager> guestDeviceManager, GUID classId, wil::shared_handle userToken);
VirtioNetworking(GnsChannel&& gnsChannel, bool enableLocalhostRelay, LPCWSTR dnsOptions, std::shared_ptr<GuestDeviceManager> guestDeviceManager, wil::shared_handle userToken);
~VirtioNetworking();
// Note: This class cannot be moved because m_networkNotifyHandle captures a 'this' pointer.
@ -38,7 +38,7 @@ private:
int ModifyOpenPorts(_In_ PCWSTR tag, _In_ const SOCKADDR_INET& addr, _In_ int protocol, _In_ bool isOpen) const;
void RefreshGuestConnection(NL_NETWORK_CONNECTIVITY_HINT hint) noexcept;
void SetupLoopbackDevice();
void UpdateDns(wsl::shared::hns::DNS&& dnsSettings);
void SendDnsUpdate(const networking::DnsInfo& dnsSettings);
void UpdateMtu();
mutable wil::srwlock m_lock;
@ -49,13 +49,13 @@ private:
std::optional<GnsPortTrackerChannel> m_gnsPortTrackerChannel;
std::shared_ptr<networking::NetworkSettings> m_networkSettings;
bool m_enableLocalhostRelay;
LPCWSTR m_dnsOptions = nullptr;
GUID m_localhostAdapterId;
GUID m_adapterId;
GUID m_virtioNetworkClsid;
std::optional<ULONGLONG> m_interfaceLuid;
ULONG m_networkMtu = 0;
std::optional<wsl::core::networking::HostDnsInfo> m_dnsInfo;
networking::DnsInfo m_trackedDnsSettings;
// Note: this field must be destroyed first to stop the callbacks before any other field is destroyed.
networking::unique_notify_handle m_networkNotifyHandle;

View File

@ -1501,7 +1501,7 @@ int RunDebugShell()
THROW_IF_WIN32_BOOL_FALSE(WriteFile(pipe.get(), "\n", 1, nullptr, nullptr));
// Create a thread to relay stdin to the pipe.
wsl::windows::common::SvcCommIo Io;
wsl::windows::common::ConsoleState Io;
auto exitEvent = wil::unique_event(wil::EventOptions::ManualReset);
std::thread inputThread(
[&]() { wsl::windows::common::RelayStandardInput(GetStdHandle(STD_INPUT_HANDLE), pipe.get(), {}, exitEvent.get(), &Io); });

View File

@ -105,12 +105,6 @@ wsl::core::networking::DnsInfo wsl::core::networking::HostDnsInfo::GetDnsTunneli
return dnsInfo;
}
std::vector<wsl::core::networking::IpAdapterAddress> wsl::core::networking::HostDnsInfo::GetAdapterAddresses()
{
std::lock_guard<std::mutex> lock(m_lock);
return m_addresses;
}
std::vector<std::string> wsl::core::networking::HostDnsInfo::GetDnsServerStrings(
_In_ const PIP_ADAPTER_DNS_SERVER_ADDRESS& FirstDnsServer, _In_ USHORT IpFamilyFilter, _In_ USHORT MaxValues)
{
@ -233,7 +227,7 @@ std::vector<std::string> wsl::core::networking::HostDnsInfo::GetInterfaceDnsSuff
wsl::core::networking::DnsInfo wsl::core::networking::HostDnsInfo::GetDnsSettings(_In_ DnsSettingsFlags Flags)
{
std::vector<IpAdapterAddress> Addresses = GetAdapterAddresses();
std::vector<IpAdapterAddress> Addresses = AdapterAddresses::GetCurrent();
auto RemoveFilter = [&](const IpAdapterAddress& Address) {
// Ignore interfaces that are not currently "up".
@ -326,12 +320,6 @@ wsl::core::networking::DnsInfo wsl::core::networking::HostDnsInfo::GetDnsSetting
return DnsSettings;
}
void wsl::core::networking::HostDnsInfo::UpdateNetworkInformation()
{
std::lock_guard<std::mutex> lock(m_lock);
m_addresses = AdapterAddresses::GetCurrent();
}
std::string wsl::core::networking::GenerateResolvConf(_In_ const DnsInfo& Info)
{
std::string contents{};
@ -345,7 +333,10 @@ std::string wsl::core::networking::GenerateResolvConf(_In_ const DnsInfo& Info)
contents += c_asciiNewLine;
}
// Add domain information if it is available.
// Add DNS suffix information using 'search' directive.
// Per resolv.conf(5): "The domain directive is an obsolete name for the search directive
// that handles one search list entry only."
// See: https://man7.org/linux/man-pages/man5/resolv.conf.5.html
if (!Info.Domains.empty())
{
contents += "search ";
@ -496,3 +487,22 @@ wsl::core::networking::DnsSuffixRegistryWatcher::DnsSuffixRegistryWatcher(Regist
m_registryWatchers.swap(localRegistryWatchers);
}
wsl::shared::hns::DNS wsl::core::networking::BuildDnsNotification(const DnsInfo& settings, PCWSTR options)
{
wsl::shared::hns::DNS dnsNotification{};
if (options)
{
dnsNotification.Options = options;
}
dnsNotification.ServerList = wsl::shared::string::MultiByteToWide(wsl::shared::string::Join(settings.Servers, ','));
// Use 'search' entry for DNS suffix list.
// Per resolv.conf(5): "The domain directive is an obsolete name for the search directive
// that handles one search list entry only."
// See: https://man7.org/linux/man-pages/man5/resolv.conf.5.html
dnsNotification.Search = wsl::shared::string::MultiByteToWide(wsl::shared::string::Join(settings.Domains, ','));
return dnsNotification;
}

View File

@ -1,7 +1,6 @@
// Copyright (C) Microsoft Corporation. All rights reserved.
#pragma once
#include <mutex>
#include <string>
#include <vector>
@ -38,6 +37,14 @@ inline bool operator!=(const DnsInfo& lhs, const DnsInfo& rhs) noexcept
std::string GenerateResolvConf(_In_ const DnsInfo& Info);
/// <summary>
/// Builds an hns::DNS notification from DnsInfo settings.
/// </summary>
/// <param name="settings">The DNS settings to convert</param>
/// <param name="options">The resolv.conf header options (defaults to LX_INIT_RESOLVCONF_FULL_HEADER)</param>
/// <returns>The hns::DNS notification ready to send via GNS channel</returns>
wsl::shared::hns::DNS BuildDnsNotification(const DnsInfo& settings, PCWSTR options = LX_INIT_RESOLVCONF_FULL_HEADER);
std::vector<std::string> GetAllDnsSuffixes(const std::vector<IpAdapterAddress>& AdapterAddresses);
DWORD GetBestInterface();
@ -45,27 +52,15 @@ DWORD GetBestInterface();
class HostDnsInfo
{
public:
DnsInfo GetDnsSettings(_In_ DnsSettingsFlags Flags);
void UpdateNetworkInformation();
static DnsInfo GetDnsSettings(_In_ DnsSettingsFlags Flags);
static DnsInfo GetDnsTunnelingSettings(const std::wstring& dnsTunnelingNameserver);
const std::vector<IpAdapterAddress>& CurrentAddresses() const
{
return m_addresses;
}
private:
/// <summary>
/// Internal function to retrieve the latest copy of interface information.
/// </summary>
std::vector<IpAdapterAddress> GetAdapterAddresses();
/// <summary>
/// Internal function to retrieve interface DNS servers.
/// </summary>
std::vector<std::string> GetInterfaceDnsServers(const std::vector<IpAdapterAddress>& AdapterAddresses, _In_ DnsSettingsFlags Flags);
static std::vector<std::string> GetInterfaceDnsServers(const std::vector<IpAdapterAddress>& AdapterAddresses, _In_ DnsSettingsFlags Flags);
/// <summary>
/// Internal function to retrieve all Windows DNS suffixes.
@ -76,12 +71,6 @@ private:
/// Internal function to convert DNS server addresses into strings.
/// </summary>
static std::vector<std::string> GetDnsServerStrings(_In_ const PIP_ADAPTER_DNS_SERVER_ADDRESS& DnsServer, _In_ USHORT IpFamilyFilter, _In_ USHORT MaxValues);
/// <summary>
/// Stores latest copy of interface information.
/// </summary>
std::mutex m_lock;
_Guarded_by_(m_lock) std::vector<IpAdapterAddress> m_addresses;
};
using RegistryChangeCallback = std::function<void()>;

View File

@ -26,17 +26,13 @@ std::shared_ptr<wsl::core::networking::NetworkSettings> wsl::core::networking::G
address,
route,
properties.MacAddress,
L"unuseddevicename",
properties.InterfaceConstraint.InterfaceIndex,
properties.InterfaceConstraint.InterfaceMediaType,
properties.DNSServerList);
properties.InterfaceConstraint.InterfaceMediaType);
}
std::shared_ptr<wsl::core::networking::NetworkSettings> wsl::core::networking::GetHostEndpointSettings()
{
HostDnsInfo dnsInfo;
dnsInfo.UpdateNetworkInformation();
auto addresses = dnsInfo.CurrentAddresses();
auto addresses = AdapterAddresses::GetCurrent();
auto bestIndex = GetBestInterface();
auto bestInterfacePtr =
std::find_if(addresses.cbegin(), addresses.cend(), [&](const auto& address) { return address->IfIndex == bestIndex; });
@ -95,16 +91,6 @@ std::shared_ptr<wsl::core::networking::NetworkSettings> wsl::core::networking::G
route.NextHopString = windows::common::string::SockAddrInetToWstring(route.NextHop);
}
std::wstring dnsServerList;
for (const auto& serverAddress : dnsInfo.GetDnsSettings(DnsSettingsFlags::IncludeVpn).Servers)
{
if (!dnsServerList.empty())
{
dnsServerList += L",";
}
dnsServerList += wsl::shared::string::MultiByteToWide(serverAddress);
}
return std::shared_ptr<NetworkSettings>(new NetworkSettings(
bestInterface->NetworkGuid, address, route, macAddress, {}, bestInterface->IfIndex, bestInterface->IfType, dnsServerList));
return std::make_shared<NetworkSettings>(
bestInterface->NetworkGuid, address, route, macAddress, bestInterface->IfIndex, bestInterface->IfType);
}

View File

@ -258,33 +258,21 @@ struct NetworkSettings
{
NetworkSettings() = default;
NetworkSettings(
const GUID& interfaceGuid,
EndpointIpAddress preferredIpAddress,
EndpointRoute gateway,
std::wstring macAddress,
std::wstring deviceName,
uint32_t interfaceIndex,
uint32_t mediaType,
const std::wstring& dnsServerList) :
NetworkSettings(const GUID& interfaceGuid, EndpointIpAddress preferredIpAddress, EndpointRoute gateway, std::wstring macAddress, uint32_t interfaceIndex, uint32_t mediaType) :
InterfaceGuid(interfaceGuid),
PreferredIpAddress(std::move(preferredIpAddress)),
MacAddress(std::move(macAddress)),
DeviceName(std::move(deviceName)),
InterfaceIndex(interfaceIndex),
InterfaceType(mediaType)
{
Routes.emplace(std::move(gateway));
DnsServers = wsl::shared::string::Split(dnsServerList, L',');
}
GUID InterfaceGuid{};
EndpointIpAddress PreferredIpAddress{};
std::set<EndpointIpAddress> IpAddresses{}; // Does not include PreferredIpAddress.
std::set<EndpointRoute> Routes{};
std::vector<std::wstring> DnsServers{};
std::wstring MacAddress;
std::wstring DeviceName;
IF_INDEX InterfaceIndex = 0;
IFTYPE InterfaceType = 0;
ULONG IPv4InterfaceMtu = 0;
@ -344,11 +332,6 @@ struct NetworkSettings
});
}
std::wstring DnsServersString() const
{
return wsl::shared::string::Join(DnsServers, L',');
}
// will return ULONG_MAX if there's no configured MTU
ULONG GetEffectiveMtu() const noexcept
{
@ -386,7 +369,6 @@ std::shared_ptr<NetworkSettings> GetHostEndpointSettings();
TraceLoggingValue((settings)->PreferredIpAddress.PrefixLength, "preferredIpAddressPrefixLength"), \
TraceLoggingValue((settings)->IpAddressesString().c_str(), "ipAddresses"), \
TraceLoggingValue((settings)->RoutesString().c_str(), "routes"), \
TraceLoggingValue((settings)->DnsServersString().c_str(), "dnsServerList"), \
TraceLoggingValue((settings)->MacAddress.c_str(), "macAddress"), \
TraceLoggingValue((settings)->IPv4InterfaceMtu, "IPv4InterfaceMtu"), \
TraceLoggingValue((settings)->IPv6InterfaceMtu, "IPv6InterfaceMtu"), \

View File

@ -78,6 +78,8 @@ wsl::windows::common::hcs::unique_hcs_operation wsl::windows::common::hcs::Creat
wsl::windows::common::hcs::unique_hcs_system wsl::windows::common::hcs::CreateComputeSystem(_In_ PCWSTR Id, _In_ PCWSTR Configuration)
{
WSL_LOG_DEBUG("HcsCreateComputeSystem", TraceLoggingValue(Id, "id"), TraceLoggingValue(Configuration, "configuration"));
ExecutionContext context(Context::HCS);
const unique_hcs_operation operation = CreateOperation();
@ -86,44 +88,51 @@ wsl::windows::common::hcs::unique_hcs_system wsl::windows::common::hcs::CreateCo
wil::unique_cotaskmem_string resultDocument;
const auto result = ::HcsWaitForOperationResult(operation.get(), INFINITE, &resultDocument);
THROW_IF_FAILED_MSG(
result,
"HcsWaitForOperationResult for HcsCreateComputeSystem failed (%ls %ls - error string: %ls)",
Id,
Configuration,
resultDocument.get());
if (FAILED(result))
{
// N.B. Logging is split into two calls because the configuration and error strings can be quite long.
LOG_HR_MSG(result, "HcsCreateComputeSystem(%ls, %ls)", Id, Configuration);
THROW_HR_MSG(result, "HcsCreateComputeSystem failed (error string: %ls)", resultDocument.get());
}
return system;
}
std::vector<std::string> wsl::windows::common::hcs::GetProcessorFeatures()
const std::vector<std::string>& wsl::windows::common::hcs::GetProcessorFeatures()
{
ExecutionContext context(Context::HCS);
static std::vector<std::string> g_processorFeatures;
static std::once_flag flag;
std::call_once(flag, []() {
ExecutionContext context(Context::HCS);
wil::unique_cotaskmem_string result;
THROW_IF_FAILED(::HcsGetServiceProperties(c_processorCapabilitiesQuery, &result));
wil::unique_cotaskmem_string result;
THROW_IF_FAILED(::HcsGetServiceProperties(c_processorCapabilitiesQuery, &result));
const auto properties = wsl::shared::FromJson<ServicePropertiesResponse<PropertyResponse<ProcessorCapabilitiesInfo>>>(result.get());
const auto properties =
wsl::shared::FromJson<ServicePropertiesResponse<PropertyResponse<ProcessorCapabilitiesInfo>>>(result.get());
const auto& response = properties.PropertyResponses.at(c_processorCapabilities);
if (response.Error)
{
THROW_HR_MSG(static_cast<HRESULT>(response.Error->Error), "%hs", response.Error->ErrorMessage.c_str());
}
const auto& response = properties.PropertyResponses.at(c_processorCapabilities);
if (response.Error)
{
THROW_HR_MSG(static_cast<HRESULT>(response.Error->Error), "%hs", response.Error->ErrorMessage.c_str());
}
return response.Response.ProcessorFeatures;
g_processorFeatures = response.Response.ProcessorFeatures;
});
return g_processorFeatures;
}
wsl::shared::hns::HNSEndpoint wsl::windows::common::hcs::GetEndpointProperties(HCN_ENDPOINT Endpoint)
{
WSL_LOG_DEBUG("HcsGetEndpointProperties");
ExecutionContext context(Context::HNS);
wil::unique_cotaskmem_string propertiesString;
wil::unique_cotaskmem_string error;
{
ExecutionContext context(Context::HNS);
const auto result = HcnQueryEndpointProperties(Endpoint, nullptr, &propertiesString, &error);
THROW_IF_FAILED_MSG(result, "HcnQueryEndpointProperties %ls", error.get());
}
const auto result = HcnQueryEndpointProperties(Endpoint, nullptr, &propertiesString, &error);
THROW_IF_FAILED_MSG(result, "HcnQueryEndpointProperties %ls", error.get());
return wsl::shared::FromJson<wsl::shared::hns::HNSEndpoint>(propertiesString.get());
}
@ -137,8 +146,7 @@ GUID wsl::windows::common::hcs::GetRuntimeId(_In_ HCS_SYSTEM ComputeSystem)
wil::unique_cotaskmem_string resultDocument;
const auto result = ::HcsWaitForOperationResult(operation.get(), INFINITE, &resultDocument);
THROW_IF_FAILED_MSG(
result, "HcsWaitForOperationResult for HcsGetComputeSystemProperties failed (error string: %ls)", resultDocument.get());
THROW_IF_FAILED_MSG(result, "HcsGetComputeSystemProperties failed (error string: %ls)", resultDocument.get());
const auto properties = wsl::shared::FromJson<Properties>(resultDocument.get());
THROW_HR_IF(HCS_E_SYSTEM_NOT_FOUND, (properties.SystemType != SystemType::VirtualMachine));
@ -148,70 +156,84 @@ GUID wsl::windows::common::hcs::GetRuntimeId(_In_ HCS_SYSTEM ComputeSystem)
std::pair<uint32_t, uint32_t> wsl::windows::common::hcs::GetSchemaVersion()
{
PropertyQuery query;
query.PropertyTypes.emplace_back(PropertyType::Basic);
static std::pair<uint32_t, uint32_t> g_schemaVersion{};
static std::once_flag flag;
std::call_once(flag, []() {
ExecutionContext context(Context::HCS);
ExecutionContext context(Context::HCS);
wil::unique_cotaskmem_string result;
PropertyQuery query;
query.PropertyTypes.emplace_back(PropertyType::Basic);
wil::unique_cotaskmem_string result;
THROW_IF_FAILED(::HcsGetServiceProperties(wsl::shared::ToJsonW(query).c_str(), &result));
THROW_IF_FAILED(::HcsGetServiceProperties(wsl::shared::ToJsonW(query).c_str(), &result));
const auto properties = wsl::shared::FromJson<ServiceProperties<BasicInformation>>(result.get());
THROW_HR_IF_MSG(E_UNEXPECTED, properties.Properties.empty(), "%ls", result.get());
const auto properties = wsl::shared::FromJson<ServiceProperties<BasicInformation>>(result.get());
THROW_HR_IF_MSG(E_UNEXPECTED, properties.Properties.empty(), "%ls", result.get());
uint32_t majorVersion = 0;
uint32_t minorVersion = 0;
for (const auto& version : properties.Properties[0].SupportedSchemaVersions)
{
if (version.Major >= majorVersion)
uint32_t majorVersion = 0;
uint32_t minorVersion = 0;
for (const auto& version : properties.Properties[0].SupportedSchemaVersions)
{
if ((version.Major > majorVersion) || (version.Minor > minorVersion))
if (version.Major >= majorVersion)
{
majorVersion = version.Major;
minorVersion = version.Minor;
if ((version.Major > majorVersion) || (version.Minor > minorVersion))
{
majorVersion = version.Major;
minorVersion = version.Minor;
}
}
}
}
return {majorVersion, minorVersion};
g_schemaVersion = {majorVersion, minorVersion};
});
return g_schemaVersion;
}
void wsl::windows::common::hcs::GrantVmAccess(_In_ PCWSTR VmId, _In_ PCWSTR FilePath)
{
WSL_LOG_DEBUG("HcsGrantVmAccess", TraceLoggingValue(VmId, "vmId"), TraceLoggingValue(FilePath, "filePath"));
ExecutionContext context(Context::HCS);
THROW_IF_FAILED_MSG(::HcsGrantVmAccess(VmId, FilePath), "Path (%ws)", FilePath);
THROW_IF_FAILED_MSG(::HcsGrantVmAccess(VmId, FilePath), "HcsGrantVmAccess(%ls, %ls)", VmId, FilePath);
}
void wsl::windows::common::hcs::ModifyComputeSystem(_In_ HCS_SYSTEM ComputeSystem, _In_ PCWSTR Configuration, _In_opt_ HANDLE Identity)
{
WSL_LOG_DEBUG("HcsModifyComputeSystem", TraceLoggingValue(Configuration, "configuration"));
ExecutionContext context(Context::HCS);
const unique_hcs_operation operation = CreateOperation();
THROW_IF_FAILED_MSG(
::HcsModifyComputeSystem(ComputeSystem, operation.get(), Configuration, Identity), "HcsModifyComputeSystem (%ws)", Configuration);
::HcsModifyComputeSystem(ComputeSystem, operation.get(), Configuration, Identity), "HcsModifyComputeSystem (%ls)", Configuration);
wil::unique_cotaskmem_string resultDocument;
const auto result = ::HcsWaitForOperationResult(operation.get(), INFINITE, &resultDocument);
THROW_IF_FAILED_MSG(
result,
"HcsWaitForOperationResult for HcsModifyComputeSystem failed (%ls - error string: %ls)",
Configuration,
resultDocument.get());
if (FAILED(result))
{
// N.B. Logging is split into two calls because the configuration and error strings can be quite long.
LOG_HR_MSG(result, "HcsModifyComputeSystem(%ls)", Configuration);
THROW_HR_MSG(result, "HcsModifyComputeSystem failed (error string: %ls)", resultDocument.get());
}
}
wsl::windows::common::hcs::unique_hcs_system wsl::windows::common::hcs::OpenComputeSystem(_In_ PCWSTR Id, _In_ DWORD RequestedAccess)
{
WSL_LOG_DEBUG("HcsOpenComputeSystem", TraceLoggingValue(Id, "id"), TraceLoggingValue(RequestedAccess, "requestedAccess"));
ExecutionContext context(Context::HCS);
unique_hcs_system system;
THROW_IF_FAILED(::HcsOpenComputeSystem(Id, RequestedAccess, &system));
THROW_IF_FAILED_MSG(::HcsOpenComputeSystem(Id, RequestedAccess, &system), "HcsOpenComputeSystem(%ls)", Id);
return system;
}
void wsl::windows::common::hcs::RegisterCallback(_In_ HCS_SYSTEM ComputeSystem, _In_ HCS_EVENT_CALLBACK Callback, _In_ void* Context)
{
WSL_LOG_DEBUG("HcsSetComputeSystemCallback");
ExecutionContext context(Context::HCS);
THROW_IF_FAILED(::HcsSetComputeSystemCallback(ComputeSystem, HcsEventOptionNone, Context, Callback));
@ -227,13 +249,17 @@ void wsl::windows::common::hcs::RemoveScsiDisk(_In_ HCS_SYSTEM ComputeSystem, _I
void wsl::windows::common::hcs::RevokeVmAccess(_In_ PCWSTR VmId, _In_ PCWSTR FilePath)
{
ExecutionContext context(Context::HCS);
WSL_LOG_DEBUG("HcsRevokeVmAccess", TraceLoggingValue(VmId, "vmId"), TraceLoggingValue(FilePath, "filePath"));
THROW_IF_FAILED(::HcsRevokeVmAccess(VmId, FilePath));
ExecutionContext context(Context::HNS);
THROW_IF_FAILED_MSG(::HcsRevokeVmAccess(VmId, FilePath), "HcsRevokeVmAccess(%ls, %ls)", VmId, FilePath);
}
void wsl::windows::common::hcs::StartComputeSystem(_In_ HCS_SYSTEM ComputeSystem, _In_ LPCWSTR Configuration)
{
WSL_LOG_DEBUG("HcsStartComputeSystem", TraceLoggingValue(Configuration, "configuration"));
ExecutionContext context(Context::HCS);
const unique_hcs_operation operation = CreateOperation();
@ -241,15 +267,18 @@ void wsl::windows::common::hcs::StartComputeSystem(_In_ HCS_SYSTEM ComputeSystem
wil::unique_cotaskmem_string resultDocument;
const auto result = ::HcsWaitForOperationResult(operation.get(), INFINITE, &resultDocument);
THROW_IF_FAILED_MSG(
result,
"HcsWaitForOperationResult for HcsStartComputeSystem failed (error string: %ls, configuration: %ls)",
resultDocument.get(),
Configuration);
if (FAILED(result))
{
// N.B. Logging is split into two calls because the configuration and error strings can be quite long.
LOG_HR_MSG(result, "HcsStartComputeSystem(%ls)", Configuration);
THROW_HR_MSG(result, "HcsStartComputeSystem failed (error string: %ls)", resultDocument.get());
}
}
void wsl::windows::common::hcs::TerminateComputeSystem(_In_ HCS_SYSTEM ComputeSystem)
{
WSL_LOG_DEBUG("HcsTerminateComputeSystem");
ExecutionContext context(Context::HCS);
const unique_hcs_operation operation = CreateOperation();
@ -257,13 +286,14 @@ void wsl::windows::common::hcs::TerminateComputeSystem(_In_ HCS_SYSTEM ComputeSy
wil::unique_cotaskmem_string resultDocument;
const auto result = ::HcsWaitForOperationResult(operation.get(), INFINITE, &resultDocument);
THROW_IF_FAILED_MSG(
result, "HcsWaitForOperationResult for HcsTerminateComputeSystem failed (error string: %ls)", resultDocument.get());
THROW_IF_FAILED_MSG(result, "HcsTerminateComputeSystem failed (error string: %ls)", resultDocument.get());
}
wsl::windows::common::hcs::unique_hcn_service_callback wsl::windows::common::hcs::RegisterServiceCallback(
_In_ HCS_NOTIFICATION_CALLBACK Callback, _In_ PVOID Context)
{
WSL_LOG_DEBUG("HcsRegisterServiceCallback");
ExecutionContext context(Context::HNS);
unique_hcn_service_callback callbackHandle;
@ -275,6 +305,8 @@ wsl::windows::common::hcs::unique_hcn_service_callback wsl::windows::common::hcs
wsl::windows::common::hcs::unique_hcn_guest_network_service_callback wsl::windows::common::hcs::RegisterGuestNetworkServiceCallback(
_In_ const unique_hcn_guest_network_service& GuestNetworkService, _In_ HCS_NOTIFICATION_CALLBACK Callback, _In_ PVOID Context)
{
WSL_LOG_DEBUG("HcsRegisterGuestNetworkServiceCallback");
ExecutionContext context(Context::HNS);
unique_hcn_guest_network_service_callback callbackHandle;

View File

@ -55,7 +55,7 @@ unique_hcs_operation CreateOperation();
wsl::shared::hns::HNSEndpoint GetEndpointProperties(HCN_ENDPOINT endpoint);
std::vector<std::string> GetProcessorFeatures();
const std::vector<std::string>& GetProcessorFeatures();
GUID GetRuntimeId(_In_ HCS_SYSTEM ComputeSystem);

View File

@ -435,7 +435,7 @@ inline void to_json(nlohmann::json& j, const Chipset& chipset)
struct Scsi
{
std::map<std::string, EmptyObject> Attachments;
std::map<std::string, Attachment> Attachments;
NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE(Scsi, Attachments);
};

View File

@ -178,6 +178,11 @@ private:
launcher.AddOption(wslrelay::disable_telemetry_option);
}
if (WI_IsFlagSet(Flags, LaunchWslRelayFlags::ConnectPipe))
{
launcher.AddOption(wslrelay::connect_pipe_option);
}
return launcher.Launch(UserToken, WI_IsFlagSet(Flags, LaunchWslRelayFlags::HideWindow));
}
} // namespace
@ -501,11 +506,10 @@ bool wsl::windows::common::helpers::IsWslSupportInterfacePresent()
void wsl::windows::common::helpers::LaunchDebugConsole(
_In_ LPCWSTR PipeName, _In_ bool ConnectExistingPipe, _In_ HANDLE UserToken, _In_opt_ HANDLE LogFile, _In_ bool DisableTelemetry)
{
wslrelay::RelayMode relayMode;
LaunchWslRelayFlags flags{};
wil::unique_hfile pipe;
if (ConnectExistingPipe)
{
relayMode = wslrelay::RelayMode::DebugConsoleRelay;
// Connect to an existing pipe. The connection should be:
// Asynchronous (FILE_FLAG_OVERLAPPED)
// Anonymous (SECURITY_SQOS_PRESENT | SECURITY_ANONYMOUS)
@ -515,21 +519,20 @@ void wsl::windows::common::helpers::LaunchDebugConsole(
}
else
{
relayMode = wslrelay::RelayMode::DebugConsole;
// Create a new pipe server. The pipe should be:
// Create a new pipe server the child process will connect to. The pipe should be:
// Bi-directional: PIPE_ACCESS_DUPLEX
// Asynchronous: FILE_FLAG_OVERLAPPED
// Raw: PIPE_TYPE_BYTE | PIPE_READMODE_BYTE
// Blocking: PIPE_WAIT
WI_SetFlag(flags, LaunchWslRelayFlags::ConnectPipe);
pipe.reset(CreateNamedPipeW(
PipeName, (PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED), (PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT), 1, LX_RELAY_BUFFER_SIZE, LX_RELAY_BUFFER_SIZE, 0, nullptr));
}
THROW_LAST_ERROR_IF(!pipe);
LaunchWslRelayFlags flags{};
WI_SetFlagIf(flags, LaunchWslRelayFlags::DisableTelemetry, DisableTelemetry);
wil::unique_handle info{LaunchWslRelay(relayMode, LogFile, nullptr, pipe.get(), {}, nullptr, UserToken, flags)};
wil::unique_handle info{LaunchWslRelay(wslrelay::RelayMode::DebugConsole, LogFile, nullptr, pipe.get(), {}, nullptr, UserToken, flags)};
}
[[nodiscard]] wil::unique_handle wsl::windows::common::helpers::LaunchInteropServer(
@ -550,7 +553,7 @@ void wsl::windows::common::helpers::LaunchKdRelay(_In_ LPCWSTR PipeName, _In_ HA
THROW_LAST_ERROR_IF(!pipe);
LaunchWslRelayFlags flags{};
LaunchWslRelayFlags flags = LaunchWslRelayFlags::ConnectPipe;
WI_SetFlagIf(flags, LaunchWslRelayFlags::DisableTelemetry, DisableTelemetry);
wil::unique_handle info{LaunchWslRelay(wslrelay::RelayMode::KdRelay, nullptr, nullptr, pipe.get(), Port, ExitEvent, UserToken, flags)};
}

View File

@ -62,7 +62,8 @@ enum class LaunchWslRelayFlags
{
None = 0,
DisableTelemetry = 1,
HideWindow = 2
HideWindow = 2,
ConnectPipe = 4
};
DEFINE_ENUM_FLAG_OPERATORS(LaunchWslRelayFlags);

View File

@ -39,11 +39,14 @@ void InitializeWildcardSocketAddress(_Out_ PSOCKADDR_HV Address)
}
} // namespace
wil::unique_socket wsl::windows::common::hvsocket::Accept(
_In_ SOCKET ListenSocket, _In_ int Timeout, _In_opt_ HANDLE ExitHandle, _In_ const std::source_location& Location)
std::optional<wil::unique_socket> wsl::windows::common::hvsocket::CancellableAccept(
_In_ SOCKET ListenSocket, _In_ DWORD Timeout, _In_opt_ HANDLE ExitHandle, _In_ const std::source_location& Location)
{
wil::unique_socket Socket = Create();
wsl::windows::common::socket::Accept(ListenSocket, Socket.get(), Timeout, ExitHandle, Location);
if (!socket::CancellableAccept(ListenSocket, Socket.get(), Timeout, ExitHandle, Location))
{
return {};
}
return Socket;
}

View File

@ -19,9 +19,9 @@ Abstract:
namespace wsl::windows::common::hvsocket {
wil::unique_socket Accept(
std::optional<wil::unique_socket> CancellableAccept(
_In_ SOCKET ListenSocket,
_In_ int Timeout,
_In_ DWORD Timeout,
_In_opt_ HANDLE ExitHandle = nullptr,
const std::source_location& Location = std::source_location::current());

View File

@ -195,7 +195,6 @@ CreateProcessResult CreateProcess(_In_ CreateProcessParsed* Parsed, _In_ HANDLE
wsl::windows::common::helpers::SetHandleInheritable(StdErr);
wsl::windows::common::SubProcess process(Parsed->ApplicationName.c_str(), Parsed->CommandLine(), CREATE_UNICODE_ENVIRONMENT);
process.SetDesktop(L"winsta0\\default");
CreateProcessResult Result{};
if (Parsed->CreatePseudoconsole)

View File

@ -86,8 +86,8 @@ try
</binding>
</visual>
<actions>
<action arguments='--{}' content='{}'/>
<action arguments='--{}' content='{}'/>
<action arguments='{}' content='{}'/>
<action arguments='{}' content='{}'/>
</actions>
</toast>)",
Localization::MessageNewWslVersionAvailable(Localization::Options::DontImpersonate),
@ -118,8 +118,8 @@ try
</binding>
</visual>
<actions>
<action arguments='--{} {}' content='{}'/>
<action arguments='--{} {}' content="{}"/>
<action arguments='{} {}' content='{}'/>
<action arguments='{} {}' content="{}"/>
</actions>
</toast>)",
Localization::MessagePerformanceTip(Localization::Options::DontImpersonate),
@ -151,7 +151,7 @@ try
</binding>
</visual>
<actions>
<action arguments='--{}' content='{}'/>
<action arguments='{}' content='{}'/>
</actions>
</toast>)",
Localization::MessageWarningDuringStartup(),
@ -176,7 +176,7 @@ try
</binding>
</visual>
<actions>
<action arguments='--{}' content='{}'/>
<action arguments='{}' content='{}'/>
</actions>
</toast>)",
Localization::MessageMissingOptionalComponents(),

View File

@ -160,7 +160,7 @@ Abstract:
#include "LxssDynamicFunction.h"
#include "relay.hpp"
#include "svccomm.hpp"
#include "svccommio.hpp"
#include "ConsoleState.h"
#include "disk.hpp"
#include "WslSecurity.h"
#include "ExecutionContext.h"

View File

@ -16,8 +16,14 @@ Abstract:
#include "relay.hpp"
#pragma hdrstop
using wsl::windows::common::relay::EventHandle;
using wsl::windows::common::relay::HandleWrapper;
using wsl::windows::common::relay::IOHandleStatus;
using wsl::windows::common::relay::MultiHandleWait;
using wsl::windows::common::relay::OverlappedIOHandle;
using wsl::windows::common::relay::ScopedMultiRelay;
using wsl::windows::common::relay::ScopedRelay;
using wsl::windows::common::relay::SingleAcceptHandle;
namespace {
@ -108,7 +114,7 @@ wsl::windows::common::relay::InterruptableRead(
return 0;
}
THROW_LAST_ERROR_IF(lastError != ERROR_IO_PENDING);
THROW_LAST_ERROR_IF_MSG(lastError != ERROR_IO_PENDING, "Handle: 0x%p", (void*)InputHandle);
auto cancelRead = wil::scope_exit_log(WI_DIAGNOSTICS_INFO, [&] {
CancelIoEx(InputHandle, Overlapped);
@ -569,4 +575,215 @@ try
}
}
}
CATCH_LOG()
CATCH_LOG()
void MultiHandleWait::AddHandle(std::unique_ptr<OverlappedIOHandle>&& handle, Flags flags)
{
m_handles.emplace_back(flags, std::move(handle));
}
void MultiHandleWait::Cancel()
{
m_cancel = true;
}
bool MultiHandleWait::Run(std::optional<std::chrono::milliseconds> Timeout)
{
m_cancel = false; // Run may be called multiple times.
std::optional<std::chrono::steady_clock::time_point> deadline;
if (Timeout.has_value())
{
deadline = std::chrono::steady_clock::now() + Timeout.value();
}
// Run until all handles are completed.
while (!m_handles.empty() && !m_cancel)
{
// Schedule IO on each handle until all are either pending, or completed.
for (size_t i = 0; i < m_handles.size(); i++)
{
while (m_handles[i].second->GetState() == IOHandleStatus::Standby)
{
try
{
m_handles[i].second->Schedule();
}
catch (...)
{
if (WI_IsFlagSet(m_handles[i].first, Flags::IgnoreErrors))
{
m_handles[i].second.reset(); // Reset the handle so it can be deleted.
}
else
{
throw;
}
}
}
}
// Remove completed handles from m_handles.
for (auto it = m_handles.begin(); it != m_handles.end();)
{
if (!it->second)
{
it = m_handles.erase(it);
}
else if (it->second->GetState() == IOHandleStatus::Completed)
{
if (WI_IsFlagSet(it->first, Flags::CancelOnCompleted))
{
m_cancel = true; // Cancel the IO if a handle with CancelOnCompleted is in the completed state.
}
it = m_handles.erase(it);
}
else
{
++it;
}
}
if (m_handles.empty() || m_cancel)
{
break;
}
// Wait for the next operation to complete.
std::vector<HANDLE> waitHandles;
for (const auto& e : m_handles)
{
waitHandles.emplace_back(e.second->GetHandle());
}
DWORD waitTimeout = INFINITE;
if (deadline.has_value())
{
auto miliseconds =
std::chrono::duration_cast<std::chrono::milliseconds>(deadline.value() - std::chrono::steady_clock::now()).count();
waitTimeout = static_cast<DWORD>(std::max(0LL, miliseconds));
}
auto result = WaitForMultipleObjects(static_cast<DWORD>(waitHandles.size()), waitHandles.data(), false, waitTimeout);
if (result == WAIT_TIMEOUT)
{
THROW_WIN32(ERROR_TIMEOUT);
}
else if (result >= WAIT_OBJECT_0 && result < WAIT_OBJECT_0 + m_handles.size())
{
auto index = result - WAIT_OBJECT_0;
try
{
m_handles[index].second->Collect();
}
catch (...)
{
if (WI_IsFlagSet(m_handles[index].first, Flags::IgnoreErrors))
{
m_handles.erase(m_handles.begin() + index);
}
else
{
throw;
}
}
}
else
{
THROW_LAST_ERROR_MSG("Timeout: %lu, Count: %llu", waitTimeout, waitHandles.size());
}
}
return !m_cancel;
}
IOHandleStatus OverlappedIOHandle::GetState() const
{
return State;
}
EventHandle::EventHandle(HandleWrapper&& Handle, std::function<void()>&& OnSignalled) :
Handle(std::move(Handle)), OnSignalled(std::move(OnSignalled))
{
}
void EventHandle::Schedule()
{
State = IOHandleStatus::Pending;
}
void EventHandle::Collect()
{
State = IOHandleStatus::Completed;
OnSignalled();
}
HANDLE EventHandle::GetHandle() const
{
return Handle.Get();
}
SingleAcceptHandle::SingleAcceptHandle(HandleWrapper&& ListenSocket, HandleWrapper&& AcceptedSocket, std::function<void()>&& OnAccepted) :
ListenSocket(std::move(ListenSocket)), AcceptedSocket(std::move(AcceptedSocket)), OnAccepted(std::move(OnAccepted))
{
Overlapped.hEvent = Event.get();
}
SingleAcceptHandle::~SingleAcceptHandle()
{
if (State == IOHandleStatus::Pending)
{
LOG_IF_WIN32_BOOL_FALSE(CancelIoEx(ListenSocket.Get(), &Overlapped));
DWORD bytesProcessed{};
DWORD flagsReturned{};
if (!WSAGetOverlappedResult((SOCKET)ListenSocket.Get(), &Overlapped, &bytesProcessed, TRUE, &flagsReturned))
{
auto error = GetLastError();
LOG_LAST_ERROR_IF(error != ERROR_CONNECTION_ABORTED && error != ERROR_OPERATION_ABORTED);
}
}
}
void SingleAcceptHandle::Schedule()
{
WI_ASSERT(State == IOHandleStatus::Standby);
// Schedule the accept.
DWORD bytesReturned{};
if (AcceptEx((SOCKET)ListenSocket.Get(), (SOCKET)AcceptedSocket.Get(), &AcceptBuffer, 0, sizeof(SOCKADDR_STORAGE), sizeof(SOCKADDR_STORAGE), &bytesReturned, &Overlapped))
{
// Accept completed immediately.
State = IOHandleStatus::Completed;
OnAccepted();
}
else
{
auto error = WSAGetLastError();
THROW_HR_IF_MSG(HRESULT_FROM_WIN32(error), error != ERROR_IO_PENDING, "Handle: 0x%p", (void*)ListenSocket.Get());
State = IOHandleStatus::Pending;
}
}
void SingleAcceptHandle::Collect()
{
WI_ASSERT(State == IOHandleStatus::Pending);
DWORD bytesReceived{};
DWORD flagsReturned{};
THROW_IF_WIN32_BOOL_FALSE(WSAGetOverlappedResult((SOCKET)ListenSocket.Get(), &Overlapped, &bytesReceived, false, &flagsReturned));
State = IOHandleStatus::Completed;
OnAccepted();
}
HANDLE SingleAcceptHandle::GetHandle() const
{
return Event.get();
}

View File

@ -15,7 +15,7 @@ Abstract:
#pragma once
#include <winsock2.h>
#include "svccommio.hpp"
#include "ConsoleState.h"
#define LX_RELAY_BUFFER_SIZE 0x1000
@ -150,4 +150,156 @@ private:
std::function<void()> m_onDestroy;
};
enum class IOHandleStatus
{
Standby,
Pending,
Completed
};
struct HandleWrapper
{
DEFAULT_MOVABLE(HandleWrapper);
NON_COPYABLE(HandleWrapper)
HandleWrapper(
wil::unique_handle&& handle, std::function<void()>&& OnClose = []() {}) :
Handle(handle.get()), OwnedHandle(std::move(handle)), OnClose(std::move(OnClose))
{
}
HandleWrapper(
wil::unique_socket&& handle, std::function<void()>&& OnClose = []() {}) :
Handle((HANDLE)handle.get()), OwnedHandle(wil::unique_socket{handle.release()}), OnClose(std::move(OnClose))
{
}
HandleWrapper(
wil::unique_event&& handle, std::function<void()>&& OnClose = []() {}) :
Handle(handle.get()), OwnedHandle(wil::unique_handle{handle.release()}), OnClose(std::move(OnClose))
{
}
HandleWrapper(
SOCKET handle, std::function<void()>&& OnClose = []() {}) :
Handle(reinterpret_cast<HANDLE>(handle)), OnClose(std::move(OnClose))
{
}
HandleWrapper(HANDLE handle, std::function<void()>&& OnClose = []() {}) : Handle(handle), OnClose(std::move(OnClose))
{
}
HandleWrapper(
wil::unique_hfile&& handle, std::function<void()>&& OnClose = []() {}) :
Handle(handle.get()), OwnedHandle(wil::unique_handle{handle.release()}), OnClose(std::move(OnClose))
{
}
~HandleWrapper()
{
Reset();
}
HANDLE Get() const
{
return Handle;
}
void Reset()
{
if (OnClose != nullptr)
{
OnClose();
OnClose = nullptr;
}
OwnedHandle = {};
Handle = nullptr;
}
private:
HANDLE Handle{};
std::variant<wil::unique_handle, wil::unique_socket> OwnedHandle;
std::function<void()> OnClose;
};
class OverlappedIOHandle
{
public:
NON_COPYABLE(OverlappedIOHandle)
NON_MOVABLE(OverlappedIOHandle)
OverlappedIOHandle() = default;
virtual ~OverlappedIOHandle() = default;
virtual void Schedule() = 0;
virtual void Collect() = 0;
virtual HANDLE GetHandle() const = 0;
IOHandleStatus GetState() const;
protected:
IOHandleStatus State = IOHandleStatus::Standby;
};
class EventHandle : public OverlappedIOHandle
{
public:
NON_COPYABLE(EventHandle)
NON_MOVABLE(EventHandle)
EventHandle(HandleWrapper&& Handle, std::function<void()>&& OnSignalled = []() {});
void Schedule() override;
void Collect() override;
HANDLE GetHandle() const override;
private:
HandleWrapper Handle;
std::function<void()> OnSignalled;
};
class SingleAcceptHandle : public OverlappedIOHandle
{
public:
NON_COPYABLE(SingleAcceptHandle)
NON_MOVABLE(SingleAcceptHandle)
SingleAcceptHandle(HandleWrapper&& ListenSocket, HandleWrapper&& AcceptedSocket, std::function<void()>&& OnAccepted);
~SingleAcceptHandle();
void Schedule() override;
void Collect() override;
HANDLE GetHandle() const override;
private:
HandleWrapper ListenSocket;
HandleWrapper AcceptedSocket;
wil::unique_event Event{wil::EventOptions::ManualReset};
OVERLAPPED Overlapped{};
std::function<void()> OnAccepted;
char AcceptBuffer[2 * sizeof(SOCKADDR_STORAGE)];
};
class MultiHandleWait
{
public:
enum Flags
{
None = 0,
CancelOnCompleted = 1,
IgnoreErrors = 2
};
MultiHandleWait() = default;
void AddHandle(std::unique_ptr<OverlappedIOHandle>&& handle, Flags flags = Flags::None);
bool Run(std::optional<std::chrono::milliseconds> Timeout);
void Cancel();
private:
std::vector<std::pair<Flags, std::unique_ptr<OverlappedIOHandle>>> m_handles;
bool m_cancel = false;
};
DEFINE_ENUM_FLAG_OPERATORS(MultiHandleWait::Flags);
} // namespace wsl::windows::common::relay

View File

@ -17,20 +17,25 @@ Abstract:
#include "socket.hpp"
#pragma hdrstop
void wsl::windows::common::socket::Accept(
_In_ SOCKET ListenSocket, _In_ SOCKET Socket, _In_ int Timeout, _In_opt_ HANDLE ExitHandle, _In_ const std::source_location& Location)
bool wsl::windows::common::socket::CancellableAccept(
_In_ SOCKET ListenSocket, _In_ SOCKET Socket, _In_ DWORD Timeout, _In_opt_ HANDLE ExitHandle, _In_ const std::source_location& Location)
{
CHAR AcceptBuffer[2 * sizeof(SOCKADDR_STORAGE)]{};
DWORD BytesReturned;
OVERLAPPED Overlapped{};
const wil::unique_event OverlappedEvent(wil::EventOptions::ManualReset);
Overlapped.hEvent = OverlappedEvent.get();
const BOOL Success =
AcceptEx(ListenSocket, Socket, AcceptBuffer, 0, sizeof(SOCKADDR_STORAGE), sizeof(SOCKADDR_STORAGE), &BytesReturned, &Overlapped);
relay::MultiHandleWait io;
if (!Success)
bool accepted = false;
io.AddHandle(std::make_unique<relay::SingleAcceptHandle>(ListenSocket, Socket, [&]() { accepted = true; }), relay::MultiHandleWait::CancelOnCompleted);
if (ExitHandle != nullptr)
{
GetResult(ListenSocket, Overlapped, Timeout, ExitHandle, Location);
io.AddHandle(std::make_unique<relay::EventHandle>(ExitHandle), relay::MultiHandleWait::CancelOnCompleted);
}
io.Run(std::chrono::milliseconds(Timeout));
if (!accepted)
{
return false; // Accept was cancelled by the exit event.
}
// Set the accept context to mark the socket as connected.
@ -39,7 +44,7 @@ void wsl::windows::common::socket::Accept(
"From: %hs",
std::format("{}", Location).c_str());
return;
return true;
}
std::pair<DWORD, DWORD> wsl::windows::common::socket::GetResult(

View File

@ -18,10 +18,10 @@ Abstract:
namespace wsl::windows::common::socket {
void Accept(
bool CancellableAccept(
_In_ SOCKET ListenSocket,
_In_ SOCKET Socket,
_In_ int Timeout,
_In_ DWORD Timeout,
_In_opt_ HANDLE ExitHandle,
_In_ const std::source_location& Location = std::source_location::current());

View File

@ -216,7 +216,7 @@ void wsl::windows::common::RelayStandardInput(
HANDLE OutputHandle,
const std::shared_ptr<wsl::shared::SocketChannel>& ControlChannel,
HANDLE ExitEvent,
wsl::windows::common::SvcCommIo* Io)
wsl::windows::common::ConsoleState* Io)
try
{
if (GetFileType(ConsoleHandle) != FILE_TYPE_CHAR)
@ -666,8 +666,7 @@ wsl::windows::common::SvcComm::LaunchProcess(
// Create the process.
//
SvcCommIo Io;
PLXSS_STD_HANDLES StdHandles = Io.GetStdHandles();
ConsoleState Io;
COORD WindowSize = Io.GetWindowSize();
ULONG Flags = LXSS_CREATE_INSTANCE_FLAGS_ALLOW_FS_UPGRADE;
if (WI_IsFlagSet(LaunchFlags, LXSS_LAUNCH_FLAG_USE_SYSTEM_DISTRO))
@ -684,6 +683,20 @@ wsl::windows::common::SvcComm::LaunchProcess(
// See: https://github.com/microsoft/terminal/blob/ec434e3fba2a6ef254123e31f5257c25b04f2547/src/tools/ConsoleBench/conhost.cpp#L159-L164
HANDLE console = NtCurrentTeb()->ProcessEnvironmentBlock->ProcessParameters->Reserved2[0];
LXSS_STD_HANDLES StdHandles{};
const HANDLE InputHandle = GetStdHandle(STD_INPUT_HANDLE);
const bool IsConsoleInput = wsl::windows::common::wslutil::IsConsoleHandle(InputHandle);
StdHandles.StdIn.HandleType = IsConsoleInput ? LxssHandleConsole : LxssHandleInput;
StdHandles.StdIn.Handle = IsConsoleInput ? LXSS_HANDLE_USE_CONSOLE : HandleToUlong(InputHandle);
const HANDLE OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
const bool IsConsoleOutput = wsl::windows::common::wslutil::IsConsoleHandle(OutputHandle);
StdHandles.StdOut.HandleType = IsConsoleOutput ? LxssHandleConsole : LxssHandleOutput;
StdHandles.StdOut.Handle = IsConsoleOutput ? LXSS_HANDLE_USE_CONSOLE : HandleToUlong(OutputHandle);
const HANDLE ErrorHandle = GetStdHandle(STD_ERROR_HANDLE);
const bool IsConsoleError = wsl::windows::common::wslutil::IsConsoleHandle(ErrorHandle);
StdHandles.StdErr.HandleType = IsConsoleError ? LxssHandleConsole : LxssHandleOutput;
StdHandles.StdErr.Handle = IsConsoleError ? LXSS_HANDLE_USE_CONSOLE : HandleToUlong(ErrorHandle);
GUID DistributionId;
GUID InstanceId;
wil::unique_handle ProcessHandle;
@ -712,7 +725,7 @@ wsl::windows::common::SvcComm::LaunchProcess(
WindowSize.X,
WindowSize.Y,
HandleToUlong(console),
StdHandles,
&StdHandles,
Flags,
&DistributionId,
&InstanceId,

View File

@ -21,7 +21,7 @@ Abstract:
namespace wsl::windows::common {
void RelayStandardInput(HANDLE ConsoleHandle, HANDLE OutputHandle, const std::shared_ptr<wsl::shared::SocketChannel>& ControlChannel, HANDLE ExitEvent, SvcCommIo* Io);
void RelayStandardInput(HANDLE ConsoleHandle, HANDLE OutputHandle, const std::shared_ptr<wsl::shared::SocketChannel>& ControlChannel, HANDLE ExitEvent, ConsoleState* Io);
class SvcComm
{

View File

@ -1,282 +0,0 @@
/*++
Copyright (c) Microsoft. All rights reserved.
Module Name:
svccommio.cpp
Abstract:
This file contains function definitions for the SvcCommIo helper class.
--*/
#include "precomp.h"
#include "svccomm.hpp"
#include "svccommio.hpp"
#pragma hdrstop
namespace {
void ChangeConsoleMode(_In_ HANDLE File, _In_ DWORD ConsoleMode)
{
//
// Use the invalid parameter error code to detect the v1 console that does
// not support the provided mode. This can be improved in the future when
// a more elegant solution exists.
//
// N.B. Ignore failures setting the mode if the console has already
// disconnected.
//
if (!SetConsoleMode(File, ConsoleMode))
{
switch (GetLastError())
{
case ERROR_INVALID_PARAMETER:
THROW_HR(WSL_E_CONSOLE);
case ERROR_PIPE_NOT_CONNECTED:
break;
default:
THROW_LAST_ERROR();
}
}
}
void ConfigureStdHandles(_Inout_ LXSS_STD_HANDLES_INFO& StdHandlesInfo)
{
//
// Check stdin to see if it is a console or another device. If it is
// a console, configure it to raw processing mode and VT-100 support. If the
// force console I/O is requested, ignore stdin and get active console input
// handle instead.
//
UINT NewConsoleInputCP = 0;
DWORD NewConsoleInputMode = 0;
BOOLEAN IsConsoleInput = StdHandlesInfo.IsConsoleInput;
BOOLEAN IsConsoleOutput = StdHandlesInfo.IsConsoleOutput;
BOOLEAN IsConsoleError = StdHandlesInfo.IsConsoleError;
DWORD SavedInputMode = StdHandlesInfo.SavedInputMode;
DWORD SavedOutputMode = StdHandlesInfo.SavedOutputMode;
UINT SavedInputCP = StdHandlesInfo.SavedInputCP;
UINT SavedOutputCP = StdHandlesInfo.SavedOutputCP;
CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo;
auto RestoreInputHandle = wil::scope_exit_log(WI_DIAGNOSTICS_INFO, [&] {
if (NewConsoleInputCP != 0)
{
SetConsoleCP(SavedInputCP);
}
if (NewConsoleInputMode != 0)
{
ChangeConsoleMode(StdHandlesInfo.InputHandle, SavedInputMode);
}
});
IsConsoleInput = FALSE;
if ((GetFileType(StdHandlesInfo.InputHandle) == FILE_TYPE_CHAR) && (GetConsoleMode(StdHandlesInfo.InputHandle, &SavedInputMode)))
{
IsConsoleInput = TRUE;
NewConsoleInputMode = SavedInputMode;
WI_SetAllFlags(NewConsoleInputMode, (ENABLE_WINDOW_INPUT | ENABLE_VIRTUAL_TERMINAL_INPUT));
WI_ClearAllFlags(NewConsoleInputMode, (ENABLE_ECHO_INPUT | ENABLE_INSERT_MODE | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT));
ChangeConsoleMode(StdHandlesInfo.InputHandle, NewConsoleInputMode);
//
// Set the console input to the UTF-8 code page.
//
SavedInputCP = GetConsoleCP();
NewConsoleInputCP = CP_UTF8;
THROW_LAST_ERROR_IF(!::SetConsoleCP(NewConsoleInputCP));
}
bool RestoreMode = false;
bool RestoreCp = false;
auto RestoreOutput = wil::scope_exit([&] {
if (RestoreMode)
{
SetConsoleMode(StdHandlesInfo.ConsoleOutputHandle.get(), SavedOutputMode);
}
if (RestoreCp)
{
SetConsoleOutputCP(SavedOutputCP);
}
});
//
// If there is a console output handle, save the output mode and codepage so
// it can be restored.
//
if (StdHandlesInfo.ConsoleOutputHandle)
{
THROW_LAST_ERROR_IF(!::GetConsoleMode(StdHandlesInfo.ConsoleOutputHandle.get(), &SavedOutputMode));
//
// Temporarily try both with and without the custom flag to disable newline
// auto return.
//
DWORD NewConsoleOutputMode = SavedOutputMode | ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING | DISABLE_NEWLINE_AUTO_RETURN;
if (SetConsoleMode(StdHandlesInfo.ConsoleOutputHandle.get(), NewConsoleOutputMode) == FALSE)
{
WI_ClearFlag(NewConsoleOutputMode, DISABLE_NEWLINE_AUTO_RETURN);
ChangeConsoleMode(StdHandlesInfo.ConsoleOutputHandle.get(), NewConsoleOutputMode);
}
RestoreMode = true;
//
// Set the console output to the UTF-8 code page.
//
SavedOutputCP = GetConsoleOutputCP();
THROW_LAST_ERROR_IF(!::SetConsoleOutputCP(CP_UTF8));
RestoreCp = true;
}
//
// If the force console I/O is requested, ignore stdout and treat the
// console as the output handle.
//
IsConsoleOutput = FALSE;
if ((GetFileType(StdHandlesInfo.OutputHandle) == FILE_TYPE_CHAR) &&
(GetConsoleScreenBufferInfo(StdHandlesInfo.OutputHandle, &ScreenBufferInfo)))
{
IsConsoleOutput = TRUE;
}
IsConsoleError = FALSE;
if ((GetFileType(StdHandlesInfo.ErrorHandle) == FILE_TYPE_CHAR) &&
(GetConsoleScreenBufferInfo(StdHandlesInfo.ErrorHandle, &ScreenBufferInfo)))
{
IsConsoleError = TRUE;
}
RestoreInputHandle.release();
RestoreOutput.release();
StdHandlesInfo.IsConsoleInput = IsConsoleInput;
StdHandlesInfo.IsConsoleOutput = IsConsoleOutput;
StdHandlesInfo.IsConsoleError = IsConsoleError;
StdHandlesInfo.SavedInputMode = SavedInputMode;
StdHandlesInfo.SavedOutputMode = SavedOutputMode;
StdHandlesInfo.SavedInputCP = SavedInputCP;
StdHandlesInfo.SavedOutputCP = SavedOutputCP;
}
} // namespace
wsl::windows::common::SvcCommIo::SvcCommIo()
{
_stdHandlesInfo.InputHandle = GetStdHandle(STD_INPUT_HANDLE);
_stdHandlesInfo.OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
_stdHandlesInfo.ErrorHandle = GetStdHandle(STD_ERROR_HANDLE);
_stdHandlesInfo.ConsoleOutputHandle.reset(
CreateFileW(L"CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr));
ConfigureStdHandles(_stdHandlesInfo);
_stdHandles.StdIn.HandleType = LxssHandleInput;
_stdHandles.StdIn.Handle = HandleToUlong(_stdHandlesInfo.InputHandle);
_stdHandles.StdOut.HandleType = LxssHandleOutput;
_stdHandles.StdOut.Handle = HandleToUlong(_stdHandlesInfo.OutputHandle);
_stdHandles.StdErr.HandleType = LxssHandleOutput;
_stdHandles.StdErr.Handle = HandleToUlong(_stdHandlesInfo.ErrorHandle);
//
// N.B.: The console handle is not supposed to be closed, it is just copied
// from PEB.
//
if (_stdHandlesInfo.IsConsoleInput)
{
_stdHandles.StdIn.Handle = LXSS_HANDLE_USE_CONSOLE;
_stdHandles.StdIn.HandleType = LxssHandleConsole;
}
if (_stdHandlesInfo.IsConsoleOutput)
{
_stdHandles.StdOut.Handle = LXSS_HANDLE_USE_CONSOLE;
_stdHandles.StdOut.HandleType = LxssHandleConsole;
}
if (_stdHandlesInfo.IsConsoleError)
{
_stdHandles.StdErr.Handle = LXSS_HANDLE_USE_CONSOLE;
_stdHandles.StdErr.HandleType = LxssHandleConsole;
}
}
wsl::windows::common::SvcCommIo::~SvcCommIo()
{
try
{
RestoreConsoleMode();
}
CATCH_LOG()
}
PLXSS_STD_HANDLES
wsl::windows::common::SvcCommIo::GetStdHandles()
{
return &_stdHandles;
}
COORD
wsl::windows::common::SvcCommIo::GetWindowSize() const
{
CONSOLE_SCREEN_BUFFER_INFOEX Info{};
Info.cbSize = sizeof(Info);
if (_stdHandlesInfo.IsConsoleOutput)
{
THROW_IF_WIN32_BOOL_FALSE(::GetConsoleScreenBufferInfoEx(_stdHandlesInfo.OutputHandle, &Info));
}
else if (_stdHandlesInfo.IsConsoleError)
{
THROW_IF_WIN32_BOOL_FALSE(::GetConsoleScreenBufferInfoEx(_stdHandlesInfo.ErrorHandle, &Info));
}
return {
static_cast<short>(Info.srWindow.Right - Info.srWindow.Left + 1), static_cast<short>(Info.srWindow.Bottom - Info.srWindow.Top + 1)};
}
void wsl::windows::common::SvcCommIo::RestoreConsoleMode() const
/*++
Routine Description:
Restores the saved input/output console mode.
Arguments:
None.
Return Value:
None.
--*/
{
//
// Restore the console input and output modes.
//
if (_stdHandlesInfo.ConsoleOutputHandle)
{
ChangeConsoleMode(_stdHandlesInfo.ConsoleOutputHandle.get(), _stdHandlesInfo.SavedOutputMode);
SetConsoleOutputCP(_stdHandlesInfo.SavedOutputCP);
}
if (_stdHandlesInfo.IsConsoleInput != FALSE)
{
ChangeConsoleMode(_stdHandlesInfo.InputHandle, _stdHandlesInfo.SavedInputMode);
SetConsoleCP(_stdHandlesInfo.SavedInputCP);
}
}

View File

@ -1,52 +0,0 @@
/*++
Copyright (c) Microsoft. All rights reserved.
Module Name:
svccommio.hpp
Abstract:
This file contains function declarations for the SvcCommIo helper class.
--*/
#pragma once
#include <wil/filesystem.h>
#include <wil/result.h>
#include "wslservice.h"
typedef struct _LXSS_STD_HANDLES_INFO
{
HANDLE InputHandle;
HANDLE OutputHandle;
HANDLE ErrorHandle;
wil::unique_hfile ConsoleOutputHandle;
BOOLEAN IsConsoleInput;
BOOLEAN IsConsoleOutput;
BOOLEAN IsConsoleError;
DWORD SavedInputMode;
DWORD SavedOutputMode;
UINT SavedInputCP;
UINT SavedOutputCP;
} LXSS_STD_HANDLES_INFO, *PLXSS_STD_HANDLES_INFO;
namespace wsl::windows::common {
class SvcCommIo
{
public:
SvcCommIo();
~SvcCommIo();
PLXSS_STD_HANDLES GetStdHandles();
COORD GetWindowSize() const;
private:
void RestoreConsoleMode() const;
LXSS_STD_HANDLES _stdHandles{};
LXSS_STD_HANDLES_INFO _stdHandlesInfo{};
};
} // namespace wsl::windows::common

View File

@ -209,13 +209,6 @@ wil::unique_hlocal_string GetWinInetErrorString(HRESULT error)
return message;
}
bool IsInteractiveConsole()
{
const HANDLE stdinHandle = GetStdHandle(STD_INPUT_HANDLE);
DWORD mode{};
return GetFileType(stdinHandle) == FILE_TYPE_CHAR && GetConsoleMode(stdinHandle, &mode);
}
bool IsWinInetError(HRESULT error)
{
const DWORD code = error - 0x80070000;
@ -1144,6 +1137,17 @@ void wsl::windows::common::wslutil::InitializeWil()
}
}
bool wsl::windows::common::wslutil::IsConsoleHandle(HANDLE Handle)
{
DWORD Mode;
return GetFileType(Handle) == FILE_TYPE_CHAR && GetConsoleMode(Handle, &Mode);
}
bool wsl::windows::common::wslutil::IsInteractiveConsole()
{
return IsConsoleHandle(GetStdHandle(STD_INPUT_HANDLE));
}
bool wsl::windows::common::wslutil::IsRunningInMsix()
{
UINT32 dummy{};

View File

@ -137,6 +137,10 @@ std::vector<BYTE> HashFile(HANDLE File, DWORD Algorithm);
void InitializeWil();
bool IsConsoleHandle(HANDLE Handle);
bool IsInteractiveConsole();
bool IsRunningInMsix();
bool IsVhdFile(_In_ const std::filesystem::path& path);

View File

@ -33,5 +33,5 @@ LPCWSTR const handle_option = L"--handle";
LPCWSTR const event_option = L"--event";
LPCWSTR const parent_option = L"--parent";
LPCWSTR const vm_id_option = L"--vm-id";
LPCWSTR const embedding_option = L"--Embedding";
LPCWSTR const embedding_option = L"-Embedding";
} // namespace wslhost

View File

@ -19,7 +19,6 @@ enum RelayMode
{
Invalid = -1,
DebugConsole,
DebugConsoleRelay,
PortRelay,
KdRelay
};
@ -32,4 +31,5 @@ LPCWSTR const pipe_option = L"--pipe";
LPCWSTR const exit_event_option = L"--exit-event";
LPCWSTR const port_option = L"--port";
LPCWSTR const disable_telemetry_option = L"--disable-telemetry";
LPCWSTR const connect_pipe_option = L"--connect-pipe";
} // namespace wslrelay

View File

@ -784,9 +784,6 @@ try
// Impersonate the service.
auto runAsSelf = wil::run_as_self();
// Update the instance's DNS information.
m_dnsInfo.UpdateNetworkInformation();
// Update the resolv.conf file if it has changed.
_UpdateNetworkConfigurationFiles(false);
return;
@ -799,7 +796,7 @@ void LxssInstance::_UpdateNetworkConfigurationFiles(_In_ bool UpdateAlways)
wsl::core::networking::DnsSettingsFlags flags = wsl::core::networking::DnsSettingsFlags::IncludeIpv6Servers;
WI_SetFlagIf(flags, wsl::core::networking::DnsSettingsFlags::IncludeVpn, m_enableVpnDetection);
const auto dnsSettings = m_dnsInfo.GetDnsSettings(flags);
const auto dnsSettings = wsl::core::networking::HostDnsInfo::GetDnsSettings(flags);
std::string fileContents = GenerateResolvConf(dnsSettings);
std::lock_guard<std::mutex> lock(m_resolvConfLock);
if (!UpdateAlways && (fileContents == m_lastResolvConfContents))

View File

@ -224,11 +224,6 @@ private:
/// </summary>
LxssIpTables m_ipTables;
/// <summary>
/// Class for querying host dns information.
/// </summary>
wsl::core::networking::HostDnsInfo m_dnsInfo;
/// <summary>
/// Settings for updating /etc/resolv.conf.
/// </summary>

View File

@ -2172,13 +2172,22 @@ HRESULT LxssUserSessionImpl::Shutdown(_In_ bool PreventNewInstances, ShutdownBeh
return S_OK;
}
void LxssUserSessionImpl::TelemetryWorker(_In_ wil::unique_socket&& socket, _In_ bool drvFsNotifications) const
void LxssUserSessionImpl::TelemetryWorker(_In_ wil::unique_socket&& socket) const
try
{
wsl::windows::common::wslutil::SetThreadDescription(L"Telemetry");
wsl::shared::SocketChannel channel(std::move(socket), "Telemetry", m_vmTerminating.get());
// Check if drvfs notifications are enabled for the user.
bool drvFsNotifications{};
{
auto impersonate = wil::impersonate_token(m_userToken.get());
const auto lxssKey = wsl::windows::common::registry::OpenLxssUserKey();
drvFsNotifications =
wsl::windows::common::registry::ReadDword(lxssKey.get(), LXSS_NOTIFICATIONS_KEY, LXSS_NOTIFICATION_DRVFS_PERF_DISABLED, 0) == 0;
}
// Aggregate information about what is running inside the VM. This is logged
// periodically because logging each event individually would be too noisy.
for (;;)
@ -2852,17 +2861,9 @@ void LxssUserSessionImpl::_CreateVm()
// If the telemetry is enabled, launch the telemetry agent inside the VM.
if (m_utilityVm->GetConfig().EnableTelemetry && TraceLoggingProviderEnabled(g_hTraceLoggingProvider, WINEVENT_LEVEL_INFO, 0))
{
bool drvFsNotifications = false;
{
auto impersonate = wil::impersonate_token(m_userToken.get());
const auto lxssKey = wsl::windows::common::registry::OpenLxssUserKey();
drvFsNotifications = wsl::windows::common::registry::ReadDword(
lxssKey.get(), LXSS_NOTIFICATIONS_KEY, LXSS_NOTIFICATION_DRVFS_PERF_DISABLED, 0) == 0;
}
LPCSTR Arguments[] = {LX_INIT_TELEMETRY_AGENT, nullptr};
auto socket = m_utilityVm->CreateRootNamespaceProcess(LX_INIT_PATH, Arguments);
m_telemetryThread = std::thread(&LxssUserSessionImpl::TelemetryWorker, this, std::move(socket), drvFsNotifications);
m_telemetryThread = std::thread(&LxssUserSessionImpl::TelemetryWorker, this, std::move(socket));
}
m_pluginManager.OnVmStarted(&m_session, &userSettings);

View File

@ -503,7 +503,7 @@ public:
/// <summary>
/// Worker thread for logging telemetry about processes running inside of WSL.
/// </summary>
void TelemetryWorker(_In_ wil::unique_socket&& socket, _In_ bool drvFsNotifications) const;
void TelemetryWorker(_In_ wil::unique_socket&& socket) const;
/// <summary>
/// Terminates a distribution by it's client identifier.

View File

@ -49,12 +49,6 @@ using namespace std::string_literals;
#define WSLG_SHARED_MEMORY_SIZE_MB 8192
#define PAGE_SIZE 0x1000
// WSL-specific virtio device class IDs.
DEFINE_GUID(VIRTIO_FS_ADMIN_CLASS_ID, 0x7E6AD219, 0xD1B3, 0x42D5, 0xB8, 0xEE, 0xD9, 0x63, 0x24, 0xE6, 0x4F, 0xF6); // {7E6AD219-D1B3-42D5-B8EE-D96324E64FF6}
DEFINE_GUID(VIRTIO_FS_CLASS_ID, 0x60285AE6, 0xAAF3, 0x4456, 0xB4, 0x44, 0xA6, 0xC2, 0xD0, 0xDE, 0xDA, 0x38); // {60285AE6-AAF3-4456-B444-A6C2D0DEDA38}
DEFINE_GUID(VIRTIO_NET_CLASS_ID, 0x16479D2E, 0xF0C3, 0x4DBA, 0xBF, 0x7A, 0x04, 0xFF, 0xF0, 0x89, 0x2B, 0x07); // {16479D2E-F0C3-4DBA-BF7A-04FFF0892B07}
DEFINE_GUID(VIRTIO_PMEM_CLASS_ID, 0xABB755FC, 0x1B86, 0x4255, 0x83, 0xE2, 0xE5, 0x78, 0x7A, 0xBC, 0xF6, 0xC2); // {ABB755FC-1B86-4255-83E2-E5787ABCF6C2}
static constexpr size_t c_bootEntropy = 0x1000;
static constexpr auto c_localDevicesKey = L"SOFTWARE\\Microsoft\\Terminal Server Client\\LocalDevices";
static constexpr std::pair<uint32_t, uint32_t> c_schemaVersionNickel{2, 7};
@ -451,27 +445,12 @@ void WslCoreVm::Initialize(const GUID& VmId, const wil::shared_handle& UserToken
ReadGuestCapabilities();
// Mount the system distro.
// N.B. If using SCSI, the system distro is added during VM creation.
switch (m_systemDistroDeviceType)
{
case LxMiniInitMountDeviceTypeLun:
m_systemDistroDeviceId =
AttachDiskLockHeld(m_vmConfig.SystemDistroPath.c_str(), DiskType::VHD, MountFlags::ReadOnly, {}, false, m_userToken.get());
break;
case LxMiniInitMountDeviceTypePmem:
m_systemDistroDeviceId = MountFileAsPersistentMemory(m_vmConfig.SystemDistroPath.c_str(), true);
break;
default:
break;
}
// Mount the kernel modules VHD.
ULONG modulesLun = ULONG_MAX;
if (!m_vmConfig.KernelModulesPath.empty())
{
modulesLun =
AttachDiskLockHeld(m_vmConfig.KernelModulesPath.c_str(), DiskType::VHD, MountFlags::ReadOnly, {}, false, m_userToken.get());
}
// Attempt to create and mount the swap vhd.
@ -543,7 +522,7 @@ void WslCoreVm::Initialize(const GUID& VmId, const wil::shared_handle& UserToken
message->EnableSafeMode = m_vmConfig.EnableSafeMode;
message->EnableDnsTunneling = m_vmConfig.EnableDnsTunneling;
message->DefaultKernel = m_defaultKernel;
message->KernelModulesDeviceId = modulesLun;
message->KernelModulesDeviceId = m_kernelModulesDeviceId;
message.WriteString(message->HostnameOffset, wsl::windows::common::filesystem::GetLinuxHostName());
message.WriteString(message->KernelModulesListOffset, m_vmConfig.KernelModulesList);
message->DnsTunnelingIpAddress = m_vmConfig.DnsTunnelingIpAddress.value_or(0);
@ -598,7 +577,7 @@ void WslCoreVm::Initialize(const GUID& VmId, const wil::shared_handle& UserToken
else if (m_vmConfig.NetworkingMode == NetworkingMode::VirtioProxy)
{
m_networkingEngine = std::make_unique<wsl::core::VirtioNetworking>(
std::move(gnsChannel), m_vmConfig.EnableLocalhostRelay, m_guestDeviceManager, VIRTIO_NET_CLASS_ID, m_userToken);
std::move(gnsChannel), m_vmConfig.EnableLocalhostRelay, LX_INIT_RESOLVCONF_FULL_HEADER, m_guestDeviceManager, m_userToken);
}
else if (m_vmConfig.NetworkingMode == NetworkingMode::Bridged)
{
@ -844,14 +823,15 @@ WslCoreVm::~WslCoreVm() noexcept
wil::unique_socket WslCoreVm::AcceptConnection(_In_ DWORD ReceiveTimeout, _In_ const std::source_location& Location) const
{
auto socket =
wsl::windows::common::hvsocket::Accept(m_listenSocket.get(), m_vmConfig.KernelBootTimeout, m_terminatingEvent.get(), Location);
auto socket = hvsocket::CancellableAccept(m_listenSocket.get(), m_vmConfig.KernelBootTimeout, m_terminatingEvent.get(), Location);
THROW_HR_IF(E_ABORT, !socket.has_value());
if (ReceiveTimeout != 0)
{
THROW_LAST_ERROR_IF(setsockopt(socket.get(), SOL_SOCKET, SO_RCVTIMEO, (const char*)&ReceiveTimeout, sizeof(ReceiveTimeout)) == SOCKET_ERROR);
THROW_LAST_ERROR_IF(setsockopt(socket->get(), SOL_SOCKET, SO_RCVTIMEO, (const char*)&ReceiveTimeout, sizeof(ReceiveTimeout)) == SOCKET_ERROR);
}
return socket;
return std::move(socket.value());
}
_Requires_lock_held_(m_guestDeviceLock)
@ -876,9 +856,6 @@ void WslCoreVm::AddDrvFsShare(_In_ bool Admin, _In_ HANDLE UserToken)
{
// Add virtiofs devices associating indices with paths from the fixed drive bitmap. These devices support
// multiple mounts in the guest, so this only needs to be done once.
// EX: drvfsC1 => C:\
// drvfsD2 => D:\
// drvfsaC3 => C:\ (elevated)
auto fixedDrives = wsl::windows::common::filesystem::EnumerateFixedDrives(UserToken).first;
while (fixedDrives != 0)
{
@ -1108,13 +1085,16 @@ void WslCoreVm::CollectCrashDumps(wil::unique_socket&& listenSocket) const
{
try
{
auto socket = wsl::windows::common::hvsocket::Accept(listenSocket.get(), INFINITE, m_terminatingEvent.get());
auto socket = hvsocket::CancellableAccept(listenSocket.get(), INFINITE, m_terminatingEvent.get());
if (!socket.has_value())
{
break; // VM is exiting.
}
DWORD receiveTimeout = m_vmConfig.KernelBootTimeout;
THROW_LAST_ERROR_IF(
setsockopt(listenSocket.get(), SOL_SOCKET, SO_RCVTIMEO, (const char*)&receiveTimeout, sizeof(receiveTimeout)) == SOCKET_ERROR);
THROW_LAST_ERROR_IF(setsockopt(socket->get(), SOL_SOCKET, SO_RCVTIMEO, (const char*)&receiveTimeout, sizeof(receiveTimeout)) == SOCKET_ERROR);
auto channel = wsl::shared::SocketChannel{std::move(socket), "crash_dump", m_terminatingEvent.get()};
auto channel = wsl::shared::SocketChannel{std::move(socket.value()), "crash_dump", m_terminatingEvent.get()};
const auto& message = channel.ReceiveMessage<LX_PROCESS_CRASH>();
const char* process = reinterpret_cast<const char*>(&message.Buffer);
@ -1531,16 +1511,18 @@ std::wstring WslCoreVm::GenerateConfigJson()
{
try
{
std::vector<std::string> processorFeatures{};
if (wsl::windows::common::helpers::IsWindows11OrAbove())
{
processorFeatures = wsl::windows::common::hcs::GetProcessorFeatures();
const auto& processorFeatures = wsl::windows::common::hcs::GetProcessorFeatures();
auto feature = std::find(processorFeatures.begin(), processorFeatures.end(), "NestedVirt");
m_vmConfig.EnableNestedVirtualization = (feature != processorFeatures.end());
}
else
{
m_vmConfig.EnableNestedVirtualization = false;
}
auto feature = std::find(processorFeatures.begin(), processorFeatures.end(), "NestedVirt");
m_vmConfig.EnableNestedVirtualization = (feature != processorFeatures.end());
vmSettings.ComputeTopology.Processor.ExposeVirtualizationExtensions = m_vmConfig.EnableNestedVirtualization;
if (!m_vmConfig.EnableNestedVirtualization)
{
EMIT_USER_WARNING(wsl::shared::Localization::MessageNestedVirtualizationNotSupported());
@ -1729,9 +1711,33 @@ std::wstring WslCoreVm::GenerateConfigJson()
vmSettings.Chipset.Uefi = std::move(uefiSettings);
}
// Initialize other devices.
vmSettings.Devices.Scsi["0"] = hcs::Scsi{};
hcs::HvSocket hvSocketConfig{};
// Initialize SCSI devices.
hcs::Scsi scsiController{};
auto attachDisk = [&](PCWSTR path) {
auto lun = ReserveLun();
hcs::Attachment disk{};
disk.Type = hcs::AttachmentType::VirtualDisk;
disk.Path = path;
disk.ReadOnly = true;
disk.SupportCompressedVolumes = true;
disk.AlwaysAllowSparseFiles = true;
disk.SupportEncryptedFiles = true;
scsiController.Attachments[std::to_string(lun)] = std::move(disk);
m_attachedDisks.emplace(AttachedDisk{DiskType::VHD, path, false}, DiskState{lun, {}, {}});
return lun;
};
if (m_systemDistroDeviceType == LxMiniInitMountDeviceTypeLun)
{
m_systemDistroDeviceId = attachDisk(m_vmConfig.SystemDistroPath.c_str());
}
if (!m_vmConfig.KernelModulesPath.empty())
{
m_kernelModulesDeviceId = attachDisk(m_vmConfig.KernelModulesPath.c_str());
}
vmSettings.Devices.Scsi["0"] = std::move(scsiController);
// Construct a security descriptor that allows system and the current user.
wil::unique_hlocal_string userSidString;
@ -1740,6 +1746,7 @@ std::wstring WslCoreVm::GenerateConfigJson()
std::wstring securityDescriptor{L"D:P(A;;FA;;;SY)(A;;FA;;;"};
securityDescriptor += userSidString.get();
securityDescriptor += L")";
hcs::HvSocket hvSocketConfig{};
hvSocketConfig.HvSocketConfig.DefaultBindSecurityDescriptor = securityDescriptor;
hvSocketConfig.HvSocketConfig.DefaultConnectSecurityDescriptor = securityDescriptor;
vmSettings.Devices.HvSocket = std::move(hvSocketConfig);
@ -1793,8 +1800,10 @@ void WslCoreVm::InitializeGuest()
{
try
{
m_guestDeviceManager->AddSharedMemoryDevice(
VIRTIO_FS_CLASS_ID, L"wslg", L"wslg", WSLG_SHARED_MEMORY_SIZE_MB, m_userToken.get());
// Use the appropriate virtiofs class ID based on m_userToken elevation.
const bool admin = wsl::windows::common::security::IsTokenElevated(m_userToken.get());
const GUID classId = admin ? VIRTIO_FS_ADMIN_CLASS_ID : VIRTIO_FS_CLASS_ID;
m_guestDeviceManager->AddSharedMemoryDevice(classId, L"wslg", L"wslg", WSLG_SHARED_MEMORY_SIZE_MB, m_userToken.get());
m_sharedMemoryRoot = std::format(L"WSL\\{}\\wslg", m_machineId);
}
CATCH_LOG()
@ -2117,7 +2126,7 @@ void WslCoreVm::WaitForPmemDeviceInVm(_In_ ULONG PmemId)
_Requires_lock_held_(m_guestDeviceLock)
std::wstring WslCoreVm::AddVirtioFsShare(_In_ bool Admin, _In_ PCWSTR Path, _In_ PCWSTR Options, _In_opt_ HANDLE UserToken)
{
WI_ASSERT(m_vmConfig.EnableVirtioFs && wsl::shared::string::IsDriveRoot(wsl::shared::string::WideToMultiByte(Path)));
WI_ASSERT(m_vmConfig.EnableVirtioFs);
if (!ARGUMENT_PRESENT(UserToken))
{
@ -2128,22 +2137,27 @@ std::wstring WslCoreVm::AddVirtioFsShare(_In_ bool Admin, _In_ PCWSTR Path, _In_
WI_ASSERT(Admin == wsl::windows::common::security::IsTokenElevated(UserToken));
// Ensure that the path has a trailing path separator.
std::wstring sharePath{Path};
if (sharePath.back() != L'\\')
std::wstring sharePath(Path);
if (!sharePath.ends_with(L'\\') && !sharePath.ends_with(L'/'))
{
sharePath += L'\\';
sharePath.push_back(L'\\');
}
sharePath = std::filesystem::weakly_canonical(sharePath).wstring();
// Check if a matching share already exists.
bool created = false;
std::wstring tag;
VirtioFsShare key(sharePath.c_str(), Options, Admin);
if (!m_virtioFsShares.contains(key))
{
// Generate a new tag for the share.
tag = Admin ? TEXT(LX_INIT_DRVFS_ADMIN_VIRTIO_TAG) : TEXT(LX_INIT_DRVFS_VIRTIO_TAG);
tag += sharePath[0];
tag += std::to_wstring(m_virtioFsShares.size());
// Generate a new unique tag for the share.
//
// N.B. The tag can be maximum 36 characters long so a GUID without braces fits perfectly.
GUID tagGuid{};
THROW_IF_FAILED(CoCreateGuid(&tagGuid));
tag = wsl::shared::string::GuidToString<wchar_t>(tagGuid, wsl::shared::string::None);
WI_ASSERT(!FindVirtioFsShare(tag.c_str(), Admin));
(void)m_guestDeviceManager->AddGuestDevice(
@ -2544,10 +2558,14 @@ try
for (;;)
{
// Create a worker thread to handle each request.
wsl::shared::SocketChannel channel{
wsl::windows::common::hvsocket::Accept(listenSocket.get(), INFINITE, m_terminatingEvent.get()),
"VirtioFs",
m_terminatingEvent.get()};
auto socket = hvsocket::CancellableAccept(listenSocket.get(), INFINITE, m_terminatingEvent.get());
if (!socket.has_value())
{
break;
}
wsl::shared::SocketChannel channel{std::move(socket.value()), "VirtioFs", m_terminatingEvent.get()};
std::thread([this, channel = std::move(channel)]() mutable {
try
{
@ -2577,8 +2595,6 @@ try
THROW_HR_IF(E_UNEXPECTED, !addShare);
const auto path = wsl::shared::string::FromSpan(span, addShare->PathOffset);
THROW_HR_IF_MSG(E_INVALIDARG, !wsl::shared::string::IsDriveRoot(path), "%hs is not the root of a drive", path);
const auto pathWide = wsl::shared::string::MultiByteToWide(path);
const auto options = wsl::shared::string::FromSpan(span, addShare->OptionsOffset);
const auto optionsWide = wsl::shared::string::MultiByteToWide(options);
@ -2598,19 +2614,6 @@ try
THROW_HR_IF(E_UNEXPECTED, !remountShare);
const std::string tag = wsl::shared::string::FromSpan(span, remountShare->TagOffset);
if (tag.find(LX_INIT_DRVFS_ADMIN_VIRTIO_TAG, 0) == 0)
{
THROW_HR_IF(E_UNEXPECTED, remountShare->Admin);
}
else if (tag.find(LX_INIT_DRVFS_VIRTIO_TAG, 0) == 0)
{
THROW_HR_IF(E_UNEXPECTED, !remountShare->Admin);
}
else
{
THROW_HR_MSG(E_UNEXPECTED, "Unexpected tag %hs", tag.data());
}
const auto tagWide = wsl::shared::string::MultiByteToWide(tag);
auto guestDeviceLock = m_guestDeviceLock.lock_exclusive();
const auto foundShare = FindVirtioFsShare(tagWide.c_str(), !remountShare->Admin);
@ -2621,6 +2624,24 @@ try
respondWithTag(newTag, result);
}
else if (message->MessageType == LxInitMessageQueryVirtioFsDevice)
{
std::wstring newTag;
const auto result = wil::ResultFromException([this, span, &newTag]() {
const auto* query = gslhelpers::try_get_struct<LX_INIT_QUERY_VIRTIOFS_SHARE_MESSAGE>(span);
THROW_HR_IF(E_UNEXPECTED, !query);
const std::string tag = wsl::shared::string::FromSpan(span, query->TagOffset);
const auto tagWide = wsl::shared::string::MultiByteToWide(tag);
auto guestDeviceLock = m_guestDeviceLock.lock_exclusive();
const auto foundShare = FindVirtioFsShare(tagWide.c_str());
THROW_HR_IF_MSG(E_UNEXPECTED, !foundShare.has_value(), "Unknown tag %ls", tagWide.c_str());
newTag = foundShare->Path;
});
respondWithTag(newTag, result);
}
else
{
THROW_HR_MSG(E_UNEXPECTED, "Unexpected MessageType %d", message->MessageType);

View File

@ -242,7 +242,7 @@ private:
void ReadGuestCapabilities();
_Requires_lock_held_(m_lock)
ULONG ReserveLun(_In_ std::optional<ULONG> Lun);
ULONG ReserveLun(_In_ std::optional<ULONG> Lun = {});
void RestorePassthroughDiskState(_In_ LPCWSTR Disk) const;
@ -296,6 +296,7 @@ private:
bool m_defaultKernel = true;
LX_MINI_INIT_MOUNT_DEVICE_TYPE m_systemDistroDeviceType = LxMiniInitMountDeviceTypeInvalid;
ULONG m_systemDistroDeviceId = ULONG_MAX;
ULONG m_kernelModulesDeviceId = ULONG_MAX;
wsl::windows::common::hcs::unique_hcs_system m_system;
wil::unique_socket m_listenSocket;
std::function<void(GUID)> m_onExit;

Some files were not shown because too many files have changed in this diff Show More