Tech · Note
Setting up multiple WSL distribution instances
Backup of this: https://endjin.com/blog/2021/11/setting-up-multiple-wsl-distribution-instances
I wanted multiple versions of WSL running because I use WSL1 to extend windows for development and want the increased speed across the host OS and a WSL2 environment for container development.
Export the “base” environment
When you are happy with the environment, use exit to exit and return to the Windows shell.
Export the environment with the following command:
wsl --export <distribution name> <export file name>Create new instances of the distribution
You can now create new instances of the “base” environment by importing the .tar export:
wsl --import <new distribution name> <install location> <export file name>Using the new environment
You can now open the new environment using
wsl -d <new distribution name>