[WSL2] Install a new but separate instance of Debian

Already have Debian up and running on WSL2. I would like to install a new (fresh?) install of the latest Debian. Is there a command to do this?

Do I need to download the Debian distro or can I use the same one that is in the Windows Store (that I used for the first instance?)

Please note that I know I can run more than one bash terminal :) I want a completely new and separate instance of the same distro (i.e. not Ubuntu, etc.)

Thank you!

Posted Jul 4, 2019, 7:41 PM UTC

143
atomic1fire•

You might like this article.

https://www.brianketelsen.com/getting-crazy-with-windows-subsystem-for-linux/

Edit: I'm not entirely sure if LXRunOffline posses an issue with rule 7 of this subreddit. Otherwise Microsoft does have an management API for managing distro installations in WSL.

7
[deleted]•

[deleted]

1
atomic1fire•

I'm thinking you might be able to install the Debian app from windows store, then use WSL's export to create a tar file of that base image, then import it as another distro.

https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/

edit: I mixed up Debian and Ubuntu, but my point is you may be able to export Debian into a seperate tar file, then import that file into WSL as a second distro.

2
[deleted]•

[deleted]

1
Rucadi•

For things like this I did https://github.com/rucadi/wsld just do:

./wsld.exe -d namenewdistro -i debian

and you will have your debian installation done

If you don't want to use the tool, you can always copy the installation of your current VM or WSL using the wsl command (wsl --export) and importing it again with --import.

Or you could simply download a rootfs somewhere.

1
[deleted]•

[deleted]

1