├── .clang-format
├── .gdnsuppress
├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ ├── Bug_Report.yaml
│ └── feature_request.md
├── actions
│ └── triage
│ │ └── action.yml
├── policies
│ └── resourceManagement.yml
├── pull_request_template.md
└── workflows
│ ├── distributions.yml
│ ├── documentation.yml
│ ├── issue_edited.yml
│ ├── modern-distributions.yml
│ ├── new_issue.yml
│ ├── new_issue_comment.yml
│ └── winget.yml
├── .gitignore
├── .pipelines
├── build-stage.yml
├── flight-stage.yml
├── nuget-stage.yml
├── test-job.yml
├── test-stage.yml
├── wsl-build-nightly-localization.yml
├── wsl-build-nightly-onebranch.yml
├── wsl-build-notice.yml
├── wsl-build-pr-onebranch.yml
├── wsl-build-pr.yml
└── wsl-build-release-onebranch.yml
├── CMakeLists.txt
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── DATA_AND_PRIVACY.md
├── Directory.Build.Props
├── Images
├── LargeTile.scale-100.png
├── SettingsOOBECrossOSFileAccess.gif
├── SettingsOOBEDistroManagement.png
├── SettingsOOBEDockerDesktopIntegration.png
├── SettingsOOBEDockerIcon.png
├── SettingsOOBEFileExplorerIcon.png
├── SettingsOOBEGPUAcceleration.gif
├── SettingsOOBEGUIApps.png
├── SettingsOOBEGeneral.png
├── SettingsOOBENetworkingIntegration.png
├── SettingsOOBEVSCodeIcon.png
├── SettingsOOBEVSCodeIntegration.png
├── SmallTile.scale-100.png
├── SplashScreen.scale-100.png
├── Square150x150Logo.scale-100.png
├── Square44x44Logo.altform-lightunplated_targetsize-16.png
├── Square44x44Logo.altform-lightunplated_targetsize-24.png
├── Square44x44Logo.altform-lightunplated_targetsize-256.png
├── Square44x44Logo.altform-lightunplated_targetsize-32.png
├── Square44x44Logo.altform-lightunplated_targetsize-48.png
├── Square44x44Logo.altform-unplated_targetsize-16.png
├── Square44x44Logo.altform-unplated_targetsize-256.png
├── Square44x44Logo.altform-unplated_targetsize-32.png
├── Square44x44Logo.altform-unplated_targetsize-48.png
├── Square44x44Logo.scale-100.png
├── Square44x44Logo.targetsize-16.png
├── Square44x44Logo.targetsize-24.png
├── Square44x44Logo.targetsize-24_altform-unplated.png
├── Square44x44Logo.targetsize-256.png
├── Square44x44Logo.targetsize-32.png
├── Square44x44Logo.targetsize-48.png
├── StoreLogo.backup.png
├── StoreLogo.scale-100.png
├── Wide310x150Logo.scale-100.png
├── wsl.ico
└── wslbw.ico
├── LICENSE
├── NOTICE.txt
├── README.md
├── SECURITY.md
├── SUPPORT.md
├── UserConfig.cmake.sample
├── cgmanifest.json
├── cloudtest
├── CMakeLists.txt
├── TestGroup.xml.in
└── TestMap.xml.in
├── cmake
├── FindIDL.cmake
├── FindLINUXBUILD.cmake
├── FindMC.cmake
├── findAppx.cmake
├── findNuget.cmake
└── findVersion.cmake
├── diagnostics
├── collect-networking-logs.ps1
├── collect-wsl-logs.ps1
├── dump-init-stacks.sh
├── dump-init.sh
├── networking.sh
├── wsl.wprp
├── wsl_networking.wprp
└── wsl_storage.wprp
├── distributions
├── DistributionInfo.json
├── requirements.txt
├── validate-modern.py
└── validate.py
├── doc
├── README.md
├── docs
│ ├── debugging.md
│ ├── dev-loop.md
│ ├── index.md
│ └── technical-documentation
│ │ ├── boot-process.md
│ │ ├── drvfs.md
│ │ ├── gns.md
│ │ ├── index.md
│ │ ├── init.md
│ │ ├── interop.md
│ │ ├── localhost.md
│ │ ├── mini_init.md
│ │ ├── plan9.md
│ │ ├── relay.md
│ │ ├── session-leader.md
│ │ ├── systemd.md
│ │ ├── wsl.exe.md
│ │ ├── wslconfig.exe.md
│ │ ├── wslg.exe.md
│ │ ├── wslhost.exe.md
│ │ ├── wslrelay.exe.md
│ │ └── wslservice.exe.md
└── mkdocs.yml
├── img
├── networkinglog1.gif
├── networkinglog2.gif
├── networkinglog3.gif
└── networkinglog4.gif
├── intune
├── WSL.admx
└── en-US
│ └── WSL.adml
├── localization
├── CMakeLists.txt
└── strings
│ ├── cs-CZ
│ └── Resources.resw
│ ├── da-DK
│ └── Resources.resw
│ ├── de-DE
│ └── Resources.resw
│ ├── en-GB
│ └── Resources.resw
│ ├── en-US
│ └── Resources.resw
│ ├── es-ES
│ └── Resources.resw
│ ├── fi-FI
│ └── Resources.resw
│ ├── fr-FR
│ └── Resources.resw
│ ├── hu-HU
│ └── Resources.resw
│ ├── it-IT
│ └── Resources.resw
│ ├── ja-JP
│ └── Resources.resw
│ ├── ko-KR
│ └── Resources.resw
│ ├── nb-NO
│ └── Resources.resw
│ ├── nl-NL
│ └── Resources.resw
│ ├── pl-PL
│ └── Resources.resw
│ ├── pt-BR
│ └── Resources.resw
│ ├── pt-PT
│ └── Resources.resw
│ ├── ru-RU
│ └── Resources.resw
│ ├── sv-SE
│ └── Resources.resw
│ ├── tr-TR
│ └── Resources.resw
│ ├── zh-CN
│ └── Resources.resw
│ └── zh-TW
│ └── Resources.resw
├── msipackage
├── CMakeLists.txt
└── package.wix.in
├── msixgluepackage
├── AppxManifest.in
└── CMakeLists.txt
├── msixinstaller
├── AppxManifest.in
└── CMakeLists.txt
├── nuget.config
├── nuget
├── CMakeLists.txt
├── Microsoft.WSL.PluginApi.nuspec.in
└── README.WslPluginApi.MD
├── packages.config
├── src
├── linux
│ ├── inc
│ │ ├── lxdef.h
│ │ ├── lxwil.h
│ │ └── seccomp_defs.h
│ ├── init
│ │ ├── CMakeLists.txt
│ │ ├── DnsServer.cpp
│ │ ├── DnsServer.h
│ │ ├── DnsTunnelingChannel.cpp
│ │ ├── DnsTunnelingChannel.h
│ │ ├── DnsTunnelingManager.cpp
│ │ ├── DnsTunnelingManager.h
│ │ ├── GnsEngine.cpp
│ │ ├── GnsEngine.h
│ │ ├── GnsPortTracker.cpp
│ │ ├── GnsPortTracker.h
│ │ ├── Localization.cpp
│ │ ├── NetworkManager.cpp
│ │ ├── NetworkManager.h
│ │ ├── SecCompDispatcher.cpp
│ │ ├── SecCompDispatcher.h
│ │ ├── WslDistributionConfig.cpp
│ │ ├── WslDistributionConfig.h
│ │ ├── binfmt.cpp
│ │ ├── binfmt.h
│ │ ├── common.h
│ │ ├── config.cpp
│ │ ├── config.h
│ │ ├── drvfs.cpp
│ │ ├── drvfs.h
│ │ ├── escape.cpp
│ │ ├── escape.h
│ │ ├── init.cpp
│ │ ├── localhost.cpp
│ │ ├── localhost.h
│ │ ├── main.cpp
│ │ ├── plan9.cpp
│ │ ├── plan9.h
│ │ ├── telemetry.cpp
│ │ ├── telemetry.h
│ │ ├── timezone.cpp
│ │ ├── timezone.h
│ │ ├── util.cpp
│ │ ├── util.h
│ │ ├── waitablevalue.h
│ │ ├── wslinfo.cpp
│ │ ├── wslinfo.h
│ │ ├── wslpath.cpp
│ │ └── wslpath.h
│ ├── mountutil
│ │ ├── CMakeLists.txt
│ │ ├── mountflags.cpp
│ │ ├── mountutil.c
│ │ ├── mountutil.h
│ │ └── mountutilcpp.h
│ ├── netlinkutil
│ │ ├── Address.cpp
│ │ ├── CMakeLists.txt
│ │ ├── Forwarder.h
│ │ ├── Forwarder.hxx
│ │ ├── Fwd.h
│ │ ├── Interface.cpp
│ │ ├── Interface.h
│ │ ├── InterfaceConfiguration.h
│ │ ├── IpNeighborManager.cpp
│ │ ├── IpNeighborManager.h
│ │ ├── IpRuleManager.cpp
│ │ ├── IpRuleManager.h
│ │ ├── Makefile.linux
│ │ ├── Neighbor.cpp
│ │ ├── Neighbor.h
│ │ ├── NetLinkStrings.h
│ │ ├── NetlinkChannel.h
│ │ ├── NetlinkChannel.hxx
│ │ ├── NetlinkError.cpp
│ │ ├── NetlinkError.h
│ │ ├── NetlinkMessage.h
│ │ ├── NetlinkMessage.hxx
│ │ ├── NetlinkParseException.cpp
│ │ ├── NetlinkParseException.h
│ │ ├── NetlinkResponse.cpp
│ │ ├── NetlinkResponse.h
│ │ ├── NetlinkResponse.hxx
│ │ ├── NetlinkTransaction.cpp
│ │ ├── NetlinkTransaction.h
│ │ ├── NetlinkTransactionError.cpp
│ │ ├── NetlinkTransactionError.h
│ │ ├── Operation.h
│ │ ├── Packet.h
│ │ ├── Protocol.h
│ │ ├── Route.cpp
│ │ ├── Route.h
│ │ ├── RoutingTable.cpp
│ │ ├── RoutingTable.h
│ │ ├── Rule.cpp
│ │ ├── Rule.h
│ │ ├── RuntimeErrorWithSourceLocation.cpp
│ │ ├── RuntimeErrorWithSourceLocation.h
│ │ ├── Syscall.h
│ │ ├── Syscall.hxx
│ │ ├── SyscallError.cpp
│ │ ├── SyscallError.h
│ │ ├── Utils.cpp
│ │ ├── Utils.h
│ │ ├── Utils.hxx
│ │ └── address.h
│ └── plan9
│ │ ├── CMakeLists.txt
│ │ ├── expected.h
│ │ ├── p9await.h
│ │ ├── p9commonutil.h
│ │ ├── p9data.h
│ │ ├── p9defs.h
│ │ ├── p9errors.h
│ │ ├── p9fid.cpp
│ │ ├── p9fid.h
│ │ ├── p9file.cpp
│ │ ├── p9file.h
│ │ ├── p9fs.cpp
│ │ ├── p9fs.h
│ │ ├── p9handler.cpp
│ │ ├── p9handler.h
│ │ ├── p9ihandler.h
│ │ ├── p9io.cpp
│ │ ├── p9io.h
│ │ ├── p9log.h
│ │ ├── p9lx.cpp
│ │ ├── p9lx.h
│ │ ├── p9platform.h
│ │ ├── p9protohelpers.h
│ │ ├── p9readdir.cpp
│ │ ├── p9readdir.h
│ │ ├── p9scheduler.cpp
│ │ ├── p9scheduler.h
│ │ ├── p9tracelogging.cpp
│ │ ├── p9tracelogging.h
│ │ ├── p9tracelogginghelper.h
│ │ ├── p9util.cpp
│ │ ├── p9util.h
│ │ ├── p9xattr.cpp
│ │ ├── p9xattr.h
│ │ ├── precomp.h
│ │ └── result_macros.h
├── shared
│ ├── configfile
│ │ ├── CMakeLists.txt
│ │ ├── configfile.cpp
│ │ ├── configfile.h
│ │ ├── linux
│ │ │ └── CMakeLists.txt
│ │ └── windows
│ │ │ └── CMakeLists.txt
│ └── inc
│ │ ├── CommandLine.h
│ │ ├── JsonUtils.h
│ │ ├── SocketChannel.h
│ │ ├── conncheckshared.h
│ │ ├── defs.h
│ │ ├── gslhelpers.h
│ │ ├── hns_schema.h
│ │ ├── lxfsshares.h
│ │ ├── lxinitshared.h
│ │ ├── message.h
│ │ ├── prettyprintshared.h
│ │ ├── retryshared.h
│ │ ├── socketshared.h
│ │ └── stringshared.h
└── windows
│ ├── common
│ ├── CMakeLists.txt
│ ├── ConsoleProgressBar.cpp
│ ├── ConsoleProgressBar.h
│ ├── ConsoleProgressIndicator.cpp
│ ├── ConsoleProgressIndicator.h
│ ├── Distribution.cpp
│ ├── Distribution.h
│ ├── ExecutionContext.cpp
│ ├── ExecutionContext.h
│ ├── HandleConsoleProgressBar.cpp
│ ├── HandleConsoleProgressBar.h
│ ├── Localization.cpp
│ ├── LxssMessagePort.cpp
│ ├── LxssMessagePort.h
│ ├── LxssPort.h
│ ├── LxssServerPort.cpp
│ ├── LxssServerPort.h
│ ├── Redirector.cpp
│ ├── Redirector.h
│ ├── Stringify.h
│ ├── SubProcess.cpp
│ ├── SubProcess.h
│ ├── WslClient.cpp
│ ├── WslClient.h
│ ├── WslCoreConfig.cpp
│ ├── WslCoreConfig.h
│ ├── WslCoreFirewallSupport.cpp
│ ├── WslCoreFirewallSupport.h
│ ├── WslCoreNetworkingSupport.cpp
│ ├── WslCoreNetworkingSupport.h
│ ├── WslInstall.cpp
│ ├── WslInstall.h
│ ├── WslSecurity.cpp
│ ├── WslSecurity.h
│ ├── WslTelemetry.cpp
│ ├── WslTelemetry.h
│ ├── disk.cpp
│ ├── disk.hpp
│ ├── filesystem.cpp
│ ├── filesystem.hpp
│ ├── hcs.cpp
│ ├── hcs.hpp
│ ├── hcs_schema.h
│ ├── helpers.cpp
│ ├── helpers.hpp
│ ├── hvsocket.cpp
│ ├── hvsocket.hpp
│ ├── interop.cpp
│ ├── interop.hpp
│ ├── lxssbusclient.cpp
│ ├── lxssclient.cpp
│ ├── notifications.cpp
│ ├── notifications.h
│ ├── precomp.h
│ ├── registry.cpp
│ ├── registry.hpp
│ ├── relay.cpp
│ ├── relay.hpp
│ ├── socket.cpp
│ ├── socket.hpp
│ ├── string.cpp
│ ├── string.hpp
│ ├── svccomm.cpp
│ ├── svccomm.hpp
│ ├── svccommio.cpp
│ ├── svccommio.hpp
│ ├── wslutil.cpp
│ └── wslutil.h
│ ├── inc
│ ├── LxssDynamicFunction.h
│ ├── RegistryWatcher.h
│ ├── WmiService.h
│ ├── WmiVariant.h
│ ├── WslCoreConfigInterface.h
│ ├── WslPluginApi.h
│ ├── comservicehelper.h
│ ├── lxssbusclient.h
│ ├── lxssclient.h
│ ├── traceloggingconfig.h
│ ├── wdk.h
│ ├── wsl.h
│ ├── wslconfig.h
│ ├── wslhost.h
│ ├── wslpolicies.h
│ ├── wslrelay.h
│ └── wslversioninfo.h
│ ├── libwsl
│ ├── CMakeLists.txt
│ ├── DllMain.cpp
│ ├── WslCoreConfigInterface.cpp
│ └── libwsl.def
│ ├── service
│ ├── CMakeLists.txt
│ ├── exe
│ │ ├── BridgedNetworking.cpp
│ │ ├── BridgedNetworking.h
│ │ ├── CMakeLists.txt
│ │ ├── DeviceHostProxy.cpp
│ │ ├── DeviceHostProxy.h
│ │ ├── DistributionRegistration.cpp
│ │ ├── DistributionRegistration.h
│ │ ├── Dmesg.cpp
│ │ ├── Dmesg.h
│ │ ├── DnsResolver.cpp
│ │ ├── DnsResolver.h
│ │ ├── DnsTunnelingChannel.cpp
│ │ ├── DnsTunnelingChannel.h
│ │ ├── GnsChannel.cpp
│ │ ├── GnsChannel.h
│ │ ├── GnsPortTrackerChannel.cpp
│ │ ├── GnsPortTrackerChannel.h
│ │ ├── GnsRpcServer.cpp
│ │ ├── GnsRpcServer.h
│ │ ├── GuestTelemetryLogger.cpp
│ │ ├── GuestTelemetryLogger.h
│ │ ├── IMirroredNetworkManager.h
│ │ ├── INetworkingEngine.h
│ │ ├── Lifetime.cpp
│ │ ├── Lifetime.h
│ │ ├── LxssConsoleManager.cpp
│ │ ├── LxssConsoleManager.h
│ │ ├── LxssCreateProcess.cpp
│ │ ├── LxssCreateProcess.h
│ │ ├── LxssHttpProxy.cpp
│ │ ├── LxssHttpProxy.h
│ │ ├── LxssInstance.cpp
│ │ ├── LxssInstance.h
│ │ ├── LxssIpTables.cpp
│ │ ├── LxssIpTables.h
│ │ ├── LxssSecurity.cpp
│ │ ├── LxssSecurity.h
│ │ ├── LxssUserCallback.cpp
│ │ ├── LxssUserCallback.h
│ │ ├── LxssUserSession.cpp
│ │ ├── LxssUserSession.h
│ │ ├── LxssUserSessionFactory.cpp
│ │ ├── LxssUserSessionFactory.h
│ │ ├── MirroredNetworking.cpp
│ │ ├── MirroredNetworking.h
│ │ ├── NatNetworking.cpp
│ │ ├── NatNetworking.h
│ │ ├── PluginManager.cpp
│ │ ├── PluginManager.h
│ │ ├── RingBuffer.cpp
│ │ ├── RingBuffer.h
│ │ ├── ServiceMain.cpp
│ │ ├── VirtioNetworking.cpp
│ │ ├── VirtioNetworking.h
│ │ ├── WslCoreAdviseHandler.h
│ │ ├── WslCoreFilesystem.cpp
│ │ ├── WslCoreFilesystem.h
│ │ ├── WslCoreGuestNetworkService.cpp
│ │ ├── WslCoreGuestNetworkService.h
│ │ ├── WslCoreHostDnsInfo.cpp
│ │ ├── WslCoreHostDnsInfo.h
│ │ ├── WslCoreInstance.cpp
│ │ ├── WslCoreInstance.h
│ │ ├── WslCoreMessageQueue.h
│ │ ├── WslCoreNetworkEndpoint.h
│ │ ├── WslCoreNetworkEndpointSettings.cpp
│ │ ├── WslCoreNetworkEndpointSettings.h
│ │ ├── WslCoreTcpIpStateTracking.cpp
│ │ ├── WslCoreTcpIpStateTracking.h
│ │ ├── WslCoreVm.cpp
│ │ ├── WslCoreVm.h
│ │ ├── WslMirroredNetworking.cpp
│ │ ├── WslMirroredNetworking.h
│ │ ├── application.manifest
│ │ ├── main.rc
│ │ └── resource.h
│ ├── inc
│ │ ├── CMakeLists.txt
│ │ ├── windowsdefs.idl
│ │ └── wslservice.idl
│ ├── mc
│ │ ├── CMakeLists.txt
│ │ └── wsleventschema.mc
│ └── stub
│ │ ├── CMakeLists.txt
│ │ ├── WslServiceProxyStub.def
│ │ └── WslServiceProxyStub.rc
│ ├── wsl
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── main.rc
│ └── resource.h
│ ├── wslg
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── main.rc
│ └── resource.h
│ ├── wslhost
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── main.rc
│ └── resource.h
│ ├── wslinstall
│ ├── CMakeLists.txt
│ ├── DllMain.cpp
│ ├── version.rc
│ └── wslinstall.def
│ ├── wslinstaller
│ ├── exe
│ │ ├── CMakeLists.txt
│ │ ├── ServiceMain.cpp
│ │ ├── WslInstaller.cpp
│ │ ├── WslInstaller.h
│ │ ├── WslInstallerFactory.cpp
│ │ ├── WslInstallerFactory.h
│ │ └── main.rc
│ ├── inc
│ │ ├── CMakeLists.txt
│ │ └── wslinstallerservice.idl
│ ├── stub
│ │ ├── CMakeLists.txt
│ │ ├── WslInstallerProxyStub.def
│ │ └── WslInstallerProxyStub.rc
│ └── wslinstaller.idl
│ ├── wslrelay
│ ├── CMakeLists.txt
│ ├── localhost.cpp
│ ├── localhost.h
│ ├── main.cpp
│ ├── main.rc
│ └── resource.h
│ └── wslsettings
│ ├── Activation
│ ├── ActivationHandler.cs
│ ├── DefaultActivationHandler.cs
│ ├── IActivationHandler.cs
│ └── ProtocolActivationHandler.cs
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Behaviors
│ ├── NavigationViewHeaderBehavior.cs
│ └── NavigationViewHeaderMode.cs
│ ├── CMakeLists.txt
│ ├── Constants.cs
│ ├── Contracts
│ ├── Services
│ │ ├── IActivationService.cs
│ │ ├── INavigationService.cs
│ │ ├── INavigationViewService.cs
│ │ ├── IPageService.cs
│ │ ├── IWindowService.cs
│ │ └── IWslConfigService.cs
│ └── ViewModels
│ │ └── INavigationAware.cs
│ ├── Controls
│ ├── HyperlinkTextBlock.xaml
│ ├── HyperlinkTextBlock.xaml.cs
│ ├── OOBEContent.xaml
│ └── OOBEContent.xaml.cs
│ ├── Converters
│ ├── BooleanToVisibilityConverter.cs
│ ├── MegabyteNumberConverter.cs
│ ├── MegabyteStringConverter.cs
│ └── MillisecondsStringConverter.cs
│ ├── Helpers
│ ├── FrameExtensions.cs
│ ├── NavigationHelper.cs
│ ├── ResourceExtensions.cs
│ ├── RuntimeHelper.cs
│ └── TitleBarHelper.cs
│ ├── LibWsl.cs
│ ├── Services
│ ├── ActivationService.cs
│ ├── NavigationService.cs
│ ├── NavigationViewService.cs
│ ├── PageService.cs
│ ├── WindowService.cs
│ └── WslConfigService.cs
│ ├── Styles
│ ├── Button.xaml
│ ├── CommonStyles.xaml
│ ├── FontSizes.xaml
│ └── Thickness.xaml
│ ├── Usings.cs
│ ├── ViewModels
│ ├── OOBE
│ │ ├── DistroManagementViewModel.cs
│ │ ├── DockerDesktopIntegrationViewModel.cs
│ │ ├── GPUAccelerationViewModel.cs
│ │ ├── GUIAppsViewModel.cs
│ │ ├── GeneralViewModel.cs
│ │ ├── NetworkingIntegrationViewModel.cs
│ │ ├── VSCodeIntegrationViewModel.cs
│ │ ├── WelcomeToUbuntuViewModel.cs
│ │ └── WorkingAcrossFileSystemsViewModel.cs
│ ├── Settings
│ │ ├── AboutViewModel.cs
│ │ ├── DeveloperViewModel.cs
│ │ ├── FileSystemViewModel.cs
│ │ ├── MemAndProcViewModel.cs
│ │ ├── NetworkingViewModel.cs
│ │ ├── OptionalFeaturesViewModel.cs
│ │ └── WslConfigSettingViewModel.cs
│ └── ShellViewModel.cs
│ ├── Views
│ ├── OOBE
│ │ ├── DistroManagementPage.xaml
│ │ ├── DistroManagementPage.xaml.cs
│ │ ├── DockerDesktopIntegrationPage.xaml
│ │ ├── DockerDesktopIntegrationPage.xaml.cs
│ │ ├── GPUAccelerationPage.xaml
│ │ ├── GPUAccelerationPage.xaml.cs
│ │ ├── GUIAppsPage.xaml
│ │ ├── GUIAppsPage.xaml.cs
│ │ ├── GeneralPage.xaml
│ │ ├── GeneralPage.xaml.cs
│ │ ├── NetworkingIntegrationPage.xaml
│ │ ├── NetworkingIntegrationPage.xaml.cs
│ │ ├── ShellPage.xaml
│ │ ├── ShellPage.xaml.cs
│ │ ├── VSCodeIntegrationPage.xaml
│ │ ├── VSCodeIntegrationPage.xaml.cs
│ │ ├── WorkingAcrossFileSystemsPage.xaml
│ │ └── WorkingAcrossFileSystemsPage.xaml.cs
│ └── Settings
│ │ ├── AboutPage.xaml
│ │ ├── AboutPage.xaml.cs
│ │ ├── DeveloperPage.xaml
│ │ ├── DeveloperPage.xaml.cs
│ │ ├── FileSystemPage.xaml
│ │ ├── FileSystemPage.xaml.cs
│ │ ├── MemAndProcPage.xaml
│ │ ├── MemAndProcPage.xaml.cs
│ │ ├── NetworkingPage.xaml
│ │ ├── NetworkingPage.xaml.cs
│ │ ├── OptionalFeaturesPage.xaml
│ │ ├── OptionalFeaturesPage.xaml.cs
│ │ ├── ShellPage.xaml
│ │ └── ShellPage.xaml.cs
│ ├── Windows
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── OOBEWindow.xaml
│ └── OOBEWindow.xaml.cs
│ ├── app.manifest
│ ├── directory.build.targets.in
│ └── properties
│ └── AssemblyInfo.cs.in
├── storebroker
├── Media
│ └── en-us
│ │ ├── WSLAppList 1.png
│ │ ├── WSLTerminalAssetSettingsColour-Export.png
│ │ ├── WSLTerminalPanes-Export.png
│ │ └── WSLTerminalWSLgAsset-Export.png
├── PDPs
│ ├── cs-CZ
│ │ └── PDP.xml
│ ├── da-DK
│ │ └── PDP.xml
│ ├── de-DE
│ │ └── PDP.xml
│ ├── en-GB
│ │ └── PDP.xml
│ ├── en-us
│ │ └── PDP.xml
│ ├── es-ES
│ │ └── PDP.xml
│ ├── fi-FI
│ │ └── PDP.xml
│ ├── fr-FR
│ │ └── PDP.xml
│ ├── hu-HU
│ │ └── PDP.xml
│ ├── it-IT
│ │ └── PDP.xml
│ ├── ja-JP
│ │ └── PDP.xml
│ ├── ko-KR
│ │ └── PDP.xml
│ ├── nb-NO
│ │ └── PDP.xml
│ ├── nl-NL
│ │ └── PDP.xml
│ ├── pl-PL
│ │ └── PDP.xml
│ ├── pt-BR
│ │ └── PDP.xml
│ ├── pt-PT
│ │ └── PDP.xml
│ ├── qps-ploc
│ │ └── PDP.xml
│ ├── qps-ploca
│ │ └── PDP.xml
│ ├── qps-plocm
│ │ └── PDP.xml
│ ├── ru-RU
│ │ └── PDP.xml
│ ├── sv-SE
│ │ └── PDP.xml
│ ├── tr-TR
│ │ └── PDP.xml
│ ├── zh-CN
│ │ └── PDP.xml
│ └── zh-TW
│ │ └── PDP.xml
└── sbconfig.json
├── test
├── README.md
├── linux
│ └── unit_tests
│ │ ├── Makefile
│ │ ├── auxv.c
│ │ ├── binfmt.c
│ │ ├── brk.c
│ │ ├── build_tests.sh
│ │ ├── cgroup.c
│ │ ├── common.c
│ │ ├── common.h
│ │ ├── dev_pt.c
│ │ ├── dev_pt_2.c
│ │ ├── dev_pt_common.c
│ │ ├── dev_pt_common.h
│ │ ├── drvfs.c
│ │ ├── dup.c
│ │ ├── epoll.c
│ │ ├── eventfd.c
│ │ ├── execve.c
│ │ ├── flock.c
│ │ ├── fork.c
│ │ ├── fscommon.c
│ │ ├── fstab.c
│ │ ├── get_set_id.c
│ │ ├── getaddrinfo.c
│ │ ├── gettime.c
│ │ ├── inotify.c
│ │ ├── interop.c
│ │ ├── ioprio.c
│ │ ├── keymgmt.c
│ │ ├── lxtcommon.h
│ │ ├── lxtevent.c
│ │ ├── lxtevent.h
│ │ ├── lxtfs.c
│ │ ├── lxtfs.h
│ │ ├── lxtlog.c
│ │ ├── lxtlog.h
│ │ ├── lxtmount.c
│ │ ├── lxtmount.h
│ │ ├── lxtutil.c
│ │ ├── lxtutil.h
│ │ ├── madvise.c
│ │ ├── mprotect.c
│ │ ├── mremap.c
│ │ ├── namespace.c
│ │ ├── netlink.c
│ │ ├── overlayfs.c
│ │ ├── pipe.c
│ │ ├── poll.c
│ │ ├── random.c
│ │ ├── resourcelimits.c
│ │ ├── sched.c
│ │ ├── select.c
│ │ ├── sem.c
│ │ ├── shm.c
│ │ ├── socket.c
│ │ ├── socket_nonblock.c
│ │ ├── splice.c
│ │ ├── sysfs.c
│ │ ├── sysinfo.c
│ │ ├── timer.c
│ │ ├── timerfd.c
│ │ ├── tty.c
│ │ ├── ttys.c
│ │ ├── unittests.c
│ │ ├── unittests.h
│ │ ├── user.c
│ │ ├── utimensat.c
│ │ ├── vfsaccess.c
│ │ ├── vnet.c
│ │ ├── waitpid.c
│ │ ├── wslpath.c
│ │ └── xattr.c
└── windows
│ ├── CMakeLists.txt
│ ├── Common.cpp
│ ├── Common.h
│ ├── DrvFsTests.cpp
│ ├── InstallerTests.cpp
│ ├── MountTests.cpp
│ ├── NetworkTests.cpp
│ ├── Plan9Tests.cpp
│ ├── PluginTests.cpp
│ ├── PluginTests.h
│ ├── PolicyTests.cpp
│ ├── SimpleTests.cpp
│ ├── UnitTests.cpp
│ ├── lxsstest.h
│ └── testplugin
│ ├── CMakeLists.txt
│ └── Plugin.cpp
├── tools
├── FormatSource.ps1.in
├── SetupClangFormat.bat
├── bin2cpio
│ ├── CPIOImage.pm
│ └── bin2cpio.pl
├── build-bundle.bat
├── create-dev-cert.ps1
├── deploy
│ ├── deploy-to-host.ps1
│ └── deploy-to-vm.ps1
├── devops
│ ├── create-change.py
│ ├── create-release.py
│ ├── find-release.py
│ ├── requirements.txt
│ ├── validate-copyright-headers.py
│ ├── validate-localization.py
│ └── version_functions.ps1
├── generateLocalizationHeader.ps1
├── hooks
│ └── pre-commit
├── test
│ ├── CloudTest-Setup.bat
│ ├── Microsoft.WSL.TestDistro.nuspec
│ ├── build-test-distro.ps1
│ ├── copy_and_build_tests.ps1
│ ├── copy_tests.ps1
│ ├── gh-release-server.py
│ ├── run-tests.ps1
│ ├── setup-vm-for-tests.ps1
│ ├── test-setup.ps1
│ └── test.bat.in
└── wsl.wprp
└── triage
├── config.yml
├── install-latest-wsl.ps1
└── no-filter.wpaProfile
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # File containing policy for file ownership
2 |
3 | # Reviewers for all files in the repository
4 | * @microsoft/wsl-maintainers
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request / Contribution idea
3 | about: Suggest a feature or improvement for the Windows Subsystem for Linux
4 | title: ''
5 | labels: 'feature'
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
2 | ## Summary of the Pull Request
3 |
4 |
5 | ## PR Checklist
6 |
7 | - [ ] **Closes:** Link to issue #xxx
8 | - [ ] **Communication:** I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
9 | - [ ] **Tests:** Added/updated if needed and all pass
10 | - [ ] **Localization:** All end user facing strings can be localized
11 | - [ ] **Dev docs:** Added/updated if needed
12 | - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/wsl/) and link it here: #xxx
13 |
14 |
15 | ## Detailed Description of the Pull Request / Additional comments
16 |
17 |
18 | ## Validation Steps Performed
19 |
--------------------------------------------------------------------------------
/.github/workflows/distributions.yml:
--------------------------------------------------------------------------------
1 | name: Validate distributions
2 |
3 | on:
4 | pull_request:
5 | paths: ['distributions/**']
6 |
7 | jobs:
8 | check:
9 | name: Validate distributions
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout repo
13 | uses: actions/checkout@v4
14 |
15 | - name: Run validation
16 | run: python distributions/validate.py distributions/DistributionInfo.json
17 | shell: bash
18 |
--------------------------------------------------------------------------------
/.github/workflows/documentation.yml:
--------------------------------------------------------------------------------
1 | name: Build documentation
2 | on:
3 | workflow_dispatch:
4 | push:
5 | branches: [main, master]
6 |
7 | jobs:
8 | DeployDocs:
9 | environment:
10 | name: github-pages
11 | url: ${{ steps.deployment.outputs.page_url }}
12 | runs-on: ubuntu-latest
13 | permissions:
14 | contents: read
15 | pages: write
16 | id-token: write
17 | steps:
18 | - name: Checkout actions
19 | uses: actions/checkout@v4
20 |
21 | - name: Install packages
22 | run: pip install mkdocs-mermaid2-plugin mkdocs --break-system-packages
23 | shell: bash
24 |
25 | - name: Build documentation
26 | run: mkdocs build -f doc/mkdocs.yml
27 | shell: bash
28 |
29 | - uses: actions/upload-pages-artifact@v3
30 | with:
31 | path: doc/site
32 |
33 | - name: Deploy to GitHub Pages
34 | id: deployment
35 | uses: actions/deploy-pages@v4
--------------------------------------------------------------------------------
/.github/workflows/issue_edited.yml:
--------------------------------------------------------------------------------
1 | name: Process edited issue
2 |
3 | on:
4 | workflow_dispatch:
5 | issues:
6 | types: [edited]
7 |
8 | jobs:
9 | wti:
10 | name: Run wti
11 | runs-on: windows-2022
12 | permissions:
13 | issues: write
14 | steps:
15 | - name: Checkout repo
16 | uses: actions/checkout@v4
17 |
18 | - uses: ./.github/actions/triage
19 | with:
20 | issue: "${{ github.event.issue.number }}"
21 | previous_body: "${{ github.event.changes.body.from }}"
22 | token: ${{ secrets.GITHUB_TOKEN }}
--------------------------------------------------------------------------------
/.github/workflows/modern-distributions.yml:
--------------------------------------------------------------------------------
1 | name: Validate tar based distributions
2 |
3 | on:
4 | pull_request:
5 | paths: ['distributions/**']
6 |
7 | jobs:
8 | check:
9 | name: Validate tar based distributions changes
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout repo
13 | uses: actions/checkout@v4
14 | with:
15 | fetch-depth: 0
16 |
17 | - name: Install pip packages
18 | run: pip install -r distributions/requirements.txt
19 | shell: bash
20 |
21 | - name: Run validation
22 | run: |
23 | python distributions/validate-modern.py \
24 | --repo-path . \
25 | --compare-with-branch 'origin/${{ github.base_ref }}' \
26 | --manifest distributions/DistributionInfo.json \
27 |
28 | shell: bash
29 |
--------------------------------------------------------------------------------
/.github/workflows/new_issue.yml:
--------------------------------------------------------------------------------
1 | name: Process new issue
2 |
3 | on:
4 | workflow_dispatch :
5 | issues:
6 | types: [opened]
7 |
8 | jobs:
9 | wti:
10 | name: Run wti
11 | runs-on: windows-2022
12 | permissions:
13 | issues: write
14 | steps:
15 | - name: Checkout repo
16 | uses: actions/checkout@v4
17 |
18 | - uses: ./.github/actions/triage
19 | with:
20 | issue: "${{ github.event.issue.number }}"
21 | token: ${{ secrets.GITHUB_TOKEN }}
--------------------------------------------------------------------------------
/.github/workflows/new_issue_comment.yml:
--------------------------------------------------------------------------------
1 | name: Process new comment on issue
2 |
3 | on:
4 | workflow_dispatch :
5 | issue_comment:
6 | types: [created]
7 |
8 | jobs:
9 | wti:
10 | name: Run wti
11 | runs-on: windows-2022
12 | permissions:
13 | issues: write
14 | if: ${{ !github.event.issue.pull_request && github.event.issue.user.id == github.event.comment.user.id }}
15 | steps:
16 | - name: Checkout repo
17 | uses: actions/checkout@v4
18 |
19 | - uses: ./.github/actions/triage
20 | with:
21 | issue: '${{ github.event.issue.number }}'
22 | comment: '${{ github.event.comment.id }}'
23 | token: ${{ secrets.GITHUB_TOKEN }}
--------------------------------------------------------------------------------
/.github/workflows/winget.yml:
--------------------------------------------------------------------------------
1 | name: Publish to Winget
2 |
3 | on:
4 | release:
5 | types: [released]
6 |
7 | jobs:
8 | publish:
9 | if: github.event.release.prerelease == false
10 | runs-on: windows-latest # Action can only run on Windows
11 | steps:
12 | - name: Publish WSL
13 | run: |
14 |
15 | Set-StrictMode -Version Latest
16 | $ErrorActionPreference = "Stop"
17 |
18 | $assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json
19 | $wingetRelevantAssetx64 = $assets | Where-Object { $_.name -like '*x64.msi' } | Select-Object -First 1
20 | $wingetRelevantAssetARM64 = $assets | Where-Object { $_.name -like '*arm64.msi' } | Select-Object -First 1
21 |
22 | $version = "${{ github.event.release.tag_name }}"
23 |
24 | $wingetx64URL = $wingetRelevantAssetx64.browser_download_url
25 | $wingetARM64URL = $wingetRelevantAssetARM64.browser_download_url
26 |
27 | $wingetPackageId = "Microsoft.WSL"
28 |
29 | & curl.exe -JLO https://aka.ms/wingetcreate/latest
30 | & .\wingetcreate.exe update $wingetPackageId -s -v $version -u "$wingetx64URL|x64" "$wingetARM64URL|arm64" -t "${{ secrets.WINGET_TOKEN }}"
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode/*
2 | .vs/
3 | !vendor/.preserve
4 | out
5 | tmp
6 | /.vs/
7 | /.vscode/
8 | *.sln
9 | *.user
10 | *.csproj
11 | *.vcxproj
12 | *.targets
13 | *.filters
14 | *.pdb
15 | *.lib
16 | *.dll
17 | obj/
18 | Debug/
19 | Release/
20 | Properties/
21 | /_deps/
22 | /package/Strings/en-US/
23 | /packages/
24 | CMakeFiles/
25 | CMakeCache.txt
26 | *.msix
27 | cmake_install.cmake
28 | build_tools/
29 | *_i.c
30 | *_p.c
31 | *_p.c
32 | wslsupport/wslsupport.h
33 | dlldata.c
34 | .gdbinit
35 | llvm/
36 | *.a
37 | *.so
38 | *.o
39 | linux/init/init
40 | linux/init
41 | initrd/init
42 | bin/
43 | *.nupkg
44 | build/
45 | generated/
46 | Microsoft.WSL.PluginApi.nuspec
47 | test/linux/unit_tests/wsl_unit_tests
48 | *.dir/
49 | UserConfig.cmake
50 | *.wix
51 | *.wixobj
52 | *.wixpdb
53 | test.bat
54 | AppxManifest.xml
55 | package_layout/
56 | priconf.xml
57 | resources.map.txt
58 | resources.pri
59 | msi-install-*.txt
60 | kernellogs.txt
61 | FormatSource.ps1
62 | msixinstaller/x64
63 | package/x64
64 | /appx-logs.txt
65 | tools/clang-format.exe
66 | /linux-crashes
67 | doc/site/
--------------------------------------------------------------------------------
/.pipelines/test-stage.yml:
--------------------------------------------------------------------------------
1 | parameters:
2 | - name: rs_prerelease_only
3 | type: boolean
4 | default: false
5 |
6 | - name: pool
7 | type: string
8 | default: ''
9 |
10 | - name: versions
11 | type: object
12 | default:
13 | - wsl1
14 | - wsl2
15 |
16 | - name: test_images
17 | type: object
18 | default:
19 | - name: rs_prerelease
20 | image: rs_prerelease-2025-01-30
21 | - name: ni_release
22 | image: win11-23h2-ent-2024-11-18
23 | - name: fe_release
24 | image: 2022-datacenter-g2-2024-09-10
25 | - name: vb_release
26 | image: win10-22h2-ent-g2-2024-09-10
27 |
28 | # TODO: ge_release
29 |
30 | stages:
31 | - stage: test
32 | dependsOn: [build]
33 | jobs:
34 | - ${{ each version in parameters.versions }}:
35 | - ${{ each image in parameters.test_images }}:
36 | - template: test-job.yml@self
37 | parameters:
38 | branch: "${{ image.name }}"
39 | version: ${{ version }}
40 | image: "${{ image.image }}"
41 | run: ${{ or(not(parameters.rs_prerelease_only), eq(image.name, 'rs_prerelease')) }}
42 | pool: "${{ parameters.pool }}"
--------------------------------------------------------------------------------
/.pipelines/wsl-build-nightly-onebranch.yml:
--------------------------------------------------------------------------------
1 | trigger: none
2 |
3 | schedules:
4 | # "0 8" = 8AM UTC = 12AM PST
5 | - cron: "0 8 * * *"
6 | displayName: Nightly build
7 | branches:
8 | include: [main]
9 | always: true
10 |
11 | variables:
12 | WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest"
13 | WindowsHostVersion: '1ESWindows2022'
14 |
15 | resources:
16 | repositories:
17 | - repository: templates
18 | type: git
19 | name: OneBranch.Pipelines/GovernedTemplates
20 | ref: refs/heads/main
21 |
22 | extends:
23 | template: v2/Microsoft.NonOfficial.yml@templates
24 | parameters:
25 | platform:
26 | name: "windows_undocked"
27 | featureFlags:
28 | EnableCDPxPAT: false
29 | WindowsHostVersion: 1ESWindows2022
30 | globalSdl:
31 | credscan:
32 | enabled: true
33 | perStage:
34 | credscan:
35 | enabled: true
36 | tsa:
37 | enabled: false
38 | git:
39 | fetchDepth: -1
40 | fetchTags: true
41 |
42 | stages:
43 | - template: build-stage.yml@self
44 | parameters:
45 | isRelease: false
46 | isNightly: true
47 | vsoOrg: microsoft
48 | vsoProject: Microsoft.WSL
49 |
50 | - template: test-stage.yml@self
51 | parameters:
52 | rs_prerelease_only: false
--------------------------------------------------------------------------------
/.pipelines/wsl-build-notice.yml:
--------------------------------------------------------------------------------
1 | trigger:
2 | branches:
3 | include:
4 | - master
5 |
6 | pool:
7 | vmImage: 'windows-latest'
8 |
9 | steps:
10 | - checkout : self
11 | persistCredentials: true
12 |
13 | - task: ComponentGovernanceComponentDetection@0
14 | displayName: Component Detection
15 |
16 | - task: notice@0
17 | displayName: Generate NOTICE file
18 | inputs:
19 | outputfile: $(System.DefaultWorkingDirectory)/NOTICE.txt
20 | outputformat: text
21 |
22 | - task: PipAuthenticate@1
23 | inputs:
24 | artifactFeeds: 'wsl'
25 |
26 | - powershell: |
27 | pip install --user -r tools/devops/requirements.txt
28 | python tools/devops/create-change.py . "$env:token" "WSL notice" "Notice change from build: $env:buildId" "user/notice/$env:buildId"
29 |
30 | displayName: Create pull request
31 | env:
32 | token: $(GithubPRToken)
33 | buildId: $(Build.BuildId)
--------------------------------------------------------------------------------
/.pipelines/wsl-build-pr-onebranch.yml:
--------------------------------------------------------------------------------
1 | trigger:
2 | branches:
3 | include:
4 | - master
5 | - release/*
6 |
7 | variables:
8 | WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest"
9 | WindowsHostVersion: '1ESWindows2022'
10 |
11 | resources:
12 | repositories:
13 | - repository: templates
14 | type: git
15 | name: OneBranch.Pipelines/GovernedTemplates
16 | ref: refs/heads/main
17 |
18 | extends:
19 | template: v2/Microsoft.NonOfficial.yml@templates
20 | parameters:
21 | platform:
22 | name: "windows_undocked"
23 | featureFlags:
24 | EnableCDPxPAT: false
25 | WindowsHostVersion: 1ESWindows2022
26 | globalSdl:
27 | suppression:
28 | suppressionFile: $(Build.SourcesDirectory)\.gdnsuppress
29 | suppressionSet: default
30 | apiscan:
31 | enabled: false
32 | credscan:
33 | enabled: true
34 | perStage:
35 | credscan:
36 | enabled: true
37 | policheck:
38 | enabled: true
39 | break: true
40 | severity: Note
41 | git:
42 | fetchDepth: -1
43 | fetchTags: true
44 |
45 | stages:
46 | - template: build-stage.yml@self
47 | parameters:
48 | isRelease: false
49 |
50 | - template: test-stage.yml@self
51 | parameters:
52 | rs_prerelease_only: true
53 |
--------------------------------------------------------------------------------
/.pipelines/wsl-build-pr.yml:
--------------------------------------------------------------------------------
1 | trigger:
2 | branches:
3 | include:
4 | - master
5 | - release/*
6 |
7 | stages:
8 | - template: build-stage.yml@self
9 | parameters:
10 | isRelease: false
11 | pool: 'wsl-build'
12 | vsoOrg: shine-oss
13 | vsoProject: wsl
14 |
15 | - template: test-stage.yml@self
16 | parameters:
17 | rs_prerelease_only: true
18 | pool: server
19 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/DATA_AND_PRIVACY.md:
--------------------------------------------------------------------------------
1 | # WSL data & privacy
2 |
3 | ## Overview
4 |
5 | WSL collects diagnostic data using Windows telemetry, just like other Windows components. You can disable this by opening Windows Settings, navigating to Privacy and Security -> Diagnostics & Feedback and disabling 'Diagnostic data'. You can also view all diagnostic data that you are sending in that menu using the 'View diagnostic data' option.
6 |
7 | For more information please read the [Microsoft privacy statement](https://www.microsoft.com/privacy/privacystatement).
8 |
9 | ## What does WSL collect?
10 |
11 | 1. Usage
12 | - Understanding what features and settings are most often used in WSL helps us make decisions on where to focus our time and energy.
13 | 2. Stability
14 | - Monitoring bugs and system crashes assists us in prioritizing the most urgent issues.
15 | 3. Performance
16 | - Assessing the performance of WSL gives us an understanding of what runtimes / components could be causing slow downs. This supports our commitment in providing you a speedy and effective WSL.
17 |
18 | You can search for WSL telemetry events by looking for calls to `WSL_LOG_TELEMETRY` in the source code of this repository.
--------------------------------------------------------------------------------
/Directory.Build.Props:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | true
5 |
6 |
7 |
8 | true
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Images/LargeTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/LargeTile.scale-100.png
--------------------------------------------------------------------------------
/Images/SettingsOOBECrossOSFileAccess.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBECrossOSFileAccess.gif
--------------------------------------------------------------------------------
/Images/SettingsOOBEDistroManagement.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBEDistroManagement.png
--------------------------------------------------------------------------------
/Images/SettingsOOBEDockerDesktopIntegration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBEDockerDesktopIntegration.png
--------------------------------------------------------------------------------
/Images/SettingsOOBEDockerIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBEDockerIcon.png
--------------------------------------------------------------------------------
/Images/SettingsOOBEFileExplorerIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBEFileExplorerIcon.png
--------------------------------------------------------------------------------
/Images/SettingsOOBEGPUAcceleration.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBEGPUAcceleration.gif
--------------------------------------------------------------------------------
/Images/SettingsOOBEGUIApps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBEGUIApps.png
--------------------------------------------------------------------------------
/Images/SettingsOOBEGeneral.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBEGeneral.png
--------------------------------------------------------------------------------
/Images/SettingsOOBENetworkingIntegration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBENetworkingIntegration.png
--------------------------------------------------------------------------------
/Images/SettingsOOBEVSCodeIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBEVSCodeIcon.png
--------------------------------------------------------------------------------
/Images/SettingsOOBEVSCodeIntegration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SettingsOOBEVSCodeIntegration.png
--------------------------------------------------------------------------------
/Images/SmallTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SmallTile.scale-100.png
--------------------------------------------------------------------------------
/Images/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/Images/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.altform-unplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.altform-unplated_targetsize-256.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.altform-unplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.altform-unplated_targetsize-32.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.targetsize-16.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.targetsize-24.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.targetsize-256.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.targetsize-32.png
--------------------------------------------------------------------------------
/Images/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/Images/StoreLogo.backup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/StoreLogo.backup.png
--------------------------------------------------------------------------------
/Images/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/Images/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/Images/wsl.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/wsl.ico
--------------------------------------------------------------------------------
/Images/wslbw.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/Images/wslbw.ico
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/SUPPORT.md:
--------------------------------------------------------------------------------
1 | # Support
2 |
3 | ## How to file issues and get help
4 |
5 | This project uses [GitHub Issues][gh-issue] to [track bugs][gh-bug] and [feature requests][gh-feature]. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or
6 | feature request as a new Issue.
7 |
8 | For general information on the Windows Subsystem for Linux, including help, tutorials, how-tos and reference guides, please view our [WSL documentation](https://docs.microsoft.com/windows/wsl/).
9 |
10 | ## Microsoft Support Policy
11 |
12 | Technical Support for the use of WSL may also be available from Microsoft’s Customer Support Services (CSS). If you are a Premier or Unified Support customer, you may reach out to your account manager for further assistance. Otherwise, you may visit Microsoft’s [Support For Business site](https://support.serviceshub.microsoft.com/supportforbusiness/create) to [open a new support case for WSL](https://support.serviceshub.microsoft.com/supportforbusiness/create?sapid=9d5af292-506b-63ca-cb2c-7f4eaa380c56).
13 |
14 |
15 | [gh-issue]: https://github.com/microsoft/WSL/issues/new/choose
16 | [gh-bug]: https://github.com/microsoft/WSL/issues/new?assignees=&labels=&template=bug_report.md&title=
17 | [gh-feature]: https://github.com/microsoft/WSL/issues/new?assignees=&labels=feature&template=feature_request.md&title=
18 |
--------------------------------------------------------------------------------
/cgmanifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "$schema": "https://json.schemastore.org/component-detection-manifest.json",
4 | "registrations": [
5 | {
6 | "component": {
7 | "type": "git",
8 | "git": {
9 | "repositoryUrl": "https://github.com/microsoft/GSL",
10 | "commitHash": "0f6dbc9e2915ef5c16830f3fa3565738de2a9230"
11 | }
12 | }
13 | },
14 | {
15 | "component": {
16 | "type": "git",
17 | "git": {
18 | "repositoryUrl": "https://github.com/llvm/llvm-project",
19 | "commitHash": "d32170dbd5b0d54436537b6b75beaf44324e0c28"
20 | }
21 | }
22 | },
23 | {
24 | "component": {
25 | "type": "other",
26 | "other": {
27 | "name": "libarchive",
28 | "version": "3.7.7",
29 | "downloadUrl": "https://github.com/libarchive/libarchive/releases/download/v3.7.7/libarchive-3.7.7.tar.gz",
30 | "hash": "sha1:918692098b11db61aff23684ab04f375e4a68f69"
31 | }
32 | }
33 | }
34 | ]
35 | }
--------------------------------------------------------------------------------
/cloudtest/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(OUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cloudtest)
2 | file(MAKE_DIRECTORY ${OUT})
3 |
4 | if (${TARGET_PLATFORM} STREQUAL x64)
5 | set(CLOUDTEST_IMAGES
6 | "wsl-test-image-rs_prerelease-2025-01-30"
7 | "wsl-test-image-win11-23h2-ent-2024-11-18"
8 | "wsl-test-image-2022-datacenter-g2-2024-09-10"
9 | "wsl-test-image-win10-22h2-ent-g2-2024-09-10")
10 |
11 |
12 | set(CLOUDTEST_TEST_PACKAGES "Test_Packages_2024_02_27")
13 | set(DUMPTOOL_DROP "DumpTool_X64_2025-01-27")
14 | elseif (${TARGET_PLATFORM} STREQUAL arm64)
15 | set(CLOUDTEST_IMAGES)
16 | else()
17 | message(FATAL_ERROR "Unsupported target platform: ${TARGET_PLATFORM}")
18 | endif()
19 |
20 | # Passed down to test-setup.ps1 to determine if -AllowUnsigned should be passed to Add-AppxPackage
21 | if (OFFICIAL_BUILD)
22 | set(ALLOW_UNSIGNED_PACKAGE "0")
23 | else()
24 | set(ALLOW_UNSIGNED_PACKAGE "1")
25 | endif()
26 |
27 | function(add_test_group image version)
28 | set(DIR ${OUT}/${image}-wsl${version})
29 |
30 | file(MAKE_DIRECTORY ${DIR})
31 |
32 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestMap.xml.in ${DIR}/TestMap.xml)
33 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestGroup.xml.in ${DIR}/TestGroup.xml)
34 | endfunction()
35 |
36 | foreach(image ${CLOUDTEST_IMAGES})
37 | add_test_group("${image}" "1")
38 | add_test_group("${image}" "2")
39 | endforeach()
40 |
--------------------------------------------------------------------------------
/cmake/FindMC.cmake:
--------------------------------------------------------------------------------
1 | function(add_mc target mc_file)
2 |
3 | cmake_path(GET mc_file STEM MC_NAME)
4 |
5 | set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}\\${TARGET_PLATFORM}\\${CMAKE_BUILD_TYPE})
6 | set(RC_FILE ${OUTPUT_DIR}/${MC_NAME}.rc)
7 | set(HEADER_FILE ${OUTPUT_DIR}/${MC_NAME}.h)
8 |
9 | add_custom_command(
10 | OUTPUT ${RC_FILE} ${HEADER_FILE} ${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}
11 | COMMAND mc.exe -A -b -c -h ${OUTPUT_DIR} -r ${OUTPUT_DIR} ${mc_file}
12 | COMMAND rc.exe -nologo -fo${OUTPUT_DIR}\\${MC_NAME}.res ${RC_FILE}
13 | COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/${target}"
14 | WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
15 | DEPENDS ${mc_file}
16 | MAIN_DEPENDENCY ${mc_file}
17 | VERBATIM
18 | )
19 |
20 | add_custom_target(${target} DEPENDS ${RC_FILE} SOURCES ${mc_file})
21 |
22 | set_source_files_properties(${RC_FILE} PROPERTIES GENERATED TRUE)
23 | endfunction()
--------------------------------------------------------------------------------
/cmake/findVersion.cmake:
--------------------------------------------------------------------------------
1 | function(get_version_impl command var_name)
2 | execute_process(
3 | COMMAND powershell.exe
4 | -NoProfile
5 | -NonInteractive
6 | -ExecutionPolicy Bypass
7 | -Command "$env:Path += ';${GITVERSION_SOURCE_DIR}' ; . .\\tools\\devops\\version_functions.ps1 ; ${command}"
8 | OUTPUT_VARIABLE OUTPUT_VERSION
9 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
10 | COMMAND_ERROR_IS_FATAL ANY)
11 | string(STRIP "${OUTPUT_VERSION}" OUTPUT_VERSION)
12 | SET(${var_name} ${OUTPUT_VERSION} PARENT_SCOPE)
13 | endfunction()
14 |
15 | function(find_commit_hash var_name)
16 | get_version_impl("Get-Current-Commit-Hash" "command_output")
17 | SET(${var_name} ${command_output} PARENT_SCOPE)
18 | endfunction()
19 |
20 | function(find_version msix_var_name nuget_var_name)
21 | get_version_impl("Get-VersionInfo -Nightly $false | ConvertTo-Json" "command_output")
22 | string(JSON "${msix_var_name}" GET "${command_output}" MsixVersion)
23 | string(JSON "${nuget_var_name}" GET "${command_output}" NugetVersion)
24 |
25 | return(PROPAGATE ${msix_var_name} ${nuget_var_name})
26 | endfunction()
--------------------------------------------------------------------------------
/diagnostics/dump-init-stacks.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 |
3 | set -ue
4 |
5 | for proc in /proc/[0-9]*; do
6 | pid=$(basename "$proc")
7 |
8 | echo -e "\nProcess: $pid"
9 | echo -en "cmd: "
10 | cat "/proc/$pid/cmdline" || true
11 | echo -e "\nstat: "
12 | cat "/proc/$pid/stat" || true
13 |
14 | for tid in $(ls "/proc/$pid/task" || true); do
15 | echo -n "tid: $tid - "
16 | cat "/proc/$pid/task/$tid/comm" || true
17 | cat "/proc/$pid/task/$tid/stack" || true
18 | done
19 |
20 | echo "fds: "
21 | ls -la "/proc/$pid/fd" || true
22 | done
23 |
24 | echo "hvsockets: "
25 | ss -lap --vsock
26 |
27 | echo "meminfo: "
28 | cat /proc/meminfo
--------------------------------------------------------------------------------
/diagnostics/dump-init.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 |
3 | set -ue
4 |
5 | if [ $(whoami) != "root" ]; then
6 | echo "This script must be run as root in the system distro (via wsl.exe -u root --system)"
7 | exit 1
8 | fi
9 |
10 | ts=$(date +%F_%H-%M-%S)
11 | target="/mnt/c/wsl-init-dump-$ts"
12 |
13 | mkdir -p "$target"
14 |
15 | tdnf install -y gdb
16 |
17 | bash -c "cd $target && gcore -a \$(pgrep init)"
18 |
19 | stack_log="$target/stacks.txt"
20 | fd_log="$target/fd.txt"
21 | for pid in $(pgrep init); do
22 | echo -e "\nProcess: $pid" >> "$stack_log"
23 | echo -e "\nProcess: $pid" >> "$fd_log"
24 | for tid in $(ls "/proc/$pid/task" || true); do
25 | echo "tid: $tid" >> "$stack_log"
26 | cat "/proc/$pid/task/$tid/stack" >> "$stack_log" || true
27 | done
28 |
29 | ls -la "/proc/$pid/fd" >> "$fd_log" || true
30 | done
31 |
32 |
33 | ss -lap --vsock > "/$target/sockets.txt"
34 | dmesg > "/$target/dmesg.txt"
35 | cat /proc/meminfo > "/$target/meminfo.txt"
36 |
37 | echo "Logs and dumps written in $target"
38 |
--------------------------------------------------------------------------------
/distributions/requirements.txt:
--------------------------------------------------------------------------------
1 | python-magic==0.4.27
2 | click==8.1.3
3 | GitPython==3.1.41
4 | PyGithub==2.5.0
5 | json-cfg==0.4.2
--------------------------------------------------------------------------------
/doc/README.md:
--------------------------------------------------------------------------------
1 | # WSL open source documentation
2 |
3 | Build instructions:
4 |
5 | ```
6 | $ pip install mkdocs mkdocs-mermaid2-plugin
7 | $ mkdocs serve
8 | ```
9 |
10 | You can then view the documentation at `http://127.0.0.1:8000/`.
--------------------------------------------------------------------------------
/doc/docs/index.md:
--------------------------------------------------------------------------------
1 | # WSL open source documentation
2 |
3 | This site contains the developer documentation for the Windows Subsystem for Linux.
4 |
5 | For user documentation, including installation and configuration, see [https://learn.microsoft.com/windows/wsl/](https://learn.microsoft.com/windows/wsl/).
6 |
7 |
8 | To get started developing (building, testing and deploying), see [Getting started](dev-loop.md).
9 |
10 | To learn more about how WSL works, see [technical documentation](technical-documentation/index.md)
11 |
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/gns.md:
--------------------------------------------------------------------------------
1 | # GNS
2 |
3 | `gns` is a process created by `mini_init`. Its jobs is to configure networking within the WSL2 virtual machine.
4 |
5 | ## Networking configuration
6 |
7 | Networking settings are shared by all WSL2 distributions. While WSL2 is running, `gns` maintains an hvsocket channel to [wslservice.exe](wslservice.exe.md), which is used to send various networking related configurations such as:
8 |
9 | - Interface IP configuration
10 | - Routing table entries
11 | - DNS configuration
12 | - MTU size configuration
13 |
14 | When DNS tunneling is enabled, `gns` is also responsible for replying to DNS requests.
15 |
16 | See `src/linux/init/GnsEngine.cpp` and `src/windows/service/exe/GnsChannel.cpp`
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/localhost.md:
--------------------------------------------------------------------------------
1 | # Localhost
2 |
3 | `localhost` is a WSL2 linux process, created by [mini_init](mini_init.md). Its role is to forward network traffic between the WSL2 virtual machine, and Windows.
4 |
5 |
6 | ## NAT networking
7 |
8 | When `wsl2.networkingMode` is set to NAT, `localhost` will watch for bound TCP ports, and relay the network traffic to Windows via [wslrelay.exe](wslrelay.exe.md)
9 |
10 | ## Mirrored networking
11 |
12 | In mirrored mode, `localhost` register a BPF program to intercept calls to `bind()`, and forward the calls to Windows via [wslservice.exe](wslservice.exe.md) so Windows can route the network traffic directly to the WSL2 virtual machine.
13 |
14 | See `src/linux/localhost.cpp`.
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/plan9.md:
--------------------------------------------------------------------------------
1 | # Plan 9
2 |
3 | Plan9 is a linux process that hosts a plan9 filesystem server for WSL1 and WSL2 distributions. It's created by [init](init.md) in each distribution.
4 |
5 | ## WSL 1
6 |
7 | In WSL1 distributions, `plan9` serves its filesystem through a unix socket, which can then be connected to from Windows.
8 |
9 | ## WSL2
10 |
11 | In WSL2 distributions, `plan9` runs its filesystem through an `hvsocket`
12 |
13 | ## Accessing the distribution files from Windows
14 |
15 | From Windows, a special redirector driver (p9rdr.sys) registers both `\\wsl$` and `\\wsl.localhost`. When either of those paths are accessed, `p9rdr.sys` calls [wslservice.exe](wslservice.exe.md) to list the available distributions for a given Windows users.
16 |
17 | When a distribution path is accessed (like `\\wsl.localhost\debian`), `p9rdr.sys` calls into [wslservice.exe](wslservice.exe.md) via COM to start the distribution, and connect to its plan9 server, which allows the files to be accessed from Windows.
18 |
19 | See `src/linux/init/plan9.cpp`
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/relay.md:
--------------------------------------------------------------------------------
1 | # Relay
2 |
3 | Relay is a WSL2 linux process creating by a [session leader](session-leader.md). Its job is to create a linux process on behalf of the user, and relay its output back to Windows.
4 |
5 | ## Creating a user process
6 |
7 | A relay is created when a `LxInitMessageCreateProcessUtilityVm` message is sent to a [session leader](session-leader.md). Once created, the `relay` creates multiple `hvsocket` channels with [wslservice.exe](wslservice.exe.md).
8 |
9 | These channels are used to:
10 |
11 | - Relay standard file descriptors (stdin, stdout, stderr)
12 | - Relay information about the terminal (for instance when the terminal window is resized from Windows)
13 | - Notify Windows when the linux process exits
14 |
15 | Once those channels are configured, the `relay` forks() into two processes:
16 |
17 | - The parent, which will read & write to the child's standard file descriptors and relay it to Windows
18 | - The child, which calls `exec()` and starts the user process
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/session-leader.md:
--------------------------------------------------------------------------------
1 | # Session leader
2 |
3 | A session leader is a linux process, which is forked from [init](init.md) after receiving a `LxInitMessageCreateSession` message (see `src/linux/init.cpp`)
4 |
5 | ## Creating linux processes
6 |
7 | Session leaders are used to create linux processes on behalf of the user. Each linux session leader is associated to a Windows console.
8 |
9 | To create a user process, [wslservice.exe](wslservice.exe.md) sends a `LxInitMessageCreateProcess` message (WSL1) or a `LxInitMessageCreateProcessUtilityVm` message (WSL2), which contains details about the process to create such as:
10 |
11 | - Command line
12 | - Current directory
13 | - Environment variables
14 | - User name
15 |
16 | ### Creating a WSL1 process
17 |
18 | When running in a WSL1 distribution, the session leader forks(), and uses the child process to `exec()` into the user linux process. Before calling `exec()`, child configures various settings such as:
19 |
20 | - The user and group id
21 | - The current directory
22 | - The standard file descriptors (stdin, stdout, stderr)
23 |
24 | ## Creating a WSL2 process
25 |
26 | When running in a WSL2 distribution, the session leaders forks() to create a [relay](relay.md) process, which is responsible for creating the user process and relaying its output back to [wsl.exe](wsl.exe.md)
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/systemd.md:
--------------------------------------------------------------------------------
1 | # Systemd
2 |
3 | Systemd support for a WSL distribution can be enabled by setting the following in `/etc/wsl.conf`:
4 |
5 | ```
6 | [boot]
7 | systemd=true
8 | ```
9 |
10 | When enabled, [init](init.md) will take launch `/sbin/init` (which points to systemd's init) when the distribution starts. One key difference when this setting is enabled is that [init](init.md) won't be pid 1 in the given distribution, since systemd's init requires running as pid 1, so [init](init.md) will fork(), and launch systemd in the parent while continuing WSL configuration in the child process.
11 |
12 | After launching `/sbin/init`, [init](init.md) waits for systemd to be ready by waiting for `systemctl is-system-running` to return either `running`, or `degraded`. After a given amount of time, WSL will time out and allow the distribution to continue starting, even if systemd isn't ready.
13 |
14 | ## User sessions
15 |
16 | When systemd is enabled, WSL tries synchronizes launching processes with systemd user sessions. This is currently done by launching `login -f ` to start the associated systemd user session.
17 |
18 | ## Additional systemd configuration
19 |
20 | To improve compatibility with systemd, WSL creates various systemd configuration files during boot (under `/run`). These configurations files are used to:
21 |
22 | - Protect the WSL [binfmt interpret](interop.md) from being deleted by `systemd-binfmt.service`
23 | - Protect the X11 socket from being deleted by `systemd-tmpfiles.serviceè
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/wsl.exe.md:
--------------------------------------------------------------------------------
1 | # wsl.exe
2 |
3 | wsl.exe is main command line entrypoint from WSL. Its job is to:
4 |
5 | - Parse the command line arguments (See `src/windows/common/wslclient.cpp`)
6 | - Call [wslservice.exe](wslservice.exe.md) via COM to launch WSL (see `src/windows/common/svccomm.cpp`)
7 | - Relay stdin / stdout / stderr from and to the linux process
8 |
9 |
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/wslconfig.exe.md:
--------------------------------------------------------------------------------
1 | # Wslconfig.exe
2 |
3 | `wslconfig.exe` is a Windows executable that can be used to configure WSL distributions.
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/wslg.exe.md:
--------------------------------------------------------------------------------
1 | # Wslg.exe
2 |
3 | `wslg.exe` is a Windows executable that is used mostly to run graphical applications with WSL.
4 |
5 | Its behavior is exactly the same as [wsl.exe](wsl.exe.md) with the difference that it's a win32 application, and not a console application, which allows it to start without a creating a console.
6 |
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/wslhost.exe.md:
--------------------------------------------------------------------------------
1 | # Wslhost.exe
2 |
3 | `wslhost.exe` is a Windows executable that's used to display desktop notifications, and run Linux processes in the background.
4 |
5 | ## COM server
6 |
7 | When running as COM server, `wslhost.exe` registers a [NotificationActivatorFactory](https://learn.microsoft.com/dotnet/api/microsoft.toolkit.uwp.notifications.notificationactivator?view=win-comm-toolkit-dotnet-7.1), which is then used to display desktop notifications to the user.
8 |
9 | Notifications can be used to:
10 |
11 | - Notify the user about a WSL update
12 | - Warn the user about a configuration error
13 | - Notify the user about a proxy change
14 |
15 | See: `src/windows/common/notifications.cpp`
16 |
17 | ## Background processes
18 |
19 | When [wsl.exe](wsl.exe.md) terminates before the associated Linux processes terminates, `wslhost.exe` takes over the lifetime of the Linux process.
20 |
21 | This allows Linux processes to keep running Windows commands and access the terminal even after the associated `wsl.exe` terminates.
22 |
23 | See `src/windows/wslhost/main.cpp` and [interop](interop.md)
--------------------------------------------------------------------------------
/doc/docs/technical-documentation/wslrelay.exe.md:
--------------------------------------------------------------------------------
1 | # Wslrelay.exe
2 |
3 | `wslrelay.exe` is a windows executable that is used to relay network and debug console traffic from Linux to Windows.
4 |
5 | It is responsible for:
6 |
7 | - Relaying localhost traffic between Linux and Windows in NAT mode (see [localhost](localhost.md))
8 | - Displaying the debug console output when `wsl2.debugConsole` is set to `true`
9 |
10 | See `src/windows/wslrelay/main.cpp`
--------------------------------------------------------------------------------
/img/networkinglog1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/img/networkinglog1.gif
--------------------------------------------------------------------------------
/img/networkinglog2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/img/networkinglog2.gif
--------------------------------------------------------------------------------
/img/networkinglog3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/img/networkinglog3.gif
--------------------------------------------------------------------------------
/img/networkinglog4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/WSL/a630dbc613e264e1c14e1551f7737893640e6cef/img/networkinglog4.gif
--------------------------------------------------------------------------------
/localization/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LOCALIZATION_PS1 ${PROJECT_SOURCE_DIR}/tools/generateLocalizationHeader.ps1)
2 | set (MESSAGESHEAD ${GENERATED_DIR}/Localization.h)
3 | add_custom_command(
4 | OUTPUT ${MESSAGESHEAD} ${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/localization
5 | COMMAND powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive ${LOCALIZATION_PS1} -OutFile ${MESSAGESHEAD}
6 | COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/CmakeFiles/localization"
7 | DEPENDS ${CMAKE_CURRENT_LIST_DIR}/strings/en-US/Resources.resw ${LOCALIZATION_PS1} # Make sure the head file is rebuilt if any of the resources change
8 | VERBATIM
9 | )
10 |
11 | add_custom_target(localization DEPENDS ${MESSAGESHEAD} ${LOCALIZATION_PS1} SOURCES ${CMAKE_CURRENT_LIST_DIR}/strings/en-US/Resources.resw)
--------------------------------------------------------------------------------
/msixgluepackage/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_appx_target(msixgluepackage
2 | "wsl.exe"
3 | "${CMAKE_CURRENT_LIST_DIR}/AppxManifest.in"
4 | "${BIN}/gluepackage.msix"
5 | "wsl")
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/nuget/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(NUGET_PACKAGES Microsoft.WSL.PluginApi.nuspec)
2 |
3 | # generate vars with native paths since nuget won't accept unix path separators
4 | cmake_path(NATIVE_PATH CMAKE_SOURCE_DIR CMAKE_SOURCE_DIR_NATIVE)
5 | cmake_path(NATIVE_PATH CMAKE_BINARY_DIR CMAKE_BINARY_DIR_NATIVE)
6 |
7 | foreach(PACKAGE ${NUGET_PACKAGES})
8 | configure_file("${CMAKE_CURRENT_LIST_DIR}/${PACKAGE}.in" "${CMAKE_BINARY_DIR}/${PACKAGE}")
9 | endforeach()
--------------------------------------------------------------------------------
/nuget/Microsoft.WSL.PluginApi.nuspec.in:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Microsoft.WSL.PluginApi
5 | ${WSL_NUGET_PACKAGE_VERSION}
6 | Microsoft
7 | https://github.com/microsoft/WSL
8 | WSL Plugin Interface
9 | © Microsoft Corporation. All rights reserved.
10 | images\icon.png
11 | docs\README.MD
12 | WSL
13 | en-us
14 | MIT
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/nuget/README.WslPluginApi.MD:
--------------------------------------------------------------------------------
1 | # WSL plugin api
2 |
3 | This package contains the `WslPluginApi.h` header which defines the WSL plugin interface.
4 |
5 | For more details, see: https://learn.microsoft.com/windows/wsl/ .
--------------------------------------------------------------------------------
/src/linux/inc/seccomp_defs.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) Microsoft Corporation. All rights reserved.
2 |
3 | // This file defines all the seccomp structures and constants that aren't available in the sdk yet
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | // From include\asm\unist_32.h
10 | // Read socketcall.2, there is no socketcall systemcall on x86_64 systems.
11 | // You will not get this value with the standard defines.
12 | #define I386_NR_socketcall (102)
13 | #define ARMV7_NR_bind (282)
14 |
--------------------------------------------------------------------------------
/src/linux/init/DnsTunnelingManager.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) Microsoft Corporation. All rights reserved.
2 |
3 | #pragma once
4 |
5 | #include "DnsTunnelingChannel.h"
6 | #include "DnsServer.h"
7 |
8 | class DnsTunnelingManager
9 | {
10 | public:
11 | DnsTunnelingManager(int hvsocketFd, const std::string& dnsTunnelingIpAddress);
12 | ~DnsTunnelingManager();
13 |
14 | DnsTunnelingManager(const DnsTunnelingManager&) = delete;
15 | DnsTunnelingManager(DnsTunnelingManager&&) = delete;
16 | DnsTunnelingManager& operator=(const DnsTunnelingManager&) = delete;
17 | DnsTunnelingManager& operator=(DnsTunnelingManager&&) = delete;
18 |
19 | private:
20 | // Hvsocket channel used to communicate with the host.
21 | DnsTunnelingChannel m_dnsChannel;
22 |
23 | // DNS server used for tunneling, supporting both UDP and TCP.
24 | DnsServer m_dnsServer;
25 |
26 | std::atomic m_stopped = false;
27 | };
28 |
--------------------------------------------------------------------------------
/src/linux/init/SecCompDispatcher.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) Microsoft Corporation. All rights reserved.
2 |
3 | #pragma once
4 |
5 | #include
6 | #include