Skip to content

Instantly share code, notes, and snippets.

@dazeb
Last active January 24, 2024 08:07
Show Gist options
  • Select an option

  • Save dazeb/da3daf49032fab97e0b2bf28c27d1386 to your computer and use it in GitHub Desktop.

Select an option

Save dazeb/da3daf49032fab97e0b2bf28c27d1386 to your computer and use it in GitHub Desktop.
WslRegisterDistribution failed with error: 0x8007019e Error: 0x8007019e The Windows Subsystem for Linux has not been enabled.

WslRegisterDistribution failed with error: 0x8007019e Error: 0x8007019e The Windows Subsystem for Linux has not been enabled.

The error WslRegisterDistribution failed with error: 0x8007019e indicates that the Windows Subsystem for Linux (WSL) feature is not enabled on your Windows machine. To resolve this issue, you will need to enable WSL through the Windows features settings or by using PowerShell commands.

Here are the steps to enable WSL:

  1. Enable WSL via Windows Features:

    • Open the "Turn Windows features on or off" dialog by searching for it in the Windows search box.
    • Scroll through the list and find the "Windows Subsystem for Linux" option.
    • Check the box next to "Windows Subsystem for Linux" and click "OK."
    • Windows will install the necessary files and then prompt you to restart your computer to complete the installation.
  2. Enable WSL using PowerShell:

    • Open PowerShell as an Administrator.

    • Run the following command to enable the WSL feature:

      dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    • After enabling WSL, you may also want to enable the Virtual Machine Platform feature to use WSL 2, which provides an enhanced performance experience. To do so, run the following command:

      dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    • Restart your computer for the changes to take effect.

  3. Install the WSL 2 Linux kernel update package (if you plan to use WSL 2):

  4. Set WSL 2 as the default version (optional):

    • After installing the kernel update package, open PowerShell as an Administrator.

    • Run the following command to set WSL 2 as the default version:

      wsl --set-default-version 2
  5. Install a Linux distribution:

    • Open the Microsoft Store and search for your preferred Linux distribution (e.g., Ubuntu, Debian, etc.).
    • Click "Get" to download and install the distribution.
    • Once installed, launch the distribution, and it will complete the setup process.
  6. Troubleshooting:

    • If you encounter issues during the installation, ensure that your BIOS settings have virtualization enabled.
    • If the WSL feature doesn't appear in the Windows Features dialog or PowerShell commands don't resolve the issue, you may need to update your Windows version or check for any pending Windows updates that could include fixes for WSL-related problems.

Check the official Microsoft WSL installation guide for the most up-to-date instructions and troubleshooting steps. If problems persist, you can collect detailed logs using the collect-wsl-logs.ps1 script provided by Microsoft and file an issue on the WSL GitHub repository for further assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment