I recently moved my wsl
directory to another drive due to low storage in C:
drive. As per the answer provided in this StackOverflow post, I used lxrunoffline
tool and moved my Ubuntu distribution to another drive (E:\wsl
in my case). As soon as the distribution was moved successfully, I ran wsl
to test and it worked like a charm.
Everything went fine until one day I accidentally renamed the E:\wsl
folder to something else. Well, as expected, wsl
didn't work. Then, I reverted back to the name wsl
and expected it to work but to my surprise, it didn't find any installed distribution after that even though it's installed...
E:> wsl
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Is there any way to revert back to the old directory or make wsl
point to a manual location?
EDIT: I don't want to reset Ubuntu
as I want to retain the installed packages and preferences...