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.
Info
The path to the WSLg system distribution is defined by the wsl2.systemDistro setting in the .wslconfig configuration file.
Built-in kernel¶
An absolute Windows path to the built-in WSL kernel location
Info
The path to the built-in kernel is defined by the wsl2.kernel setting in the .wslconfig configuration file.
Built-in kernel modules¶
An absolute Windows path to the built-in WSL kernel modules location
Info
The path to the built-in kernel modules is defined by the wsl2.kernelModules setting in the .wslconfig configuration file.
.wslconfig¶
An absolute Windows path to the global WSL 2 configuration file.
Info
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.
Info
The path to the instances installation folder is defined by the general.distributionInstallPath setting in the .wslconfig configuration file.
Crash dumps¶
An absolute Windows path to the default crash dumps folder.
Info
The path to the crash dumps folder is defined by the wsl2.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.
Info
WSL VM ID – an unique identifier for each WSL launch.
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.
Info
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.
Info
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).
Info
- The path to the OOBE script location is specific to each distribution family and is defined by the
oobe.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.
Info
The path to the icon location is specific to each distribution family and is defined by the shortcut.icon setting in the wsl-distribution.conf configuration file.
Windows Terminal profile¶
An absolute Linux path to the Windows Terminal profile template.
Info
The path to the terminal-profile.json location is specific to each distribution family and is defined by the windowsterminal.ProfileTemplate setting in the wsl-distribution.conf configuration file.
cloud-init¶
An absolute Linux path to the cloud-init WSL data-source configuration file.
Info
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> | Out-of-Box Experience script |
| Linux | /usr/share/wsl/<DistroIcon>.ico | Start Menu and Windows Terminal icon |
| Linux | /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 |
Info
<UserName>– username of the current Windows user.WSL VM ID– an unique identifier for each WSL launch.