$ | >

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?

Best regards.

92 votes
Sign in
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

Lutz shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Password icon
Signed in as (Sign out)
  • Mathieu CAROFF commented  ·   ·  Flag as inappropriate

    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  ·   ·  Flag as inappropriate

    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.

  • Anonymous commented  ·   ·  Flag as inappropriate

    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.

  • Bjorn commented  ·   ·  Flag as inappropriate

    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.

Feedback and Knowledge Base