How to install WSL2 (Windows Subsystem for Linux 2) on Windows 10

Configurare noua (How To)

Situatie

Windows Subsystem for Linux 2 is now available on Windows 10 with various improvements, and this is how you can install and start using it.

Solutie

To install Windows Subsystem for Linux on Windows 10 2004 or higher, use these steps:

  1. Open Start on Windows 10.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to install the WSL on Windows 10 and press Enter:
    wsl --install
    Single command install WSL
    Single command install WSL
  4. Restart your computer to finish the WSL installation on Windows 10.
  5. Continue with the Linux distro setup as necessary.

Once you complete the steps, the required Linux components will automatically install the latest version of the Ubuntu Linux distribution.

Install WSL with specific distro

To install WSL with a specific distro on Windows 10, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view a list of available WSL distros you can install on Windows 10 and press Enter:
    wsl --list --online
    Quick note: At the time of this writing, you can install Ubuntu, Debian, Kali Linux, openSUSE, and SUSE Linux Enterprise Server.
  4. Type the following command to install the WSL with a specific distro on Windows 10 and press Enter:
    wsl --install -d DISTRO-NAME

    Windows 11 install WSL specific distro

    In the command, remember to replace “DISTRO-NAME” for the name of the distro you want to install, such as Debian.

  5. Restart your computer.
  6. Continue with the Linux distro setup as necessary.

After you complete the steps, the Windows Subsystem for Linux 2 components will install with the distro of Linux you specified.

To update the WSL kernel to the latest version, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to update the WSL kernel and press Enter:
    wsl --update
    WSL update command
    WSL update command

Once you complete the steps, if an update is available, then it will download and install on the device.

If the update command doesn’t work, open Settings > Update & Security > Windows Update > Advanced options, and turn on the “Receive updates for other Microsoft products when you update Windows” toggle switch.

  • Enable Windows Subsystem for Linux

If you are not already using Linux on Windows 10, you must enable the Windows Subsystem for Linux (version 1) with these steps:

  1. Open Start on Windows 10.
  2. Search for Turn Windows features on or off and click the top result to open the experience.
  3. Check the “Windows Subsystem for Linux” option.
    Enable WSL 1 on Windows 10
    Enable WSL on Windows 10
  4. Click the OK button.
  5. Click the Restart button.

Once you complete the steps, you need to enable the Virtual Machine Platform feature.

  • Confirm distro platform

To confirm distros are using the Windows Subsystem for Linux 2, use these steps:

  1. Open Start.
  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.
  3. Type the following command to verify the version of the distro and press Enter:
    wsl --list --verbose
  4. Confirm the distro version is 2.
    Check distro using Windows Subsystem for Linux 2 on PowerShell
    Check distro using Windows Subsystem for Linux 2 on PowerShell.

Tip solutie

Permanent

Voteaza

(4 din 9 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?