logo logo

The next-generation blog, news, and magazine theme for you to start sharing your stories today!

The Blogzine

Save on Premium Membership

Get the insights report trusted by experts around the globe. Become a Member Today!

View pricing plans

New York, USA (HQ)

750 Sing Sing Rd, Horseheads, NY, 14845

Call: 469-537-2410 (Toll-free)

hello@blogzine.com

Step-by-Step Guide to Installing WSL on Windows 10 in 2024

avatar
Louis Ferguson

An editor at Blogzine


  • đź•‘ 6 minutes read
  • 8 Views
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 run wsl --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

Follow these steps to install the Windows Subsystem for Linux on your Windows 10 system:

  1. Open Start on Windows 10.

  2. Search for Command Prompt (or PowerShell), right-click the first result, and select Run as administrator.

  3. Enter the following command to install WSL on Windows 10 and hit Enter:

    wsl --install
    Windows 11 install WSL

  4. Restart your device to complete the WSL installation on Windows 11.

  5. 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:

  1. Open Start.

  2. Search for Command Prompt, right-click the first result, and select Run as administrator.

  3. 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.
  4. To install a specific distro on Windows 10, enter the following command and press Enter:

    wsl --install -d DISTRO-NAME
    Windows 11 install WSL specific distro

    Be sure to substitute “DISTRO-NAME” with the name of the desired distribution for installation, like Debian.

  5. Restart your computer.

  6. 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:

  1. Open Start.

  2. Search for Command Prompt, right-click the first result, and choose Run as administrator.

  3. Input the following command to update the WSL kernel and press Enter:

    wsl --update
    WSL update command

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:

  1. Open Start.

  2. Search for Turn Windows Features on or off and click the top result to launch the app.

  3. Check the box next to “Virtual Machine Platform” .

    Virtual Machine Platform and Windows Subsystem For Linux

  4. Check the box next to “Windows Subsystem for Linux” .

  5. Click on the OK button.

  6. 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:

  1. Access the Windows Subsystem for Linux store page.

  2. Click the Install button.

  3. Click the “Open Microsoft Store” button if prompted.

  4. Click the Install button once more.

    Microsoft Store WSL install

3. Installing a Linux Distribution

To install a Linux distribution from the Microsoft Store, execute these steps:

  1. Launch the Microsoft Store app.

  2. Search for Linux distributions, such as Debian.

  3. Click on the Get button.

    Microsoft Store install Linux distro

  4. 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:

  1. Open Start on Windows 10.

  2. Search for Turn Windows features on or off and click the top result to access the app.

  3. Check the “Windows Subsystem for Linux” box.

    Enable WSL 1 on Windows 10

  4. Click the OK button.

  5. 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:

  1. Open Start.

  2. Search for PowerShell, right-click the top result, and opt for Run as administrator.

  3. Enter the following command to enable the Virtual Machine Platform feature and hit Enter:

    Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
    Enable Virtual Machine Platform on Windows 10 using PowerShell

  4. 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:

  1. Download the WSL 2 kernel update (mandatory).

  2. Double-click the wsl_update_x64.msi file to apply the update.

  3. Open Start.

  4. Search for PowerShell, right-click the top result, and select Run as administrator.

  5. 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
    Enable WSL 2 on Windows 10 20H1

  6. (Optional) To convert an existing distribution from WSL1 to WSL2, use the following command and hit Enter:

    wsl --set-version Ubuntu 2
    Convert distro WSL 1 to WSL 2 on Windows 10 20H1

    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:

  1. Open Start.

  2. Search for PowerShell, right-click the first result, and choose Run as administrator.

  3. Execute the following command to check the version of your distribution and press Enter:

    wsl --list --verbose

  4. Ensure that the version displayed for the distribution is 2.

    Check distro using Windows Subsystem for Linux 2 on PowerShell

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.

Source

Images Credit: Pureinfotech.com



Leave a Reply

Your email address will not be published. Required fields are marked *