Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 does not start right away #7298

Closed
1 of 2 tasks
jamestut opened this issue Aug 10, 2021 · 5 comments
Closed
1 of 2 tasks

WSL2 does not start right away #7298

jamestut opened this issue Aug 10, 2021 · 5 comments

Comments

@jamestut
Copy link

Windows Build Number

Microsoft Windows [Version 10.0.19043.1110]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.4.72

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

  1. Repeatedly call wsl.exe -- (command) from a Windows program or script.
  2. That's it! Not every wsl.exe call works. If you do this in a rapid succession, let's say four times a second, then probably out of 10 wsl.exe calls, 5 succeeded, while the other 5 failed as if nothing happened.

Expected Behavior

wsl.exe should start the requested program inside the WSL2 Linux distro right away.

image

Actual Behavior

Sometimes WSL2 does not want to start immediately. Instead it just bail out. This problem gets worse the more often I invoke the wsl.exe from a Windows program or script. As I was doing something here with a program, the problem is very easy to reproduce. As can be seen in this terminal, wsl.exe just does nothing after several attempts.

image

Note that this problem is not limited to 1904x builds, but all insider builds as well all the way to Windows 11 beta builds like 22000.

Diagnostic Logs

No response

@benhillis
Copy link
Member

/logs

@ghost
Copy link

ghost commented Aug 10, 2021

Hello! Could you please provide more logs to help us better diagnose your issue? You can find instructions on how to attach logs here, please make sure to post the link to the Feedback Hub item in this chat so we can see it.

Thank you!

@GrumpyMeow
Copy link

GrumpyMeow commented Aug 13, 2021

I'm also having this issue. This is now the second machine on which this issue occurs this week. I was setting up a new Windows 10 2004 machine and installed all recent updates.

I notice that the commands "wsl --status" and "wsl --update" on a machine which DOES work are unknown commands (19043.1110, 21H1). Pending windows updates:

  • Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.345.435.0)
  • 2021-08 Cumulative Update for Windows 10 Version 21H1 for x64-based Systems (KB5005033)
  • Windows Malicious Software Removal Tool x64 - v5.92 (KB89030)

After installing these three pending Windows updates, this working machine also didn't work anymore. So it's definitly one of these three Windows updates which causes the issue:

Default Distribution: Ubuntu-20.04
Default Version: 1

Windows Subsystem for Linux was last updated on 24-2-2021
The Windows Subsystem for Linux kernel can be manually updated with 'wsl --update', but automatic updates cannot occur due to your system settings.
To receive automatic kernel updates, please enable the Windows Update setting: 'Receive updates for other Microsoft products when you update Windows'.
For more information please visit https://aka.ms/wsl2kernel.

Kernel version: 5.4.72
PS C:\Users\sander> wsl
PS C:\Users\sander> wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-20.04    Stopped         2
  Ubuntu          Stopped         2
> wsl --update
Checking for updates...
No updates are available.
Kernel version: 5.4.72
> wsl
>

Solution!
After uninstalling the update "Security Update for Microsoft Windows (KB5005033)". The system started working again.
"Windows Update" > "View Windows History" > "Uninstall Update"

@jamestut
Copy link
Author

@GrumpyMeow hmm, actually I have been experiencing this issue long time ago, around early 2004 release (19041.267). However, with this latest update, the problem is even more pronounced. Previously it would only fail in the script, but never failed on manual wsl invocation. This time it can fail consistently even with manual invocation and after the script has long been stopped. Will check again (and make a dump) when I got the chance to rapid fire WSL2 from my script.

The problem doesn't appear right away in my case. Has to do prolonged scripting WSL2 on a Windows app for it to appear. Once appeared, I can consistently reproduce it until next WSL2 shutdown.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

No branches or pull requests

3 participants