Whatever the situation might be, you can use the wsl.exe tool with the –export option to backup and the –import option to restore a distribution. However, there is one caveat, when using this method, the Linux distribution (for example, Ubuntu, CentOS, Debian, Mint, etc.) will lose its integration with the Start menu, and it’ll no longer appear as an item in the “Apps & features” settings. This guide will teach you the steps to back up and restore Linux distros installed in the Windows Subsystem for Linux 2 (WSL2) on Windows 11 and 10.
Perform backup of Linux distro on WSL Perform restore of Linux distro on WSL
Perform backup of Linux distro on WSL
To backup a WSL Linux install on Windows 11 (or Windows 10), use these steps: Once you complete the steps, the virtual machine will export to the root of the main system drive (C:) unless you specify another location. In the command, change DISTRO-NAME and PATH\FILE-NAME.tar with the information for your distribution. If you don’t specify a path, the backup will be stored in the root of “C:”. For example, this command backs up (exports) the Ubuntu distro:
These instructions only create a backup of one distro. If you have additional installations, you will need to repeat the steps.
Perform restore of Linux distro on WSL
To import a Linux distro from backup on the Window Subsystem for Linux 2, use these steps: After you complete the steps, the distribution will import to the specified destination. The only caveat is that this backup and restore don’t have the same integration as installing the distros from the Microsoft Store. For example, once the distro is imported, it won’t register in the Start menu and won’t appear as an app you can remove from the “Apps & features” settings page. In the command, change DISTRO-NAME, INSTALL-LOCATION, and PATH\FILE-NAME.tar with the information for your distribution. For example, this command restores (imports) the Ubuntu distro:
If you want to run the distro, you’ll need to run this command: wsl –distribution DISTRO-NAME, or you can select the distribution from the Windows Terminal menu. Also, if you want to uninstall the imported Linux virtual machine, you will need to use this command: wsl –unregister DISTRO-NAME. All content on this site is provided with no warranties, express or implied. Use any information at your own risk. Always backup of your device and files before making any changes. Privacy policy info.