2

I use WSL2 and Docker Desktop for development. After stopping all Docker containers, stopping Docker Desktop, and shutting down all WSL distributions, I'm under the impression that there shouldn't be any VMs still running, but there is still one vmmem process remaining.

vmmem process

Hyper-V Manager says that there are no running VMs, and Get-VM in Powershell returns nothing.

How do I find where this VM is coming from so that I can shut it down?

Edit: ProcessExplorer output: ProcessExplorer

Edit: wsl -l -v output:

PS C:\Users\flagr> wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu-20.04           Stopped         2
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2
Omegastick
  • 121
  • 1
  • 5
  • Please see if this post helps you: https://superuser.com/questions/1559170/how-can-i-reduce-the-consumption-of-the-vmmem-process – John May 14 '21 at 16:51
  • @John Unfortunately, none of the answers in that post help. WSL and Docker are both shut down entirely, and the Hyper-V Manager doesn't show any running VMs. – Omegastick May 14 '21 at 16:58
  • What does [ProcessExplorer](https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer) say? – Ramhound May 14 '21 at 18:08
  • @Ramhound I added a screenshot of ProcessExplorer to the main post. – Omegastick May 14 '21 at 18:31
  • Are you by chance on an Insiders Preview build of Windows? You performed the shutdown command on WSL, correct? – Ramhound May 14 '21 at 18:35
  • 1
    @Ramhound I am. I think that's a requirement for WSL2. I've run `wsl --shutdown`. That's the command you mean, right? – Omegastick May 14 '21 at 18:35
  • @Omegastick - That is false; WSL2 has been around since 1909. I am suspecting perhaps a memory leak of some kind. As a reminder WSL2 while using virtualization does not actually use Hyper-V since it’s supported on Windows 10 Home; Yes; That’s the command; I assume a Restart (or shift shutdown) clears up the process? – Ramhound May 14 '21 at 18:38
  • For kicks and giggles can you run **wsl -l -v** and provide the output (before that reboot) – Ramhound May 14 '21 at 18:41
  • @Ramhound Oh, I might look at getting off the insider build then. I added the output of `wsl -l -v` to the main post. Docker Desktop (and maybe WSL?) run on startup, so there are immediately a few `vmmem` processes when I start my PC up. I can see what happens if I disable them though. – Omegastick May 14 '21 at 18:52
  • My recommendation would be to either use 20H2 or wait for 21H1 to be released. However, there isn’t a guarantee, this behavior isn’t [necessarily](https://blog.simonpeterdebbarma.com/2020-04-memory-and-wsl/) normal. – Ramhound May 14 '21 at 18:55
  • Thanks, I'll have a go at moving back onto the release preview channel. – Omegastick May 14 '21 at 19:15
  • @omegastick Have you been successful eventually? I am running on WSL2 (Kernel 5.1.0.102.1) and Windows 10 22H2. I often have the same behavior where all Hyper-V VMs are off and all WSL instances are stopped, but the vmmem process still takes up to 70% CPU. I observed that even though WSL says all instances are stopped, the Docker Client may send the "WSL2 backend stoppped unexpectedly" message 10-15mins after I stopped all instances. And when this message pops up, the CPU load goes down. – Florian Bachmann Nov 15 '22 at 10:12

0 Answers0