Installing wsl from the very zero base...

민영 김 0 Reputation points
2024-10-10T13:45:09.39+00:00

While I was playing around with my wsl, I was curious what would happen if I actually run the command that deletes everything (rm -rf ~/*). Since I didn't use wsl for anything serious, I gave it a try. (Curiosity wins it all lol)

After then, every time I install a new distro of linux, those systems on wsl would always have no directory and configuration files which support linux commands. I wanted to reset it as default, so I deleted every single file that is associated with wsl in order to start over.

Starting from deleting any kinds of programs that runs on wsl, to Lxss keys in HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER from the regedit. (Literally everything)

Now, I do not know how to install wsl since the command wsl --install does not work... It displays an error that says:

Catastrophic failure
Error code: Wsl/CallMsi/Install/E_UNEXPECTED

How am I supposed to set everything default from this zero base?

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-10-14T08:51:31.3966667+00:00

    Hello 민영 김,

    Thank you for posting in Q&A forum.

    Here are 2 steps can help to set WSL back to default.

    1.Reset WSL Components:

    •Shut down all running WSL instances and reset network components:

    •wsl --shutdown

    •netsh winsock reset

    •netsh int ip reset

    2.Uninstall and Reinstall WSL:

    •Uninstall WSL and then reinstall it to ensure a clean setup:

    •dism.exe /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

    •dism.exe /online /disable-feature /featurename:VirtualMachinePlatform /norestart

    •dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

    Note: please back up all the data before you make any changes.

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.