Skip to Content

How to Export, Import and Unregister Linux on Windows 10

Windows 10 version 1903 (May 2019 Update) added new Windows wsl command-line options to import, export and unregister Linux environment with TAR format file on the root file system.

How to Export, Import and Unregister Linux on Windows 10

Content Summary

How to Export/Backup Linux System
How to Import/Restore Linux System
How to Unregister/Delete Linux System

How to Export/Backup Linux System

Step 1: PowerShell or Command Prompt environment in order to execute wsl command (wsl.exe). Right click Start button or press Windows + x and then click Windows PowerShell.

Step 2: To list the distros installed, run the following command: wsl --list

Step 3: Use the following command to export distro’s file system to TAR file: wsl --export distro_name file_name.tar

For example, to export Ubuntu 18.04 system to ubuntu.tar, Execute: wsl --export Ubuntu-18.04 ubuntu.tar

Step 4: A TAR file containing Linux distribution’s file system created.

How to Import/Restore Linux System

Use wsl command with –import option to import a TAR file created: wsl --import distro_name install_location file_name.tar

For example, in order to import distro from TAR file located at C:\Users\Chris\ubuntu.tar, call it “Ubuntu-18.04,” and store it at C:\Users\Chris\ubuntu. execute: wsl --import Ubuntu-18.04 C:\Users\Chris\ubuntu C:\Users\Chris\ubuntu.tar

If you want to match where Windows normally installs them to by default, they’re generally in their own folder in C:\Users\NAME\AppData\Local\Packages.

For example, you might want to put Ubuntu in C:\Users\NAME\AppData\Local\Packages\Ubuntu.

How to Unregister/Delete Linux System

Uninstall distro with –unregister option along with its name. This will result in all the Linux distribution’s files being deleted.

Step 1: Use the following command to see all installed distributions: wsl --list

Step 2: Specify the distribution you want to delete: wsl --unregister distro_name

For example, if it’s called Ubuntu-18.04, you’d run: wsl --unregister Ubuntu-18.04

Alex Lim is a certified IT Technical Support Architect with over 15 years of experience in designing, implementing, and troubleshooting complex IT systems and networks. He has worked for leading IT companies, such as Microsoft, IBM, and Cisco, providing technical support and solutions to clients across various industries and sectors. Alex has a bachelor’s degree in computer science from the National University of Singapore and a master’s degree in information security from the Massachusetts Institute of Technology. He is also the author of several best-selling books on IT technical support, such as The IT Technical Support Handbook and Troubleshooting IT Systems and Networks. Alex lives in Bandar, Johore, Malaysia with his wife and two chilrdren. You can reach him at [email protected] or follow him on Website | Twitter | Facebook

    Ads Blocker Image Powered by Code Help Pro

    Your Support Matters...

    We run an independent site that is committed to delivering valuable content, but it comes with its challenges. Many of our readers use ad blockers, causing our advertising revenue to decline. Unlike some websites, we have not implemented paywalls to restrict access. Your support can make a significant difference. If you find this website useful and choose to support us, it would greatly secure our future. We appreciate your help. If you are currently using an ad blocker, please consider disabling it for our site. Thank you for your understanding and support.