Skip to content

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.

C:\Program Files\WSL

WSLg distribution

An absolute Windows path to the default WSLg diribution location.

C:\Program Files\WSL\system.vhd

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

C:\Program Files\WSL\tools\kernel

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

C:\Program Files\WSL\tools\modules.vhd

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.

C:\Users\<UserName>\.wslconfig

Info

More information about the configuration is available on the reference .wslconfig page.

.wslgconfig

An absolute Windows path to the WSLg configuration file.

C:\Users\<UserName>\.wslgconfig
An absolute Windows path to the WSLg configuration file (alternative path).

C:\ProgramData\Microsoft\wsl\.wslgconfig

Instance

An absolute Windows path to the default instance installation folder.

C:\Users\<UserName>\AppData\Local\wsl\<Distribution ID>

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.

C:\Users\<UserName>\AppData\Local\Temp\wsl-crashes

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.

C:\Users\<UserName>\.cloud-init

Ubuntu Pro for WSL

An absolute Windows path to the Ubuntu Pro for WSL configuration files and logs folder.

C:\Users\<UserName>\.ubuntupro

swap

An absolute Windows path to the default swap file location.

C:\Users\<UserName>\AppData\Local\Temp\<WSL VM ID>\swap.vhdx

Info

WSL VM ID – an unique identifier for each WSL launch.

Tip

To get the WSL VM ID, use this command within the instance:

wslinfo --vm-id

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.

/etc/wsl.conf

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.

/etc/wsl-distribution.conf

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).

/usr/lib/wsl/<oobe-script>

Info

  • The path to the OOBE script location is specific to each distribution family and is defined by the oobe.command setting in the wsl-distribution.conf configuration 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.

/usr/share/wsl/<DistroIcon>.ico

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.

/usr/share/wsl/terminal-profile.json

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.

/etc/cloud/cloud.cfg.d/99_wsl.cfg

Info

By default, the cloud-init data source configuration file is present only in Ubuntu family distributions.

Summary table

LocationPathDescription
WindowsC:\Program Files\WSLWSL installation folder
WindowsC:\Program Files\WSL\system.vhdDefault WSLg diribution location
WindowsC:\Program Files\WSL\tools\kernelBuilt-in WSL kernel location
WindowsC:\Program Files\WSL\tools\modules.vhdBuilt-in WSL kernel modules location
WindowsC:\Users\<UserName>\.wslconfigGlobal WSL 2 configuration
WindowsC:\Users\<UserName>\.wslgconfigGlobal WSLg configuration
WindowsC:\ProgramData\Microsoft\WSL\.wslgconfigGlobal WSLg configuration (alternative)
WindowsC:\Users\<UserName>\AppData\Local\wsl\<Instance ID>Default instance installation folder
WindowsC:\Users\<UserName>\AppData\Local\Temp\wsl-crashesDefault crash dumps folder
WindowsC:\Users\<UserName>\.cloud-initcloud-init configurations folder
WindowsC:\Users\<UserName>\.ubuntupro\Ubuntu Pro for WSL configurations folder
WindowsC:\Users\<UserName>\AppData\Local\Temp\<WSL VM ID>\swap.vhdxDefault swap file location
Linux/etc/wsl.confPer-instance configuration file
Linux/etc/wsl-distribution.confPer-distribution configuration
Linux/usr/lib/wsl/<oobe-script>Out-of-Box Experience script
Linux/usr/share/wsl/<DistroIcon>.icoStart Menu and Windows Terminal icon
Linux/usr/share/wsl/terminal-profile.jsonWindows Terminal profile template
Linux/etc/cloud/cloud.cfg.d/99_wsl.cfgcloud-init WSL data-source configuration

Info

  • <UserName> – username of the current Windows user.
  • WSL VM ID – an unique identifier for each WSL launch.