Step-by-Step Guide to Installing WSL on Windows 10 in 2024
- To set up WSL on Windows 10, launch the Command Prompt (or PowerShell) with administrator privileges and execute the command
wsl --install
to install all necessary components of WSL2 along with the Ubuntu Linux distribution. - If you wish to install a specific Linux distribution, use the command
wsl --install -d DISTRO-NAME
, and to refresh the WSL kernel, you can runwsl --update
. - Another option is to download WSL and various Linux distributions directly from the Microsoft Store.
UPDATED 10/31/2024: The Windows Subsystem for Linux (WSL) enables users to run a Linux environment directly on Windows 10 without the complexity of setting up full virtualization tools such as Hyper-V, VMware Workstation, or Oracle VirtualBox, nor does it necessitate a dual-boot configuration. Essentially, WSL provides seamless access to robust Linux command-line tools, all while you remain on your standard Windows desktop.
This functionality comprises two primary versions: WSL1 and WSL2. The initial version, known as WSL1, integrates with the Windows operating system through a translation layer that communicates with Windows system calls. However, this method resulted in slower performance, particularly regarding file operations and resource-heavy tasks.
In contrast, WSL2 operates using a lightweight virtual machine and incorporates a complete Linux kernel via the Microsoft Hyper-V hypervisor. This advancement offers notably improved speed and broader application compatibility, making it suitable for intricate development tasks, resource-intensive applications, and Docker support.
Although primarily designed for command-line apps, WSL also supports the installation and execution of GUI (Graphical User Interface) applications through tools like X11 or Wayland.
While you can still access WSL1, it is strongly advised to transition to WSL2. Microsoft has streamlined the WSL installation on Windows 10 to a single command that downloads and sets up all necessary components, including the virtual machine platform and the default Ubuntu Linux distro.
This guide aims to walk you through the installation of Windows Subsystem for Linux (version 2) on Windows 10.
- Install WSL on Windows 10 using Command Prompt or PowerShell
- Install WSL on Windows 10 via Microsoft Store
- Install WSL on Windows 10 (older versions)
Install WSL on Windows 10 using Command Prompt or PowerShell
Follow these steps to install the Windows Subsystem for Linux on your Windows 10 system:
-
Open Start on Windows 10.
-
Search for Command Prompt (or PowerShell), right-click the first result, and select Run as administrator.
-
Enter the following command to install WSL on Windows 10 and hit Enter:
wsl --install
-
Restart your device to complete the WSL installation on Windows 11.
-
Follow any additional steps to configure your Linux distribution as required.
After finishing these steps, WSL will be installed on your system, equipped with the latest Ubuntu Linux distribution by default.
If you encounter the error code 14107, it may indicate that the “Virtual Machine Platform”feature is disabled. In this case, navigate to Settings > Optional features > More Windows features, check the box for “Virtual Machine Platform,” and click “OK” to install the necessary components. You can then run the WSL installation command again.
Install WSL with a Specific Distro
To install a particular Linux distribution using WSL on Windows 10, follow these steps:
-
Open Start.
-
Search for Command Prompt, right-click the first result, and select Run as administrator.
-
Execute the following command to display a list of available WSL distros for installation on Windows 10 and press Enter:
wsl --list --online
Quick note: Currently, you can install distributions like Ubuntu, Debian, Kali Linux, openSUSE, and SUSE Linux Enterprise Server. -
To install a specific distro on Windows 10, enter the following command and press Enter:
wsl --install -d DISTRO-NAME
Be sure to substitute “DISTRO-NAME” with the name of the desired distribution for installation, like Debian.
-
Restart your computer.
-
Proceed with the necessary setup for your chosen Linux distribution.
Upon completion of these steps, the Windows Subsystem for Linux 2 components will be set up alongside your chosen Linux distribution.
Update the WSL Kernel
To upgrade the WSL kernel to the latest version, follow these steps:
-
Open Start.
-
Search for Command Prompt, right-click the first result, and choose Run as administrator.
-
Input the following command to update the WSL kernel and press Enter:
wsl --update
After executing these steps, if an update is available, it will be downloaded and installed on your device.
If the update command fails to execute, navigate to Settings > Update & Security > Windows Update > Advanced options, and activate the “Receive updates for other Microsoft products when updating Windows” toggle switch.
Install WSL on Windows 10 via Microsoft Store
You also have the option to obtain the Windows Subsystem for Linux and various distributions from the Microsoft Store. However, prior to installation, you must enable both the “Virtual Machine Platform” and “Windows Subsystem for Linux” features.
1. Enable WSL Virtualization Components
Follow these instructions to enable the necessary system components for running Linux on Windows 10:
-
Open Start.
-
Search for Turn Windows Features on or off and click the top result to launch the app.
-
Check the box next to “Virtual Machine Platform” .
-
Check the box next to “Windows Subsystem for Linux” .
-
Click on the OK button.
-
Click on the Restart button.
After enabling these features, you can move on to download WSL from the Microsoft Store.
2. Install the Windows Subsystem for Linux App
To set up WSL on Windows 11 through the Microsoft Store, follow these steps:
-
Click the Install button.
-
Click the “Open Microsoft Store” button if prompted.
-
Click the Install button once more.
3. Installing a Linux Distribution
To install a Linux distribution from the Microsoft Store, execute these steps:
-
Launch the Microsoft Store app.
-
Search for Linux distributions, such as Debian.
-
Click on the Get button.
-
Click on the Open button.
After completing these steps, the Linux subsystem will successfully install on your Windows 10 machine, including support for Linux GUI applications and the chosen Linux distribution.
Install WSL2 on Windows 10 (Older Versions)
If you’re using Windows 10 version 1909 or earlier, you can still install WSL using legacy methods. This process involves enabling WSL1, as well as the Virtual Machine Platform feature, and configuring WSL2 as the default for future distro installations.
For ARM64 systems, Linux integration is supported starting from version 2004 and higher.
Enable Windows Subsystem for Linux
If you haven’t set up any Linux environment on Windows 10 yet, you’ll first need to activate Windows Subsystem for Linux (version 1) by following these steps:
-
Open Start on Windows 10.
-
Search for Turn Windows features on or off and click the top result to access the app.
-
Check the “Windows Subsystem for Linux” box.
-
Click the OK button.
-
Click the Restart button.
Upon completion of these steps, ensure that you also enable the Virtual Machine Platform feature.
Enable the Virtual Machine Platform
To activate the Virtual Machine Platform on Windows 10, follow these instructions:
-
Open Start.
-
Search for PowerShell, right-click the top result, and opt for Run as administrator.
-
Enter the following command to enable the Virtual Machine Platform feature and hit Enter:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
-
Restart your computer.
After performing these steps, you can set WSL version 2 as the default architecture, as well as convert existing distributions.
Enable Windows Subsystem for Linux 2
To utilize WSL2 or convert existing WSL distributions, follow these steps:
-
Download the WSL 2 kernel update (mandatory).
-
Double-click the wsl_update_x64.msi file to apply the update.
-
Open Start.
-
Search for PowerShell, right-click the top result, and select Run as administrator.
-
Execute the following command to set Windows Subsystem for Linux 2 as the default for new distributions and press Enter:
wsl --set-default-version 2
-
(Optional) To convert an existing distribution from WSL1 to WSL2, use the following command and hit Enter:
wsl --set-version Ubuntu 2
Remember to replace “Ubuntu” with the name of the distribution you want to convert. Use
wsl -l -v
if you need help identifying your distro’s name.
Upon completing these steps, your device will begin using the latest version of Windows Subsystem for Linux as the default architecture.
Confirm Distribution Platform
To verify whether your distributions are utilizing WSL2, follow these steps:
-
Open Start.
-
Search for PowerShell, right-click the first result, and choose Run as administrator.
-
Execute the following command to check the version of your distribution and press Enter:
wsl --list --verbose
-
Ensure that the version displayed for the distribution is 2.
Upon finishing these steps, you’ll know whether the process was successful or if any troubleshooting is required.
Update October 31, 2024: This guide has been revised for accuracy and to reflect any procedural changes.
Images Credit: Pureinfotech.com
Leave a Reply