October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Back Up and Restore a WSL Distribution

Back up a WSL distribution with a tar archive or WSL 2 VHDX, then restore or move it with the matching import command. Verify the backup before unregistering the original.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use WSL’s built-in wsl --export and wsl --import commands to save and restore a Linux distribution. Export creates a tar archive by default; for a WSL 2 distribution, you can also export a VHDX. Keep the original distribution until you have confirmed the backup and tested the restored copy: wsl --unregister permanently deletes the distribution’s data, settings, and software.

Before you start: identify the distribution and choose a destination

Open PowerShell or Command Prompt and list your installed distributions:

As an Amazon Associate I earn from qualifying purchases.

wsl --list --verbose

Use the exact distribution name shown in the list in the commands below. The output also identifies whether each distribution uses WSL 1 or WSL 2, which matters because VHDX export is available only for WSL 2. Choose a destination with enough free space and create its parent folder first; for example, make sure D:Backups exists before exporting to it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can save the export on another drive or removable storage and copy it to another computer. Microsoft notes that a full export-and-import transfer can require substantial disk space. If space is limited and you only need selected files, Microsoft’s WSL FAQ describes transferring files and reinstalling packages as an alternative; that is not a complete distribution backup.

#1 Best Overall
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Export a backup

Option 1: Create a tar archive

Run the following in PowerShell or Command Prompt, replacing Ubuntu with your distribution’s exact name and adjusting the destination as needed:

wsl --export Ubuntu D:BackupsUbuntu.tar

wsl --export creates a snapshot file and uses tar format by default. Microsoft documents the syntax as wsl --export <Distribution Name> <FileName>. Keep the resulting archive in a safe location; you can copy it to another machine before importing it there.

Option 2: Export a WSL 2 distribution as VHDX

For a WSL 2 distribution, you can export its virtual disk instead:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.
wsl --export Ubuntu D:BackupsUbuntu.vhdx --vhd

Microsoft’s command reference documents the --vhd option, while its FAQ also shows the equivalent format selection as --format vhd. VHDX export requires WSL 2 and can use substantial disk space. Use this option when you want a disk-based backup or plan to register the VHDX directly at its final location.

Restore a tar archive

Import the archive with a registered distribution name and an installation directory. This example explicitly selects WSL 2:

wsl --import Ubuntu-Restored D:WSLUbuntu-Restored D:BackupsUbuntu.tar --version 2

The arguments are the new distribution name, its installation location, and the archive path. Use --version 1 or --version 2 to select the intended WSL version; include the flag rather than relying on a default when the version matters. You can choose another registered name or installation directory, provided the destination is suitable and available.

Rank #3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Restore a VHDX backup

Import the VHDX into an installation directory

Use --vhd when importing a VHDX backup:

wsl --import Ubuntu-Restored D:WSLUbuntu-Restored D:BackupsUbuntu.vhdx --vhd

Register an existing VHDX in place

If the VHDX is already at the location where you intend to keep it, register it directly with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wsl --import-in-place Ubuntu-Restored D:BackupsUbuntu.vhdx

The virtual hard disk used with --import-in-place must use the ext4 filesystem. WSL 2 distributions use ext4 virtual disks stored as VHDX files, as described in Microsoft’s WSL disk-space guidance. Because an in-place import registers the disk at its current path, leave the file in its intended permanent location.

Move a distribution to another drive

For a move, export the WSL 2 distribution as VHDX, verify the export, unregister the original, and then import the VHDX in place from the new drive. A typical sequence is:

Rank #4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.
  1. Export the distribution: wsl --export Ubuntu D:BackupsUbuntu.vhdx --vhd.

  2. Check that the export completed and the VHDX exists at the destination. Keep an independent copy if you can.

    Free tools Windows power users keep installed

    One-click scans. No signup required.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Only when you are satisfied the backup is intact, unregister the original: wsl --unregister Ubuntu.

    Best Value
    Sale
    UnionSine 500GB Ultra Slim Portable External Hard Drive HDD-USB 3.0
    • [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
    • 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
    • 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
    • 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
    • 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
  4. Move or copy the VHDX to its intended permanent location, then register it there: wsl --import-in-place Ubuntu D:WSLUbuntu.vhdx.

  5. Start the imported distribution and confirm that it is usable before removing any remaining backup copy.

Microsoft warns that, once a distribution is unregistered, all data, settings, and software associated with it are permanently lost. Do not run the unregister command as a way to test a backup, and do not delete your only export until you have confirmed the restored distribution works.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the format that fits the job

Need Documented choice Constraint
Keep a conventional archive or restore from a tar file Export to tar, then use wsl --import. Import requires a distribution name and installation location; specify the WSL version if it matters.
Save or transfer a WSL 2 virtual disk Export to VHDX, then import with --vhd. VHD export and import require WSL 2; the full transfer can require substantial disk space.
Register a VHDX from its final location Use wsl --import-in-place. The VHDX must use ext4 and should remain at the registered path.
Transfer only selected files when storage is limited Use file transfer and reinstall packages, as described in Microsoft’s WSL FAQ. This does not create a complete distribution export.

Keep the backup separate from the original

For a backup you may need later, retain the exported tar or VHDX somewhere separate from the distribution’s installation files. For a transfer, copy the export to the destination computer and import it there using the matching method above. Before deleting an original or backup, verify that the export completed and that the restored distribution starts and contains the data you need.

Quick Recap

SaleBestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$129.99
Bestseller No. 2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$229.99
Bestseller No. 3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
Bestseller No. 4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$208.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.