[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{your-alpine-distro-uuid}]
"State"=dword:00000001
"DistributionName"="Alpine"
"Version"=dword:00000001
"BasePath"="C:\\Users\\YourUserName\\AppData\\Local\\Packages\\36828agowa338.AlpineWSL_my43bytk1c4nr\\LocalState"
"Flags"=dword:00000007
"DefaultUid"=dword:000003e8
"PackageFamilyName"="36828agowa338.AlpineWSL_my43bytk1c4nr"
"KernelCommandLine"="BOOT_IMAGE=/kernel init=/init"
"DefaultEnvironment"=hex(7):48,00,4f,00,53,00,54,00,54,00,59,00,50,00,45,00,3d,\
00,78,00,38,00,36,00,5f,00,36,00,34,00,00,00,4c,00,41,00,4e,00,47,00,3d,00,\
65,00,6e,00,5f,00,55,00,53,00,2e,00,55,00,54,00,46,00,2d,00,38,00,00,00,50,\
00,41,00,54,00,48,00,3d,00,2f,00,75,00,73,00,72,00,2f,00,6c,00,6f,00,63,00,\
61,00,6c,00,2f,00,73,00,62,00,69,00,6e,00,3a,00,2f,00,75,00,73,00,72,00,2f,\
00,6c,00,6f,00,63,00,61,00,6c,00,2f,00,62,00,69,00,6e,00,3a,00,2f,00,75,00,\
73,00,72,00,2f,00,73,00,62,00,69,00,6e,00,3a,00,2f,00,75,00,73,00,72,00,2f,\
00,62,00,69,00,6e,00,3a,00,2f,00,73,00,62,00,69,00,6e,00,3a,00,2f,00,62,00,\
69,00,6e,00,3a,00,2f,00,75,00,73,00,72,00,2f,00,67,00,61,00,6d,00,65,00,73,\
00,3a,00,2f,00,75,00,73,00,72,00,2f,00,6c,00,6f,00,63,00,61,00,6c,00,2f,00,\
67,00,61,00,6d,00,65,00,73,00,00,00,54,00,45,00,52,00,4d,00,3d,00,78,00,74,\
00,65,00,72,00,6d,00,2d,00,32,00,35,00,36,00,63,00,6f,00,6c,00,6f,00,72,00,\
00,00,00,00
--
ASCII version of DefaultEnvironment:
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
Bug
WSL stores information about distros in the registry under
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{your-distro-uuid}; however,wsl --importandwsl --exportdo not save/restore these keys. Canmove-wslpreserve this information?Example
After running the command line
to quickly copy the
Alpinedistro, the new registry entry for theAlpine1copy has only a minimal set of keys and itsDefaultUidhas been changed to0(root):The original
Alpinedistro has more details including aKernelCommandLineandDefaultEnvironmentas well asDefaultUid=dword:000003e8 (1000)(regular user):Issue #3974 from the microsoft/WSL repository has more details about how to workaround this issue in Powershell.
Script version:
Edit: How to find values
These commands provide values for
DefaultUid,KernelCommandLine, andDefaultEnvironment: