Software⏱️ 3 min read📅 2026-06-11

How to Fix: Enabling Windows Linux Subsystem error

Error when enabling Windows Linux Subsystem using PowerShell.

Quick Answer: Try reinstalling the Microsoft-Windows-Subsystem-Linux feature or running the command with elevated privileges.

The 'Enable-WindowsOptionalFeature' command error is typically encountered when attempting to enable the Windows Linux Subsystem. This error affects users who are trying to run commands such as `Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux` in PowerShell running as an administrator.

This error can be frustrating for users, especially those who rely on the Linux Subsystem for development or productivity purposes. The good news is that this issue can often be resolved with a few simple steps.

🛑 Root Causes of the Error

  • The primary reason for this error is that the required assembly for the Windows Linux Subsystem may not be installed or up-to-date. This can happen if the feature was not enabled during installation, or if it has been disabled by system administrators. Additionally, some older versions of Windows may not support this feature.
  • Another possible cause is a corrupted registry key, which can prevent the feature from being enabled. This can occur due to various reasons such as a failed installation attempt or accidental modifications to the registry.

✅ Best Solutions to Fix It

Enable-WindowsOptionalFeature using PowerShell

  1. Step 1: Open PowerShell and run the command `Get-Help Enable-WindowsOptionalFeature -Online` to view the available options and parameters for this command.
  2. Step 2: Next, run the command `Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux` as an administrator. If the error persists, try running the command again after a short delay.
  3. Step 3: If the issue continues, try using the following command to check if the feature is installed: `Get-WindowsCapability -Online | Where-Object {$_.DisplayName -like '*Microsoft-Windows-Subsystem-Linux*'}`

Update Windows and Enable Feature Manually

  1. Step 1: Open the Settings app on your Windows device and navigate to 'Update & Security' > 'Windows Update'. Ensure that Windows is up-to-date by checking for updates.
  2. Step 2: Next, open PowerShell as an administrator and run the command `Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux` again. If the error persists, proceed to the next step.

✨ Wrapping Up

To resolve the 'Enable-WindowsOptionalFeature' command error, try enabling the Windows Linux Subsystem using PowerShell or updating Windows and enabling the feature manually. If none of these methods work, it may be necessary to seek further assistance from a system administrator or Microsoft support.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions