Install WSL on your Windows instance
Windows Subsystem for Linux (WSL) is a free download that you can install on your Windows instance. By installing WSL, you can run native Linux command line tools directly on your Windows instance and use the Linux tools for scripting, alongside your traditional Windows desktop. You can easily swap between Linux and Windows on a single Windows instance, which you might find useful in a development environment.
For more information about WSL, see the Windows Subsystem for Linux Documentation
Limitations
-
WSL is available in two versions: WSL 1 and WSL 2.
-
For
.metal
EC2 instances, you can install either WSL 1 or WSL 2. -
For virtualized EC2 instances, you must install WSL 1.
-
-
For Windows Server operating systems, WSL can only be installed on instances running the following:
-
Windows Server 2019
-
Windows Server 2022
-
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
To install WSL 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
-
Restart your EC2 instance.
-
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
To 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.