Activating Windows Linux Subsystem 2 (WSL2)

Sign up for Windows Insider program

Activate Windows Insider Builds

  1. Enable Full Diagnostic Data

    • go to Settings –> Privacy –> Diagnostics & feedback –> Diagnostic data
    • Choose Full as the option
  2. Enable Telemetry Data via Registry

    • Open Registry Editor
      • Press Windows Key + R then type regedit to open registry editor
    • Navigate to:
    HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DataCollection
    
    • Right-click DataCollection, click New and then click DWORD (32-bit) Value
    • Name it as AllowTelemetry, and then press ENTER
    • Double-click AllowTelemetry, set the value as 3, and then click OK.

    • Repeat the above steps for:
    HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\DataCollection
    
    • Restart your computer
  3. Group Policy to enable Telemetry

    • Press Windows key + r and type gpedit.msc in the Run prompt, hit ENTER to launch group policy editor
    • Go to Computer Configuration –> Administrative Templates –> Windows Components –> Data Collection and Preview Builds
    • Double-click Allow Telemetry
    • In the Options box, configure the level as 3, and then click OK

Activate Insider Build

  1. Search for Check for Updates in the Windows search menu

  2. In the new window select Windows Insider Program at the bottom of the menu

  3. Select Get Started and follow the instructions, making sure you select Fast when asked

  4. Once you have completed the registration you will need to check for updates and let Windows install the new insider build.

  5. Once done you should restart your computer

Turn on linux subsystem feature

  1. Open Windows PowerShell as administrator and run the commands:

    Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    
  2. You will need to restart your computer again

Download the linux distro

  1. Open the Microsoft Store and choose your favorite Linux distribution by searching for them (I prefer Ubuntu):

  2. From the distro’s page, select Get

  3. Once done installing, open up Powershell as administrator and run (replace distro with the name of the distro you installed):

    wsl --set-version [Distro] 2
    
    wsl --set-default-version 2
    

Finalizing

  1. To complete the initialization of your newly installed distro, launch a new instance by searching in the Start menu and launching the distro

  2. The first time a newly installed distro runs, a Console window will open, and you’ll be asked to wait for a minute or two for the installation to complete

  3. Once installation is complete, you will be prompted to create a new user account (and its password)

  4. Most distros ship with an empty/minimal package catalog. You should regularly be updating your package catalog, and upgrading your installed packages using your distro’s preferred package manager

    sudo apt-get update && sudo apt-get upgrade
    
Next
Previous

Related