How can I completely remove WSL and the leftover Linux entry from File Explorer?
Asked by
39 spool ends
I uninstalled Docker and tried removing Windows Subsystem for Linux, but Linux still appears in File Explorer and WSL still shows up in searches. WSL is not listed under installed apps, and running WSL commands reports that no distributions are installed rather than indicating that WSL is unavailable. I have already tried PowerShell, DISM, and third-party uninstall tools. What is the proper way to remove the remaining WSL files and the Linux entry?
Answers
If the Linux entry remains in File Explorer even after WSL is disabled, it may be an orphaned Explorer namespace registry entry. In Registry Editor, search beneath `HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerDesktopNameSpace` for entries containing `wsl` or `linux`, with subtree searching enabled, and remove the leftover entry. Back up the registry first, since deleting the wrong key can affect Explorer.
Reply to this answer
First check for any remaining distributions with `wsl --list --verbose`, then run `wsl --shutdown`. If Docker created distributions, unregister `docker-desktop` and `docker-desktop-data`, then remove any leftover Docker WSL folder under your local application data. You may need to reinstall WSL first so the commands are available, then unregister everything and disable the Windows feature afterward.
Reply to this answer
It can help to check the other Explorer registry locations as well, especially `HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionExplorer` and `HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeMicrosoftWindowsCurrentVersionExplorer`. Search for `wsl` and `linux`, then restart Explorer after cleaning up any clearly related orphaned entries.
Reply to this answer
Add your answer
Answers are reviewed before publication.
_82 postal zones: I spent hours trying other methods, and removing the stale registry entry was the only thing that finally made the Linux directory disappear.