Windows 10: Export and Import Windows Subsystem for Linux WSL Distro in Windows 10

Discus and support Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 in Windows 10 Tutorials to solve the problem; How to: Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 How to Export and Import Windows Subsystem for Linux (WSL) Distro in... Discussion in 'Windows 10 Tutorials' started by Brink, May 30, 2018.

  1. Brink Win User

    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10


    How to: Export and Import Windows Subsystem for Linux WSL Distro in Windows 10

    How to Export and Import Windows Subsystem for Linux (WSL) Distro in Windows 10


    The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on Windows, alongside your traditional Windows desktop and modern store apps.

    Starting with Windows 10 build 18342 (19H1) and Windows 10 build 18836 (20H1), Microsoft added some new commands that will give you more functionality when using wsl.exe.

    You can now export and import different WSL distros. Exporting a distro is accomplished by passing in --export as an argument and will output a tar file of your current distro. For example, you could use this functionality to share your distro setup with other people. Additionally, if you pass in --import as an argument you can import a tar file that contains the root file system of a Linux distro, which allows you to import any distro youd like (with any configuration youd like) as a new distro.

    See also: What’s new for WSL in Windows 10 version 1903?

    This tutorial will show you how to export and import Windows Subsystem for Linux (WSL) distros in Windows 10.

    *Warning You will need to have Windows Subsystem for Linux (WSL) enabled to be able to export and import WSL distros in Windows 10.


    CONTENTS:
    • Option One: Export Windows Subsystem for Linux (WSL) Distro in Windows 10
    • Option Two: Import Windows Subsystem for Linux (WSL) Distro in Windows 10
    • Option Three: Uninstall Imported Windows Subsystem for Linux (WSL) Distro in Windows 10




    OPTION ONE [/i] Export Windows Subsystem for Linux (WSL) Distro in Windows 10
    1. If you haven't already, you will need to perform the following actions to prepare the WSL distro (ex: Debian) you want to export.
    A) Install the WSL distro (ex: Debian) from the Microsoft Store you want to export.

    B) Open this WSL distro (ex: Debian) to finish installing and setup, make any changes you want, and close the distro.

    C) Check for updates in the Microsoft Store app to make sure this WSL distro (ex: Debian) is fully updated, and close the Microsoft Store app when finished.
    2. Open a command prompt.

    3. Copy and paste the command below into the command prompt, and press Enter. This will give you a list of all currently installed WSL distros for the current user. Make note of the WSL distro name (ex: Debian) you want to export. (see screenshot below)
    *Arrow wsl --list --all


    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 [​IMG]

    4. Enter the command below into the command prompt, and press Enter. (see screenshot below)
    *Arrow wsl --export <DistributionName> <Full path to .tar FileName>

    *note Substitute <DistributionName> in the command above with the actual WSL distro name (ex: "Debian") from step 3 you want to export.

    Substitute <Full path to .tar FileName> in the command above with the full path of the location (ex: "%UserProfile%\Desktop") to where you want to export with the name of the .tar file (ex: "Debian.tar") you want to use.

    For example: wsl --export Debian %UserProfile%\Desktop\Debian.tar



    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 [​IMG]

    5. When finished, you can close the command prompt if you like.

    6. This .tar file (ex: "Debian.tar") is the export of your custom WSL distro used to import with Option Two below.





    OPTION TWO [/i] Import Windows Subsystem for Linux (WSL) Distro in Windows 10
    1. Option One for the WSL distro (ex: Debian) you want.

    2. Open a command prompt.

    3. Copy and paste the command below into the command prompt, and press Enter. This will give you a list of all currently installed WSL distros for the current user. (see screenshot below)
    *Arrow wsl --list --all


    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 [​IMG]

    4. Enter the command below into the command prompt, and press Enter. (see screenshot below)
    *Arrow wsl --import <DistributionName> <InstallLocation> <Full path to .tar FileName>

    *note Substitute <DistributionName> in the command above with the actual WSL distro name (ex: "Debian-Custom") you want to use for this imported WSL distro. This name must be different than any already installed WSL distros listed in step 3.

    Substitute <InstallLocation> in the command above with the full path of the folder (ex: "C:\Data\Debian-Custom") to where you want to install the imported WSL distro.

    Substitute <Full path to .tar FileName> in the command above with the full path of the .tar file (ex: "%UserProfile%\Desktop\Debian.tar") from Option One for the WSL distro you want to import.

    For example: wsl --import Debian-Custom C:\Data\Debian-Custom %UserProfile%\Desktop\Debian.tar



    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 [​IMG]

    5. When finished, you can close the command prompt if you like.

    6. Whenever you would like to run the imported WSL distro, type the command below into a PowerShell. (see screenshot below)
    *Arrow wsl --distribution <DistributionName>

    *note Substitute <DistributionName> in the command above with the actual WSL distro name (ex: "Debian-Custom") you want to run. The wsl --list --all command will give you a list of names for all installed WSL distros for the current account.


    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 [​IMG]






    OPTION THREE [/i] Uninstall Imported Windows Subsystem for Linux (WSL) Distro in Windows 10
    1. Open a command prompt.

    2. Copy and paste the command below into the command prompt, and press Enter. This will give you a list of all currently installed WSL distros for the current user. (see screenshot below)
    *Arrow wsl --list --all


    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 [​IMG]

    3. Enter the command below into the command prompt, and press Enter. (see screenshot below)
    *Arrow wsl --unregister <DistributionName>

    *note Substitute <DistributionName> in the command above with the actual WSL distro name (ex: "Debian-Custom") from step 2 you want to uninstall (unregister).

    For example: wsl --unregister Debian-Custom



    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 [​IMG]

    4. When finished, you can close the command prompt if you like.

    That's it,
    Shawn


    Related Tutorials

    :)
     
    Brink, May 30, 2018
    #1
  2. johngalt Win User
    johngalt, Oct 27, 2019
    #2
  3. Windows Subsystem Linux

    Hello,

    We would like to know more about the issue you're experiencing with using
    Windows Subsystem for Linux
    . Kindly answer the following questions:

    • Are you developing a program, an app, or a software for Linux?
    • Is your Window 10 PC connected to a domain?
    • Are you managing a Windows Server PC?
    • What troubleshooting steps have you tried so far?
    • Can you tell us the Version and OS build of your Windows 10 device? You can find this information by clicking the
      Start button, type About your PC, and then press
      Enter.

    We need the following information in order to determine if we need to refer your concern to the
    TechNet forums or the Microsoft Developer Network (MSDN) forums.

    For now, we suggest reviewing these support articles to find out if there's an issue with the installation of
    Windows Subsystem for Linux:


    We'll be waiting for your response.
     
    Devlin Sco, Oct 27, 2019
    #3
  4. Brink Win User

    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10

    What is new for Windows Subsystem for Linux in Windows 10 version 1903


    Source: What Windows Command Line Tools For Developers


    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 [​IMG]
    Tip How to Enable or Disable Windows Subsystem for Linux (Bash on Ubuntu) in Windows 10

    How to Export and Import Windows Subsystem for Linux (WSL) Distro in Windows 10
     
    Brink, Oct 27, 2019
    #4
  5. Brink Win User
    What is new for Windows Subsystem for Linux in Windows 10 version 1903

    Source: What Windows Command Line Tools For Developers


    Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 [​IMG]
    Tip How to Enable or Disable Windows Subsystem for Linux (Bash on Ubuntu) in Windows 10

    How to Export and Import Windows Subsystem for Linux (WSL) Distro in Windows 10
     
    Brink, Oct 27, 2019
    #5
  6. Brink Win User
    Sideloading Custom Linux Distro to Windows 10 Subsystem for Linux

    Source: Open Sourcing a WSL Sample for Linux Distribution Maintainers and Sideloading Custom Linux Distributions Windows Command Line Tools For Developers
     
    Brink, Oct 27, 2019
    #6
Thema:

Export and Import Windows Subsystem for Linux WSL Distro in Windows 10

Loading...
  1. Export and Import Windows Subsystem for Linux WSL Distro in Windows 10 - Similar Threads - Export Import Subsystem

  2. Windows Subsystem for Linux WSL will not install any Linux Distro

    in Windows 10 Gaming
    Windows Subsystem for Linux WSL will not install any Linux Distro: I am using a Windows PC with the following specs:Edition: Windows 11 HomeVersion: 23H2OS build: 22631.2338Experience: Windows Feature Experience Pack 100.22674.1000.0 Processor: IntelR CoreTM i5-9400F CPU @ 2.90GHz 2.90 GHzInstalled RAM: 16.0 GBSystem type: 64-bit operating...
  3. Windows Subsystem for Linux WSL will not install any Linux Distro

    in Windows 10 Software and Apps
    Windows Subsystem for Linux WSL will not install any Linux Distro: I am using a Windows PC with the following specs:Edition: Windows 11 HomeVersion: 23H2OS build: 22631.2338Experience: Windows Feature Experience Pack 100.22674.1000.0 Processor: IntelR CoreTM i5-9400F CPU @ 2.90GHz 2.90 GHzInstalled RAM: 16.0 GBSystem type: 64-bit operating...
  4. How to import and export WSL distros on Windows 10

    in Windows 10 News
    How to import and export WSL distros on Windows 10: [ATTACH] [ATTACH]With Windows 10, Microsoft allows a user to run multiple Linux distros based on WSL or Windows Subsystem for Linux. But when reinstalling or resetting Windows 10, all the configuration stored with these WSL distros gets deleted. Or to back [...] This post...
  5. List Users in Windows Subsystem for Linux (WSL) Distro in Windows 10

    in Windows 10 Tutorials
    List Users in Windows Subsystem for Linux (WSL) Distro in Windows 10: How to: List Users in Windows Subsystem for Linux (WSL) Distro in Windows 10 How to List Users in Windows Subsystem for Linux (WSL) Distro in Windows 10 The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line...
  6. Add User to Windows Subsystem for Linux (WSL) Distro in Windows 10

    in Windows 10 Tutorials
    Add User to Windows Subsystem for Linux (WSL) Distro in Windows 10: How to: Add User to Windows Subsystem for Linux (WSL) Distro in Windows 10 How to Add User to Windows Subsystem for Linux (WSL) Distro in Windows 10 The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools...
  7. Unregister Windows Subsystem for Linux (WSL) Distro in Windows 10

    in Windows 10 Tutorials
    Unregister Windows Subsystem for Linux (WSL) Distro in Windows 10: How to: Unregister Windows Subsystem for Linux (WSL) Distro in Windows 10 How to Unregister and Reset Windows Subsystem for Linux (WSL) Distro in Windows 10 The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux...
  8. Install Windows Subsystem for Linux (WSL) Distros in Windows 10

    in Windows 10 Tutorials
    Install Windows Subsystem for Linux (WSL) Distros in Windows 10: How to: Install Windows Subsystem for Linux (WSL) Distros in Windows 10 How to Install Windows Subsystem for Linux (WSL) Distros in Windows 10 The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools...
  9. Run Windows Subsystem for Linux (WSL) Distro in Windows 10

    in Windows 10 Tutorials
    Run Windows Subsystem for Linux (WSL) Distro in Windows 10: How to: Run Windows Subsystem for Linux (WSL) Distro in Windows 10 How to Run a Windows Subsystem for Linux (WSL) Distro in Windows 10 The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on...
  10. Set Default Windows Subsystem for Linux (WSL) Distro in Windows 10

    in Windows 10 Tutorials
    Set Default Windows Subsystem for Linux (WSL) Distro in Windows 10: How to: Set Default Windows Subsystem for Linux (WSL) Distro in Windows 10 How to Set Default Windows Subsystem for Linux (WSL) Distro in Windows 10 The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools...