How to Back Up and Restore Linux on WSL
Backing up WSL (Windows Subsystem for Linux, a feature that lets you run Linux software directly inside Windows 10 and Windows 11) saves your entire Linux setup into a single .tar archive file on your hard drive. This backup protects your custom settings and personal files so you can restore them within minutes if your system breaks or you switch to a new PC.
You use the built-in Windows command prompt to export and import your Linux distribution, such as Ubuntu 22.04 LTS, without needing any extra backup tools.
Back up your Linux on WSL distribution by running `wsl –export ` in an administrator PowerShell. Restore it using `wsl –import `. These commands create and restore a portable tar archive of your Linux environment.
Why back up your Linux environment?
Protecting the Linux environment prevents data loss from unexpected system issues.
What happens when you are done?
Once imported, the system functions normally, though restored instances will not appear in the Windows Start menu or apps list automatically.
How to back up and restore Linux on WSL
To back up and restore Linux on WSL, you need to use Windows PowerShell with administrator permissions so you can properly export and import your files. This process lets you save a copy of your Linux environment or move it to a different computer without losing your data. You will use specific export and import commands in the terminal to manage your distributions safely.
1. Open the Start menu , search for PowerShell, and select Run as administrator. Learn how to run as administrator here.

2. List your installed distributions:
wsl.exe --listExporting your WSL distribution
Exporting a WSL distribution creates a backup file of the Linux system using a dedicated command.
wsl --export Ubuntu-20.04 C:\backup\my-linux-backup.tarImporting your WSL distribution
Restoring or moving an instance relies on the import command. This process generates a new .vhdx file (a virtual hard disk format Windows uses) in your chosen folder.
wsl --import Ubuntu-20.04 C:\Users\genericuser\Ubuntu C:\backup\my-linux-backup.tarAdvanced Troubleshooting and Automation
Moving an instance to a different drive requires exporting it, unregistering the old one with wsl --unregister, and importing it to the new path. Automated backups involve saving the export command within a .ps1 script and executing it daily through Windows Task Scheduler.
Summary
Backing up and restoring a Linux WSL setup remains vital for data safety, streamlining system migrations and troubleshooting.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!