DEV Community


Discussion on: How to get started with Web Development on Windows with the WSL in 2021

citizen428 profile image
Michael Kohl • Edited

Yes, you can, WSL2 has export and import options (maybe version 1 did too but I never used that):

wsl --terminate <distribution> # just in case 
wsl --export <distribution> <file>
wsl --import <distribution> <installdir> <file>
Enter fullscreen mode Exit fullscreen mode

I use --export to regularly back up my WSL2 Ubuntu installation to an external disk and also used --import to create WSL installations for distros not available in the app store from custom root filesystems (make a root fs any way you want, turn it into a tarball, then import it).