Warning: The following information is not entirely officially documented because the question deals with "manual installation" of distribution in WSL. Hence the procedure may be little different in future Windows 10 releases.
To understand it first we need to know what is the difference between installing distribution through Windows Store and manually. Think Windows Store as a package manager in Windows. It monitors all the packages installed, uninstalled, updated etc. So, there is a list of installed apps in Settings menu. When the distribution is installed it comes as an Appx package (ZIP archive). That package contains a rootfs tarball (GZIP tar file) of that distribution (example install.tar.gz
), a launcher executable (example ubuntu.exe
) and some other stuffs.
When that launcher is first executed it extracts the tarball (like tar -xf
command) and makes a registry entry in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{GUID}
registry key. This registry key is important which provides where the distribution is installed, default user etc.
When the distribution is installed manually this same registry key is created but with different basepath and others. As this manual procedure does not comes through Windows Store, it is not listed in Settings app. But wsl.exe --list --all
command can show all the installed distribution in WSL. In this way, we do not get the launcher executable but we can do all the stuffs with wsl.exe
.
How can we reset from 'bad state'? If you are familiar with UNIX world assume distributions in WSL as in chroot-ed environment. Always backup a WSL distribution. As usual in real Debian based distributions we generally run these commands to fix packages:
sudo dpkg –configure -a
sudo apt update –fix-missing
sudo apt install -f
If those can not fix the issue uninstall and reinstall may fix it. You may like to backup the /home
folder with tar -czf
because most of the user specific configurations are saved there. Next uninstall the distribution with wsl.exe --unregister <Distribution Name>
command. The backup may be important to users because the previous command removes the whole root folder aka. /
. Now you can install a new distribution and extract the previous /home
backup folder with tar -xf
as usual.