Throwing out a theory here, based on a comment in a related Github thread.
A few things to check and try:
This error has been known to occur after a distribution gets "partially" installed. From PowerShell (as a regular, non-admin user), try running:
wsl --version
If it returns an Ubuntu distribution (and you aren't able to access it), run:
# WARNING: Destructive operation. Only run to complete remove failed distribution.
wsl --unregister <distroname>
If, however wsl -l -v
doesn't return any distributions, try running the following, still from the same PowerShell:
Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss\ |
ForEach-Object {
(Get-ItemProperty $_.PSPATH) | Select-Object DistributionName,BasePath
} | Format-List
If that command returns a distribution that wasn't shown in wsl -l -v
, then you are probably facing the issue mentioned in that Github thread. In that case, while I typically don't like to recommend registry hacks, I think your best bet is to:
- Run
regedit
- Check the registry for any keys under
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\
- Export those keys (as a safeguard)
- Delete them from the registry
Of course, there's no guarantee that, if the installation failed once, it won't fail again, but let's start with trying to correct the issue at hand.