Copy WSL linux to another computerWSL, or Windows Subsystem for Linux, is super-useful for running linux in Windows 10/11.

But what happens when you want to copy your WSL flavor of linux to another machine?

With WSL2, it’s super-easy!

Just type a few commands, and you’re off and running…

First thing’s first

On the “new” puter where you want to copy linux, first you need to make sure WSL is installed.

Just do this:

  1. Click the Windows/start button
  2. Type: turn windows
  3. Click: Turn Windows features on or off
  4. Scroll down and CHECK the box for Windows Subsystem for Linux
  5. Click OK

Alrighty! Now WSL is installed on the new machine, so you’re ready to rock.

Export your WSL installation

No matter the flavor of linux you’re using, you just need to do this:

  1. Click the start/Windows button
  2. Type: command
  3. Click: Command Prompt -> Run as administrator
  4. Type: wsl –list
  5. Note the name of your WSL installation. In my case, it’s: Ubuntu-22.04
  6. Change to whatever directory you want to do the export to, for example: cd\Users\Scottie
  7. Type: wsl –export Ubuntu-22.04 Ubuntu2204.tar  (change the names in red and green to whatever you need)
  8. Congratulations! You now have a tar file that is your entire WSL install in 1 file!
  9. Copy this tar file to the other puter

Next, you need to import this file to the second PC.

Import your WSL installation to another PC

  1. Click the start/Windows button
  2. Type: command
  3. Click: Command Prompt -> Run as administrator
  4. Change to the directory where your tar file is, i.e. cd\Users\Scottie2
  5. Type wsl –import Ubuntu-22.04 C:\Users\Scottie2\AppData\Local\Packages\Ubuntu-22.04 Ubuntu2204.tar (again, change the names in red and green for your specific puter)
  6. Type: wsl –list and you should see your WSL install
  7. You can go ahead and run it (search for the name in the Start menu), and you’re done!

This method exports/imports the entire linux install. That means whatever files are in your WSL install and whatever software you’ve installed will be exactly like the original.

So, you can also do an export to make a backup copy of your whole WSL installation!

Wasn’t that easy?

Need help? Hire me!
Get Scottie Stuff!