microsoft / WSL

Issues found on WSL

Home Page:https://docs.microsoft.com/windows/wsl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WSL Service Disables Automatically After Reboot or Logoff

Haerbin23456 opened this issue · comments

Windows Version

Microsoft Windows [版本 10.0.22631.3447]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.146.1-microsoft-standard-WSL2

Distro Version

Ubuntu 22.04

Other Software

Avast One, version 24.4.6112 (build 24.4.9067.835)

Repro Steps

  1. Try to run command wsl.exe --status, and the result be like:
无法启动服务,原因可能是已被禁用或与其相关联的设备没有启动。
Error code: Wsl/0x80070422

Then I found out the WSL Service is disabled.
2. Configure WSL service to Automatic start and ensure it is running. Now command wsl.exe --status succeed.
3. Restart the computer or log off and then log back in.
4. Check the status of the WSL Service. Observe that the WSL Service is disabled again. Try to run command wsl.exe --status, failed just like before.

Expected Behavior

The WSL service should remain enabled and set to automatic start after a system reboot or logoff/logon cycle, maintaining its state across system sessions.

Actual Behavior

After rebooting the system or logging off and on, the WSL service is found to be disabled. This issue occurs intermittently and has been observed to happen within approximately 20 seconds after logging in, as indicated by system logs. This behavior persists despite the service being manually set to automatic start and confirmed to be running prior to reboot or logoff.
I suspect there might be an interaction with Avast One antivirus software affecting the WSL service. However, I have already added the WSL service executable (C:\Program Files\WSL\wslservice.exe) to Avast's exceptions list, but the issue persists.

Diagnostic Logs

WslLogs-2024-05-11_16-40-56.zip

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

The logs show that wslservice is disabled. Try to run (elevated command prompt): sc.exe config wslservice start= demand and see if that solves the issue

Diagnostic information
Issue was edited and new log file was found: https://github.com/microsoft/WSL/files/15297449/WslLogs-2024-05-11_16-40-56.zip
Detected appx version: 2.1.5.0
Detected user visible error: Wsl/0x80070422

The logs show that wslservice is disabled. Try to run (elevated command prompt): sc.exe config wslservice start= demand and see if that solves the issue

Diagnostic information

WSL Service started at first, but got disabled again shortly after reboot.

commented

Thank you @Haerbin23456. Do you have some kind of AntiVirus / security solution installed ?

For instance we know that AVG can disable wslservice unless you create an exclusion rule.

Thank you @Haerbin23456. Do you have some kind of AntiVirus / security solution installed ?

For instance we know that AVG can disable wslservice unless you create an exclusion rule.

I installed Avast One, but I have added the WSL service executable (C:\Program Files\WSL\wslservice.exe) to Avast's exceptions already. The issue persists.