microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.18k stars 805 forks source link

WSL Shutdown problem #7542

Open Iskers opened 2 years ago

Iskers commented 2 years ago

Version

Microsoft Windows [Version 10.0.19043.1288]

WSL Version

Kernel Version

5.10.16

Distro Version

Kali Linux 2021.3

Other Software

No Docker.

Repro Steps

This is a duplicate of the issue 6878, as I am facing the same problem.

First I installed it with Win-Kex, but I reinstalled in order to check if Kex was doing it, but it did not solve the problem.

  1. Run WSL
  2. Open Task Manager
  3. Observe vmmem is running
  4. Shutdown WSL (wsl --shutdown) or (wsl --terminate kali-linux)
  5. VMMEM shutdown for a while then run again after a few seconds
  6. check wsl (wsl -l -v)
  7. WSL is running again.

The only distro this happens to is Kali. Ubuntu works normally.

I tried clearing my folder history as suggested.

Expected Behavior

WSL to shutdown and Vmmem to not be in the process list.

Actual Behavior

Vmmem restarting with Kali Linux running after shutting it down.

Diagnostic Logs

This is a wsl.etl file, but i was not allowed to upload it as such. wsl.txt

KiKoS0 commented 2 years ago

I have the exact same issue and it's really annoying, I don't have docker either and I tried clearing the cache. Also this is happening for me with a Debian distro.

MRColorR commented 2 years ago

Same problem here too, but removing kex from kali using the purge command and a Windows restart "fixed" it in my case. I noticed that when kex was still installed, after closing kali, in Windows 11 once in a while seemed that the focus of open windows in the desktop changed. Maybe kex does not close correctly and so it causes kali to start again?

poqdavid commented 1 year ago

Ok I also have the same problem but I never installed Kex and someone suggested I enable debugShell so once I did, I noticed other than it restarting itself after running wsl --shutdown it also restarts itself after switching to different applications I also disabled my av software while testing and av software wasn't the cause

Also, the restart doesn't happen when you quickly switch between applications but when like when you stay on one app for a few mins and then switch to another one

poqdavid commented 1 year ago

@Iskers @KiKoS0 @MRColorR Do any of you guys happen to have ArmouryCrate installed? cause I asked about this on superuser.com and with the help of this answer https://superuser.com/a/1746987/229729 found out that ArmouryCrate.UserSessionHelper.exe process for some reason is trying to access a file at this path \\wsl.localhost\kali-linux\usr\lib\win-kex\win-kex

Update: By digging some more noticed problem isn't the whole process but just AC_FDSPlugin

MRColorR commented 1 year ago

In my case I didn't have ArmouryCrate installed. But I agree that other similar apps may have the same behavior.

poqdavid commented 1 year ago

Yeah, you might be able to find out which process does it like searching for strings in the memory for wsl.localhost maybe

MrMarvel commented 9 months ago

This problem occurs only in new versions of wsl for me. On default version https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi it shutdowns perfectly

Shubhranshu153 commented 5 months ago

faced the same issue with wsl ubuntu. any fix or preferred workaround for this?