Paths¶
This section provides all WSL-related folders, files and configuration paths in Windows and Linux.
Windows¶
This subsection describes all folders, files and configuration paths used by WSL environment in Windows.
WSL¶
An absolute Windows path to the WSL installation folder.
WSLg distribution¶
An absolute Windows path to the default WSLg diribution location.
The path to the WSLg system distribution is defined by the systemDistro setting in the .wslconfig configuration file.
Built-in kernel¶
An absolute Windows path to the built-in WSL kernel location
The path to the built-in kernel is defined by the kernel setting in the .wslconfig configuration file.
Built-in kernel modules¶
An absolute Windows path to the built-in WSL kernel modules location
The path to the built-in kernel modules is defined by the kernelModules setting in the .wslconfig configuration file.
.wslconfig¶
An absolute Windows path to the global WSL 2 configuration file.
More information about the configuration is available on the reference .wslconfig page.
.wslgconfig¶
An absolute Windows path to the WSLg configuration file.
An absolute Windows path to the WSLg configuration file (alternative path).Instance¶
An absolute Windows path to the default instance installation folder.
The path to the instances installation folder is defined by the distributionInstallPath setting in the .wslconfig configuration file.
Crash dumps¶
An absolute Windows path to the default crash dumps folder.
The path to the crash dumps folder is defined by the crashDumpFolder setting in the .wslconfig configuration file.
cloud-init¶
An absolute Windows path to the cloud-init configuration files folder.
Ubuntu Pro for WSL¶
An absolute Windows path to the Ubuntu Pro for WSL configuration files and logs folder.
swap¶
An absolute Windows path to the default swap file location.
WSL VM ID – an unique identifier for each WSL launch.
To get the WSL VM ID, use this command within the instance:
Linux¶
This subsection describes all folders and configuration paths used by WSL environment in Linux.
wsl.conf¶
An absolute Linux path to the per-instance configuration file.
More information about the configuration is available on the reference wsl.conf page.
wsl-distribution.conf¶
An absolute Linux path to the per-distribution configuration file.
More information about the configuration is available on the reference wsl-distribution.conf page
OOBE script¶
An absolute Linux path to the Out-of-Box Experience script (OOBE script).
Or
- The name and the path to the OOBE script location is specific to each distribution family and is defined by the
commandsetting in thewsl-distribution.confconfiguration file. - More information about the Out-of-Box Experience script is available on the reference OOBE script page.
Start Menu and Windows Terminal icon¶
An absolute Linux path to the Start Menu and to the Windows Terminal icon.
Or
The name and the path to the icon location is specific to each distribution family and is defined by the icon setting in the wsl-distribution.conf configuration file.
Windows Terminal profile¶
An absolute Linux path to the Windows Terminal profile template.
Or
The path to the terminal-profile.json location is specific to each distribution family and is defined by the ProfileTemplate setting in the wsl-distribution.conf configuration file.
cloud-init¶
An absolute Linux path to the cloud-init WSL data-source configuration file.
By default, the cloud-init data source configuration file is present only in Ubuntu family distributions.
Summary table¶
| Location | Path | Description |
|---|---|---|
| Windows | C:\Program Files\WSL | WSL installation folder |
| Windows | C:\Program Files\WSL\system.vhd | Default WSLg diribution location |
| Windows | C:\Program Files\WSL\tools\kernel | Built-in WSL kernel location |
| Windows | C:\Program Files\WSL\tools\modules.vhd | Built-in WSL kernel modules location |
| Windows | C:\Users\<UserName>\.wslconfig | Global WSL 2 configuration |
| Windows | C:\Users\<UserName>\.wslgconfig | Global WSLg configuration |
| Windows | C:\ProgramData\Microsoft\WSL\.wslgconfig | Global WSLg configuration (alternative) |
| Windows | C:\Users\<UserName>\AppData\Local\wsl\<Instance ID> | Default instance installation folder |
| Windows | C:\Users\<UserName>\AppData\Local\Temp\wsl-crashes | Default crash dumps folder |
| Windows | C:\Users\<UserName>\.cloud-init | cloud-init configurations folder |
| Windows | C:\Users\<UserName>\.ubuntupro\ | Ubuntu Pro for WSL configurations folder |
| Windows | C:\Users\<UserName>\AppData\Local\Temp\<WSL VM ID>\swap.vhdx | Default swap file location |
| Linux | /etc/wsl.conf | Per-instance configuration file |
| Linux | /etc/wsl-distribution.conf | Per-distribution configuration |
| Linux | /usr/lib/wsl/<oobe-script> or /usr/share/wsl/<oobe-script> | Out-of-Box Experience script |
| Linux | /usr/lib/wsl/<DistroIcon>.ico or /usr/share/wsl/<DistroIcon>.ico | Start Menu and Windows Terminal icon |
| Linux | /usr/share/wsl/terminal-profile.json or /usr/share/wsl/terminal-profile.json | Windows Terminal profile template |
| Linux | /etc/cloud/cloud.cfg.d/99_wsl.cfg | cloud-init WSL data-source configuration |