How to export — import a WSL Linux instance
In this article, I will show how to export and import a WSL Linux instance; some of the reasons to use this feature are
In this article, I will show how to export and import a WSL Linux instance; some of the reasons to use this feature are
- You just completed your instance setup and want to use it as a template.
- You want to use the same instance on another computer.
How to list the WSL instances
All the export and import functionality takes over the command line; you need to open a command or Powershell prompt as an administrator and enter
wsl.exe -l -vYou should see an output similar to this if you have at least one instance configured on your computer.

How to export a WSL instance
The generic syntax to export an instance iswsl.exe — export <wsl_instance_name> <export_name.tar>
As a best practice, use the .tar extension when you do exports.
In my case, to export the “Ubuntu” instance, I typed
C:\Users\kpatronas\Documents\kpatronas_wsl.tarBe sure that you are trying to export the instance to a disk with enough free space.
How to import a WSL instance
The generic syntax to import an instance iswsl.exe — import <distribution_name> <install_location> <export_name.tar>
Also, when you import a WSL instance, you need to be sure that the <install_location> has enough free space.
In my case looked like this
wsl --import Ubuntu C:\Users\kpatronas\AppData\Local\Packages\Ubuntu C:\Users\kpatronas\Documents\kpatronas_wsl.tarAfter completing the import, you can verify that the instance imported using.wsl.exe -l -v
You should see a listing with the instance you just imported.

having an export of your WSL instance is a very good practice, that can save time if you need to use the same instance on another computer