Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 is deleted by itself after registry edited #7955

Closed
1 of 2 tasks
fengdasuk19 opened this issue Jan 21, 2022 · 2 comments
Closed
1 of 2 tasks

WSL2 is deleted by itself after registry edited #7955

fengdasuk19 opened this issue Jan 21, 2022 · 2 comments

Comments

@fengdasuk19
Copy link

Version

10.0.19042.1466

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.4.72

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

Open Regedit, direct to the following location as this comment says:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{GUID}\

Double click the variable Flags, edit its value to 5 or 7, click OK to confirm.

Expected Behavior

The WSL runs normally as usual, and environment variable PATH under WSL will not read PATH value defined under Windows.

Actual Behavior

The WSL process running before just exits with error code 1.

I try to start WSL but fail. My terminal emulator (Microsoft Windows Terminal) only gives me error code 4294967295.

I check the registry location mentioned above a.k.a. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{GUID}\, only to find nothing but a variable DefaultVersion with type REG_DWORD and value 0x2.

I check the Windows path C:\Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState and find this directory is empty now.

Another user has encountered the same problem as me before. @iuliandita

Diagnostic Logs

wsl.zip

@fengdasuk19 fengdasuk19 changed the title WSL2 is deleted after registry edited WSL2 is deleted by itself after registry edited Jan 21, 2022
@eqn-group
Copy link

check #5092 and #4929

@OneBlue
Copy link
Collaborator

OneBlue commented Jan 25, 2022

Thanks for reporting this @fengdasuk19.

Looking at the logs it looks like the registry settings are indeed corrupted, so WSL fails to start the default distribution.
The easiest would be to back up the Lxss key, then copy any distribution vhdx that might want to keep, then uninstall the distribution apps and re-register your WSL distributions again.

That should reset's WSL's state.

@OneBlue OneBlue closed this as completed Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants