Search notes:

Registry: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss stores some values related to a Windows Subsystem for Linux installation:
DefaultDistribution A GUID whose value is refers to the subkey (see below) of the default WSL distribution (i. e. the distribution that is started by executing wsl.exe without -d).
NatIpAddress The IP address with which the host can access WSL (for example when a WSL distribution is running a web server). Because the same IP address is used for all distributions, it implies that different distributions cannot share the same listening IP port.

Subkeys

Each subkey of HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss contains the information about a WSL distribution.
The name of the subkeys are GUIDs.
It's possible to change the name of a WSL distribution by assigning the new name to the value of DistributionName in the respective subkey.

Showing currently installed distributions

The following PowerShell script iterates over the installed WSL distributions and prints the associated information stored in the registry.
$wsl_user = get-item 'hkcu:\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss'

$def_distro_guid = $wsl_user.GetValue('DefaultDistribution')
$def_vers        = $wsl_user.GetValue('DefaultVersion')

"Default version: $def_vers"

foreach ($distro_guid in $wsl_user.GetSubKeyNames()) {

   ''

   $distro = $wsl_user.OpenSubKey($distro_guid)

   $distro.GetValue('DistributionName')   

   if ($distro_guid -eq $def_distro_guid) {
     "  This is the default distribution"
   }

   "  Version:        $($distro.GetValue('Version'          ))"
   "  Base Path:      $($distro.GetValue('BasePath'         ))"
   "  Package Family: $($distro.GetValue('PackageFamilyName'))"
   "  State:          $($distro.GetValue('State'            ))"
   "  Default UID:    $($distro.GetValue('DefaultUid'       ))"
   "  Flags:          $($distro.GetValue('Flags'            ))"

   $def_env = $distro.GetValue('DefaultEnvironment')
   "  Default Environment:"
   foreach ($env in $def_env.Split()) {
   '    {0,-10} = {1}' -f ($env.Split('='))
   }

   $distro.Close()
}
The output might look like
kali-linux
  This is the default distribution
  Version:        2
  Base Path:      C:\Users\Rene\AppData\Local\Packages\KaliLinux.54290C8133FEE_ey8k8hqnwqnmg\LocalState
  Package Family: KaliLinux.54290C8133FEE_ey8k8hqnwqnmg
  State:          1
  Default UID:    1000
  Flags:          15
  Default Environment:
    HOSTTYPE   = x86_64
    LANG       = en_US.UTF-8
    PATH       = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
    TERM       = xterm-256color

Debian
  Version:        2
  Base Path:      C:\Users\Rene\AppData\Local\Packages\TheDebianProject.DebianGNULinux_76v4gfsz19hv4\LocalState
  Package Family: TheDebianProject.DebianGNULinux_76v4gfsz19hv4
  State:          1
  Default UID:    1000
  Flags:          15
  Default Environment:
    HOSTTYPE   = x86_64
    LANG       = en_US.UTF-8
    PATH       = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
    TERM       = xterm-256color

See also

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss
Windows Subsystem for Linux

Index