Backup/Restore/Share/Snapshot a WSL installation
Backup / Restore / Snapshot a WSL installation.
For development puproses it would be very nice to ba able to backup a WSL installtion and to resore it on the same or another(!) PC.
Provide a means of 'going back' (like a VMware snapshot) when a WSL installation became unstable, bloated, corrupt.
BTW is there a way to have more than one Ubuntu installations at the same time?
The Victor commented
Has this shipped? It's a must for me, and for most I believe.
Brennan Fee commented
This is coming in Windows 10 1903 with the ability to import and export a distribution.
Mathieu CAROFF commented
I recommend `lxrunoffline` for this purpose. It does duplication of existing distributions. Installation of new ones, setting the default `wsl` and `bash` distribution. It can be easily grabbed using choco. Using a privileged cmd or powershell, you can:
Kenneth Benson commented
It can be backed up fairly easily, tho not from inside WSL. Go to C:\Users\<username>\Appdata\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc (although the part starting from the underscore after onWindows may be different on different PCs) and backup that directory with your favorite method. I've seen people do it with a backup program and I've seen using 7-Zip to backup/compress the whole thing. Make sure you get that directory and all the sub-directories as one has the rootfs in it and another has all the permissions for the rootfs (I think in one of the localstate dirs... best to just back it *all* up). To restore just put it all back to the same place.
I productively use the WSL (ssh, building, ...). It'd be nice to make a backup from time to time or before perfoming a release upgrade.
Yeah, i've been experimenting with using WSL as a dev env, but it would really help if we can get some way of distibuting the built version to other people. This would make running/resetting it so much easier, and possibly make it a good way to get a env up and running fast.