https aka ms wslstore

Install the Windows Subsystem for Linux

Before installing any Linux distros for WSL, you must ensure that the «Windows Subsystem for Linux» optional feature is enabled:

Open PowerShell as Administrator and run:

Restart your computer when prompted.

Install your Linux Distribution of Choice

To download and install your preferred distro(s), you have three choices:

  • Download and install from the Microsoft Store (see below)
  • Download and install from the Command-Line/Script (read the manual installation instructions)
  • Download and manually unpack and install (for Windows Server — instructions here)

Windows 10 Fall Creators Update and later: Install from the Microsoft Store

This section is for Windows build 16215 or later. Follow these steps to check your build.

Open the Microsoft Store and choose your favorite Linux distribution.

The following links will open the Microsoft store page for each distribution:

From the distro’s page, select «Get»

Complete initialization of your distro

Now that your Linux distro is installed, you must initialize your new distro instance once, before it can be used.

Troubleshooting:

Below are related errors and suggested fixes. Refer to the WSL troubleshooting page for other common errors and their solutions.

Installation failed with error 0x80070003

  • The Windows Subsystem for Linux only runs on your system drive (usually this is your C: drive). Make sure that distros are stored on your system drive:
  • Open Settings ->Storage ->More Storage Settings: Change where new content is saved

WslRegisterDistribution failed with error 0x8007019e

The Windows Subsystem for Linux optional component is not enabled:

Open Control Panel -> Programs and Features -> Turn Windows Feature on or off -> Check Windows Subsystem for Linux or using the PowerShell cmdlet mentioned at the begining of this article.

There are several scenarios in which you may not be able (or want) to, install WSL Linux distros via the Microsoft Store. Specifically, you may be running a Windows Server or Long-Term Servicing (LTSC) desktop OS SKU that doesn’t support Microsoft Store, or your corporate network policies and/or admins to not permit Microsoft Store usage in your environment.

In these cases, while WSL itself is available, how do you download and install Linux distros in WSL if you can’t access the store?

Note: Command-line shell environments including Cmd, PowerShell, and Linux/WSL distros are not permitted to run on Windows 10 S Mode. This restriction exists in order to ensure the integrity and safety goals that S Mode delivers: Read this post for more information.

Downloading distros

If the Microsoft Store app is not available, you can download and manually install Linux distros by clicking these links:

This will cause the .appx packages to download to a folder of your choosing. Follow the installation instructions to install your downloaded distro(s).

Downloading distros via the command line

If you prefer, you can also download your preferred distro(s) via the command line:

Download using PowerShell

To download distros using PowerShell, use the Invoke-WebRequest cmdlet. Here’s a sample instruction to download Ubuntu 16.04.

If the download is taking a long time, turn off the progress bar by setting $ProgressPreference = ‘SilentlyContinue’

Download using curl

Windows 10 Spring 2018 Update (or later) includes the popular curl command-line utility with which you can invoke web requests (i.e. HTTP GET, POST, PUT, etc. commands) from the command line. You can use curl.exe to download the above distros:

In the above example, curl.exe is executed (not just curl ) to ensure that, in PowerShell, the real curl executable is invoked, not the PowerShell curl alias for Invoke-WebRequest

Note: Using curl might be preferable if you have to invoke/script download steps using Cmd shell and/or .bat / .cmd scripts.

Installing your distro

If you’re using Windows 10 you can install your distro with PowerShell. Simply navigate to folder containing the distro downloaded from above, and in that directory run the following command where app_name is the name of your distro .appx file.

If you are using Windows server you can find the install instructions on the Windows Server documentation page.

Once your distro is installed please refer to the Initialization Steps page to initialize your new distro.

Applies to Windows Server 2019 and later

At //Build2017, Microsoft announced that Windows Subsystem for Linux will be available on Windows Server. These instructions walk through running the Windows Subsystem for Linux on Windows Server 1709 and later.

Enable the Windows Subsystem for Linux (WSL)

Before you can run Linux distros on Windows, you must enable the «Windows Subsystem for Linux» optional feature and reboot.

Open PowerShell as Administrator and run:

Restart your computer when prompted. This reboot is required in order to ensure that WSL can initiate a trusted execution environment.

Download a Linux distro

Follow these instructions to download your favorite Linux distribution.

Extract and install a Linux distro

Now that you’ve downloaded a distro, extract its contents and manually install the distro:

Extract the .appx package’s contents, e.g. using PowerShell:

Run the distro launcher To complete installation, run the distro launcher application in the target folder, named .exe . For example: ubuntu.exe , etc.

  • Installation failed with error 0x8007007e: This error occurs when your system doesn’t support WSL. Make sure that:
    • You’re running Windows build 16215 or later. Check your build.
    • The Windows Subsystem for Linux optional component is enabled and the computer has restarted. Make sure WSL is enabled.

Add your distro path to the Windows environment PATH ( C:UsersAdministratorUbuntu in this example), e.g. using Powershell:

You can now launch your distro from any path by typing .exe . For example: ubuntu.exe

Now that your Linux distro is installed, you must initialize your new distro instance before using your distro.

Оцените статью