To import a previously exported Ubuntu distribution on Windows 11, you must use the
wsl --import command in an elevated Command Prompt or PowerShell window. This process creates a new virtual machine instance from a compressed tarball, allowing you to restore your environment without reinstalling the base system. Ensure the target folder for the installation is not on a network drive and that WSL2 is enabled before proceeding with the import operation.
Prerequisites for Importing WSL Distributions
Before attempting to import a distribution, verify that Windows Subsystem for Linux (WSL) is correctly configured on your machine. The most critical requirement is that WSL2 is active, as the
--import flag relies on the lightweight utility VM architecture provided by Hyper-V or the Windows Hypervisor Platform. You can check your current version by running
wsl -l -v. If your existing distros are listed as version 1, you will need to set the default to version 2 using
wsl --set-default-version 2.
Additionally, ensure that the export file you wish to import is a valid
.tar archive. This file should have been generated using the
wsl --export command from a source machine. If you are moving your setup to a new PC, such as during a hardware upgrade, you might encounter issues if the previous installation was corrupted. For context on resolving initial setup failures, refer to our guide on
Unable to Install WSL/Hyper-V on New Machine, which covers common hypervisor conflicts that could prevent the import process from starting.
Preparing the Destination Folder
The import command requires two distinct paths: one for the compressed data file and another for the uncompressed virtual hard disk. You must create an empty directory where the Ubuntu filesystem will reside. This folder acts as the root of the virtual machine's storage. It is highly recommended to place this directory on a local NTFS volume, preferably on an SSD, to ensure optimal performance. Network drives or certain cloud-synced folders may cause permission errors or significant latency during the unpacking phase.
Choose a descriptive name for this folder, such as
C:\WSL\Ubuntu-Exported. Do not include spaces in the path if possible, although modern versions of WSL handle them better than older iterations. Once the folder is created, note its full absolute path, as you will need to paste it into your command line shortly. Avoid placing this folder inside directories managed by Windows Defender real-time scanning if you experience timeouts, though typically standard locations like
Users\YourName\WSL work without modification.
Executing the Import Command
Open Command Prompt or PowerShell as an administrator. Right-click the Start menu icon and select "Terminal (Admin)" or "Windows PowerShell (Admin)" to gain the necessary privileges. Run the following command structure, replacing the placeholders with your actual file paths and desired distribution name:
wsl --import Ubuntu-Imported C:\WSL\Ubuntu-Imported C:\Path\To\ubuntu-export.tar.gz
In this command,
Ubuntu-Imported is the name you will use to launch the distro later.
C:\WSL\Ubuntu-Imported is the empty folder you created earlier.
C:\Path\To\ubuntu-export.tar.gz is the location of your exported archive. The process may take several minutes depending on the size of the archive and the speed of your storage drive. During this time, the system extracts the tarball and formats a VHDX file within the destination folder.
If the import fails with a permission error, ensure no other process is locking the tar file. If it fails due to insufficient space, check the free space on the drive containing the destination folder. For users who previously moved their WSL installations from the C drive to a D drive to save space, be aware that importing follows similar constraints regarding drive formatting. See
Fixing WSL Not Working After Moving Ubuntu from C to D for troubleshooting tips related to non-C drive installations.
Verifying and Launching the Imported Distro
Once the command completes successfully, verify the installation by listing all installed distributions. Run
wsl -l -v again. Your newly imported distro should appear in the list with the name you specified and a status of "Stopped." Unlike freshly installed distros, imported ones do not automatically run a first-time setup script. This means you retain the exact user accounts, configurations, and software present at the time of export.
To start the environment, simply type
wsl -d Ubuntu-Imported. You will be dropped directly into the bash shell as the user defined in the exported metadata. If you need to switch users or reset permissions, you can do so from within the terminal. Note that network connectivity usually works out of the box, but if you encounter issues, check your DNS settings. A lack of internet access after import is a known edge case; consult
WSL: No Internet Connection (Ubuntu, Windows 11) if you cannot ping external hosts.
Frequently Asked Questions
Can I import a WSL1 distribution to WSL2?
Yes, the
wsl --import command always installs the distribution as WSL2 by default. There is no option to specify WSL1 during import, as WSL1 uses a different translation layer that does not support the tarball import method. If you require WSL1 behavior, you must install via the Microsoft Store instead.
Does importing preserve my original username?
Yes, the import process restores the exact user ID and group ID from the source machine. However, if the UID/GID conflicts with existing users on the host Windows system or other WSL instances, you may encounter permission issues. It is generally safe to assume your primary user account remains intact unless you have heavily customized /etc/passwd.
What happens if I delete the destination folder?
Deleting the folder associated with the imported distro permanently removes the virtual hard disk and all data within it. The distribution will disappear from
wsl -l -v output immediately. To remove the entry cleanly, you should unregister it using
wsl --unregister DistributionName before deleting the files, though direct deletion achieves the same result.
Can I clone a distro by importing an export?
While you can technically import the same tarball multiple times into different folders, creating clones is more efficiently done using the
wsl --export and
wsl --import cycle or dedicated cloning tools. Each import creates a separate virtual machine instance with independent state. For a streamlined approach to duplicating environments, see
Clone WSL Distro: Installing Ubuntu on WSL2 in Windows 11.
Is there a limit to how many distros I can import?
There is no hard-coded limit imposed by WSL itself, but each imported distro consumes disk space proportional to its size. Since each instance maintains its own VHDX file, storage capacity becomes the primary constraint. Ensure your drive has sufficient free space to accommodate multiple large distributions if you plan to maintain several parallel environments.