Windows Server Installation Guide

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.

  1. Open PowerShell as Administrator and run:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    
  2. 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:

  1. Extract the <distro>.appx package's contents, e.g. using PowerShell:

    Rename-Item ~/Ubuntu.appx ~/Ubuntu.zip
    Expand-Archive ~/Ubuntu.zip ~/Ubuntu
    

    Make sure your target directory (~/Ubuntu in this example) is on your system drive. Usually this is your C: drive. For example: C:\Distros\Ubuntu

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

    Expanded Ubuntu distro on Windows Server

    Troubleshooting

    • Installation failed with error 0x8007007e: This error occurs when your system doesn't support WSL. Make sure that:
  3. Add your distro path to the Windows environment PATH (C:\Distros\Ubuntu in this example), e.g. using Powershell:

    $userenv = [System.Environment]::GetEnvironmentVariable("Path", "User")
    [System.Environment]::SetEnvironmentVariable("PATH", $userenv + "C:\Distros\Ubuntu", "User")
    

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

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