How-Tos Productivity Downloads About

Back Up Your WSL Distro

Your WSL Linux setup is finally perfect — dotfiles tuned, packages installed, projects configured — and it all lives inside a virtual disk that a botched Windows update or a careless command can destroy. Unlike your Documents folder, WSL distros are not covered by normal file backups. The fix is one command: wsl --export snapshots the entire distro into a single file you can store anywhere and reimport in minutes.

A person at a desk with a real PC showing Windows Terminal with a legible wsl --export command running, the person's face relieved and careful, home office..

TL;DR / Quick Fix

Quick fix: back up WSL with wsl --export — open Terminal and run wsl --export DistroName C:\backup\distro.tar to save the entire Linux setup to one file. Store that file somewhere safe, ideally off the PC. Restore with wsl --import. Do this before major Windows updates or distro upgrades.

Follow these steps

  1. List your distros. Open Terminal and run wsl --list --verbose to see installed distros and their states. Note the exact name — the export command needs it spelled right, and the default is not always what you assume.
  2. Shut the distro down cleanly. Run wsl --terminate followed by the distro name (or wsl --shutdown for all). Exporting a running distro can capture inconsistent state — thirty seconds of shutdown buys a clean snapshot.
  3. Export to a .tar file. Run wsl --export DistroName path\to\backup.tar — the whole filesystem, configs, and installed packages compress into one file. It takes a few minutes for large distros; let it finish.
  4. Store the backup off the machine. Copy the .tar to an external drive or cloud storage. A backup on the same disk it protects is a hope, not a plan — and keep it alongside your Dev Drive project backups if you use one.
  5. Know how to restore. If disaster strikes: wsl --import NewName path\for\disk path\to\backup.tar restores the distro under a new name. Test the restore once on a scratch import — a backup you have never restored is a rumor.
  6. Schedule it before risky changes. Export before major Windows updates, distro release upgrades, and experiments with system files. Regular monthly exports for active distros; the disk-space check is a good moment to export too, before cleaning.
A person performing the guide's first step: List your distros. Open Terminal and run wsl --list --verbose to see installed distros and their states. Note the exact name — the export…
Step 1 in action: List your distros. Open Terminal and run wsl --list --verbose to see installed distros and their states. Note the exact name — the export…

What NOT to do

  • Do not rely on File History for WSL. The distro lives in a virtual disk file that normal file backup handles badly — export is the supported path.
  • Do not export while the distro is running. A live export risks a corrupted snapshot; terminate first, export second, every time.
  • Do not keep the only copy on the same drive. Disk failure takes the distro and the backup together — off-machine copies are the point.
  • Do not forget which distro is which. Name backup files with distro and date (ubuntu-2026-10-29.tar) — mystery .tar files get deleted in cleanups.

Frequently asked questions

How big will the backup be?

Roughly the size of your distro's used space — a lean dev setup might be a few GB, a heavy one tens of GB. The export does not compress much; plan storage accordingly.

Can I move WSL to another PC with this?

Yes — export on the old machine, copy the .tar over, import on the new one. It is the cleanest migration path, username and configs intact.

Does this back up my Windows files too?

No — only the Linux filesystem inside WSL. Windows files need their own backup; the two systems back up separately.

What to read next

About the author

By Juan Ibarra · Google IT Support Certified (Verified on Credly). See the About page for full author details.

Share this guide