2023 Multi Instance of the same WSL Ubuntu Step by Step
23 August, 2023
0
0
0
Contributors
How to install the same wsl ubuntu linux multiple times:
We could use the Wsl import/export commands for achieving multiple copies of the same ubuntu distribution.
You need to create a folder to store the exported image file (c:\backup) and another folder for hosting ubuntu instances (c:\ubuntu).
Step 0. Make the folders:
mkdir c:\backup
mkdir c:\ubuntu
Step 1. Install the original ubuntu:
wsl --install -d Ubuntu-22.04
Step 2. Export the original ubuntu to an image file
wsl --export Ubuntu-22.04 c:\backup\ubuntu2204.tar.gz
Step 3. Create a new instance from the image file
wls --import ubuntu-1 c:\ubuntu\ubuntu-1 c:\backup\ubuntu2204.tar.gz
You can find the ubuntu-1 from start menu now.
If you want to enter from powershell, you can do:
wsl -d ubuntu-1
If you ever want to uninstall an instance, you could simply do:
wsl --unregister ubuntu-1