It is possible, but requires some work. You can use LxRunOffline - "A full-featured utility for Windows Subsystem for Linux (WSL)".
You can install it via Chocolatey: choco install lxrunoffline, or download and unzip.
You might want to add LxRunOffline.exe to your PATH.
https://lxrunoffline.apphb.com/download/{distro}/{version} will redirect to download page for desired distro. In this case it would be .../ubuntu/xenial or similar, according to lxrunoffline wiki, or you can download directly from Canonical.
Then you can: LxRunOffline install -n someName -d where/to/install -f path/to/downloaded/distro multiple times with different names and target directories.
Then you can lxrunoffline -w -n someName to start desired installation, and finally, you can create multiple shortcuts on the desktop with different options for specific work spaces.
LxRunOffline available commands:
list List all installed distributions.
get-default Get the default distribution, which is used by bash.exe.
set-default Set the default distribution, which is used by bash.exe.
install Install a new distribution.
uninstall Uninstall a distribution.
register Register an existing installation directory.
unregister Unregister a distribution but not delete the installation directory.
move Move a distribution to a new directory.
duplicate Duplicate an existing distribution in a new directory.
run Run a command in a distribution.
get-dir Get the installation directory of a distribution.
get-env Get the default environment variables of a distribution.
set-env Set the default environment variables of a distribution.
get-uid Get the UID of the default user of a distribution.
set-uid Set the UID of the default user of a distribution.
get-kernelcmd Get the default kernel command line of a distribution.
set-kernelcmd Set the default kernel command line of a distribution.
get-flags Get some flags of a distribution. See https://msdn.microsoft.com/en-us/library/windows/desktop/mt826872(v=vs.85).aspx for details.
set-flags Set some flags of a distribution. See https://msdn.microsoft.com/en-us/library/windows/desktop/mt826872(v=vs.85).aspx for details.
version Get version information about this LxRunOffline.exe.
First we have to find the install location of that Windows Store Appx. Here is a Powershell script to find that path. Enter the distribution name at first (e.g. Ubuntu18.04).
In the PS script, Invoke-Item will open that path in File Explorer. If that path is not visible or shows any security issue, then grant permission to access that folder from its Properties menu. Now copy just these two required files:
Distribution userspace tarball named as install.tar.gz (or any TAR.GZ file).
Main executable file to install, named as Ubuntu.exe or Ubuntu1804.exe or Ubuntu1604.exe etc.
Here comes the next section. Backup and then delete the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss. Place those two files in a folder structure like this (or as you want):
The folder names should be different. Now double click on the first copied .exe excutable, wait until it installs. Open HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss\<some-GUID> and change the DistributionName string registry to UbuntuPython (or any). Repeat the procedure with every instances. The GUID will be new one for every instances. Make sure you change the DistributionName registry entry to different values for each one, otherwise ubuntu.exe will execute wsl.exe instead of installing. See the source code of those EXE files here GitHub: Microsoft/WSL-DistroLauncher.
The newer wsl command's import/export feature can readily create copies of a distro without installing any additional tools or using RegEdit. For example
wsl -d <distro> launches the distro. If WSL 2 has been installed, then the distro can be converted between versions during --import using the --version option:
A smaller distro, such as Alpine, can make experimentation much faster. Finally, wsl --import can read from standard input - and wsl --export can write to standard output -. This allows a compression program to be used to save disk space if desired.
Side note:
The default login of imported distro is root.
For Build 18980 and later, you may create or modify /etc/wsl.conf to set your default login user instead of fiddling with registry or login with wsl -u <username>. Reference
Content of /etc/wsl.conf. It might take effect after shutdown or logout.
I recently had the same issue, as I am working with different companies at the same time, and needed a script that could easily create a new WSL2 instance, and just as easily delete it.
Deletion by itself is not hard, as the official command wsl --unregister <distro_name> works just fine, and gets rid of the WSL2 instances perfectly, without leaving any trace.
The following example creates a WSL2 instance using Ubuntu20.04 (Focal Fossa) using a previously downloaded
tarball (the example uses the following one: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-wsl.rootfs.tar.gz), creates a user with username myuser
and adds it to the group sudo. It also sets the user password to the one given in the pipeline, and the password for the root user, also given in the pipeline.
Rather than duplicating distributions from Microsoft Store or .appx files, another solution is by utilizing Docker in existing Linux distribution running on WSL. This method is actually explained in WSL Docs by Microsoft.
This method is beneficial because you can utilize a variety of distros that have been available in the Docker registry.
For example, you already have Ubuntu-18.04 distribution installed from Microsoft Store.
Run a container with any Linux distribution you desired, for example, Ubuntu 20.04
docker run -d ubuntu:20.04
List all containers, and keep the Container ID of the distribution you desired
docker ps -a
Export the selected container into a .tar file, for example, the Container ID is 123123abcabc and you want to store the exported file in C:\data.
WSL mounts your Windows directory into /mnt directory on the running Linux. If you have a C:\data directory on Windows, its content can be accessed on your Linux in /mnt/c/data directory.
Now, the exported file is available in C:\data\exported-ubuntu-20.04.tar.
Exit from Linux, back to Windows terminal, then import the exported container as a new distribution with any desired name and stored in any location in Windows