skip to content
Alvin Lucillo

Export and import WSL instance

/ 1 min read

💻 Tech

Exporting and importing your WSL instance is quite easy. You can use the wsl --export command to create a tar file with the instance. Here’s an example:

# Ubuntu - instance name
# C:\Users\user1\Ubuntu.tar - path to the tar file
wsl --export Ubuntu C:\Users\user1\Ubuntu.tar

You can then import the tar file to another machine using the wsl --import command:

# Ubuntu - instance name
# C:\Users\user1\Ubuntu - path to the folder where the instance will be imported
# C:\Users\user1\Ubuntu.tar - path to the tar file
wsl --import Ubuntu C:\Users\user1\Ubuntu C:\Users\user1\Ubuntu.tar

Note that the default user will be root.