WSL Registry Key for Default Linux Distributions

The Windows Subsystem for Linux (WSL) manages its configurations and installed distributions through specific entries in the Windows Registry. This article identifies the exact registry key used by Windows to store WSL distribution data, details how the default distribution is tracked, and explains the primary configuration values contained within the registry.

The WSL Registry Location

The configuration data for WSL and its installed distributions is stored under the following Registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss

How the Default Distribution is Configured

Within the Lxss key, Windows manages the default distribution using a specific string value:

The GUID stored in DefaultDistribution corresponds to one of the subkeys directly beneath the Lxss folder.

Distribution Configuration Subkeys

Each installed distribution has its own subkey under Lxss named after its assigned GUID. Inside each GUID subkey, you will find the following configuration values:

Viewing and Managing the Keys

To inspect these settings manually:

  1. Press Win + R, type regedit, and press Enter.
  2. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss.
  3. Select the Lxss key to view the DefaultDistribution GUID, or select individual GUID subkeys to view the configuration of specific distributions.

While you can modify these values directly in the Registry Editor, the recommended way to change the default distribution is via the command line using:

wsl --set-default <DistributionName>