DEV Community

0xkoji
0xkoji

Posted on

WSL Troubleshooting Guide When You Can Not Access to WSL2 From Terminal

Here is a troubleshooting guide for when you suddenly become unable to access WSL.
This issue often occurs when using Docker Desktop in combination with WSL.

Problem: WSL Fails to Start

When attempting to run WSL, the following error appears:

[process exited with code 4294967295 (0xffffffff)]
You can now close this terminal with Ctrl+D, or press Enter to restart.
The Windows Subsystem for Linux instance has terminated.
Error code: Wsl/Service/0x80072745

[process exited with code 4294967295 (0xffffffff)]
You can now close this terminal with Ctrl+D, or press Enter to restart.
Enter fullscreen mode Exit fullscreen mode

Diagnosis Steps

  1. Check WSL status:
   wsl --status
Enter fullscreen mode Exit fullscreen mode
  1. Shut down all WSL instances:
   wsl --shutdown
Enter fullscreen mode Exit fullscreen mode
  1. List installed WSL distributions and their states:
   wsl -l -v
Enter fullscreen mode Exit fullscreen mode
  1. Terminate specific distributions if needed:
   wsl --terminate Ubuntu-24.04
Enter fullscreen mode Exit fullscreen mode
  1. Check the WSL service status:
   Get-Service LxssManager | Select-Object Name, Status, StartType
Enter fullscreen mode Exit fullscreen mode

â„šī¸ If this service is not found, it indicates WSL components aren't correctly installed.

  1. Verify WSL feature installation:
   dism.exe /online /get-featureinfo /featurename:Microsoft-Windows-Subsystem-Linux
Enter fullscreen mode Exit fullscreen mode

âš ī¸ This requires administrator privileges.

Solution

If you encounter error code 0x80072745 or if the LxssManager service is missing, follow these steps:

  1. Open PowerShell or Command Prompt as Administrator (right-click and select "Run as Administrator")

  2. Enable required Windows features:

   dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
   dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Enter fullscreen mode Exit fullscreen mode
  1. Restart your computer

  2. After restart, update WSL (as Administrator):

   wsl --update
Enter fullscreen mode Exit fullscreen mode
  1. Try launching WSL again

Additional Troubleshooting

If issues persist:

  • Reset WSL:
  wsl --unregister <distro-name>
Enter fullscreen mode Exit fullscreen mode

Then reinstall the distribution from the Microsoft Store.

  • Update Windows: Ensure your Windows is up to date as WSL updates are often delivered through Windows Update.

  • Check for conflicting software: Some antivirus or firewall software might block WSL operations.

References

Top comments (0)