Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Install Windows Subsystem for Linux on your EC2 Windows instance

Focus mode
Install Windows Subsystem for Linux on your EC2 Windows instance - Amazon Elastic Compute Cloud
This page has not been translated into your language. Request translation

There are two versions of Windows Subsystem for Linux (WSL) that you can install depending on your instance type and instance operating system: WSL 1 and WSL 2. For .metal instance types, you can install either WSL 1 or WSL 2. For all other instance types, the following requirements apply:

  • For virtualized EC2 instances, you must install WSL 1.

  • For instances that run Windows Server, the operating system version must be one of the following to install WSL:

    • Windows Server 2019

    • Windows Server 2022

Note

When you install WSL, it automatically enables Virtualization-based Security (VBS) on instance types that support it. EC2 instances don't support VBS for Windows Server 2025. The system could fail to start after a reboot if it's enabled.

For more information about WSL, see the Windows Subsystem for Linux Documentation on the Microsoft Build website.

Install WSL

The following instructions install WSL on an EC2 instance running Windows Server 2022. For the instructions to install WSL on an EC2 instance running Windows Server 2019, see Install WSL on previous versions of Windows Server on the Microsoft website. After you've followed those instructions, you can use step 3 in the instructions below to configure WSL to use WSL 1.

Install WSL 1
  1. To install WSL, run the following standard installation command on your EC2 instance, but make sure to enable WSL 1 by including --enable-wsl1. By default, WSL 2 is installed. If your instance was launched using a virtualized instance type, you must complete step 3 in this procedure to set the version to WSL 1.

    wsl --install --enable-wsl1 --no-launch
  2. Restart your EC2 instance.

    shutdown -r -t 20
  3. To configure WSL to use WSL 1, run the following command on your instance. For more information about setting the WSL version, see Manual installation steps for older versions of WSL on the Microsoft Build website.

    wsl --set-default-version 1
  4. Install the default distribution.

    wsl --install
Install WSL 2
  • To install WSL, run the following standard installation command on your EC2 instance. By default, WSL 2 is installed. If you are installing WSL on a .metal instance, then this is the only step to perform.

    wsl --install

    For more information, see Install Linux on Windows with WSL on the Microsoft Build website.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.