WSL Stopped Working: Troubleshooting Windows Subsystem for Linux
Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables natively on Windows 10 and Windows Server 2019. However, sometimes WSL may stop working due to various reasons. In this article, we will discuss the possible causes and solutions for troubleshooting WSL when it stops working.
Check if WSL is Enabled
The first step is to check if WSL is enabled on your machine. To do this, open PowerShell as Administrator and run the following command:
wsl --list --verboseIf WSL is enabled, you should see a list of installed Linux distributions along with their corresponding WSL versions. If not, you need to enable WSL by running the following command:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartAfter enabling WSL, restart your machine and try running WSL again.
Check if Virtual Machine Platform is Enabled
WSL 2 requires the Virtual Machine Platform optional component to be enabled. To check if it is enabled, run the following command in PowerShell:
dism.exe /online /get-feature /featurename:VirtualMachinePlatform /allIf it is not enabled, run the following command to enable it:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartAfter enabling the Virtual Machine Platform, restart your machine and try running WSL again.
Check if WSL is Running as a Different User
WSL may stop working if it is running as a different user. To check if this is the case, run the following command in PowerShell:
wsl --shutdownThis will stop all running WSL distributions. Then, open a new command prompt as the user who is experiencing the issue and run the following command:
wslIf WSL starts without any issues, it was running as a different user. To avoid this issue in the future, make sure to run WSL as the same user.
Check if the WSL Version is Compatible with the Installed Linux Distribution
WSL 2 requires a newer version of the Linux kernel than WSL 1. If you have installed a Linux distribution that is not compatible with WSL 2, it may stop working. To check the WSL version, run the following command in PowerShell:
wsl --list --verboseIf the version is listed as "1", you need to upgrade to WSL 2. To do this, run the following command:
wsl --set-version <distro> 2Replace <distro> with the name of the Linux distribution you want to upgrade. Note that this may take some time, as it involves downloading and installing a new Linux kernel.
Check if the WSL Integration Service is Running
WSL requires the WSL Integration Service to be running in order to work properly. To check if it is running, open the Windows Services app and look for "Windows Subsystem for Linux". If it is not running, start it and set it to automatically start.
Reinstall the Linux Distribution
If none of the above solutions work, you may need to reinstall the Linux distribution. To do this, run the following command in PowerShell:
wsl --unregister <distro>Replace <distro> with the name of the Linux distribution you want to unregister. Then, reinstall the Linux distribution from the Microsoft Store.
- Check if WSL is enabled
- Check if Virtual Machine Platform is enabled
- Check if WSL is running as a different user
- Check if the WSL version is compatible with the installed Linux distribution
- Check if the WSL Integration Service is running
- Reinstall the Linux distribution