Multiple WSL environments
Not so easy way to figure out, but there is a way to have multiple wsl instances.
Assuming you do not have any distributions installed (check via wsl --list -v
), install the clean one:
wsl --install Ubuntu-22.04
Enter the instance and do the necessary configuration (it’ll be the default for your instances)
Then, export the instance
wsl --export Ubuntu-22.04 c:\dev\wsl\wsl-clean-instance-ubuntu2204
- If you like to create a new instance, type:
wsl --import myinstance c:\dev\wsl\instances\myinstance c:\dev\wsl\wsl-clean-instance-ubuntu2204
and enter into instance:
wsl -d myinstance -u myusername
where myusername
is the user name you entered in 1.