tl;dr:

  • Open PowerShell As Admin.
  • Find VM's GUID.
    Get-WmiObject -Namespace root\virtualization\v2 -class msvm_computersystem | select elementname, processid, name| ft -auto
  • Kill related vmwp.exe <GUID>.
    taskkill /PID 1234 /F
  • (Only during specific scenarios/if above won't work): net stop vmms & Restart Hyper-V Server.

 

What happened?!

Someday I was in the process of shutting down an Hyper-V Virtual Machine (VM).

Surprisingly, this specific VM refused to die shutdown and hanged in there (this may happen for a number of reasons - honestly? IDK - looks like it might have something to do with RRAS & VMs).

Hyper-V-StoppingCriticalVM-Won't-TurnOFF

Hyper-V-StoppingCriticalVM-Won't-TurnOFF

Anyway, in order to shutdown the hung VM, it's just a matter of killing the related "Virtual Machine Worker Process" (vmwp.exe) that manages the VM.

  • Open Task Manager -> "Details"-tab then order the list "by Name", you will notice a bunch of vmwp.exe, with each process dedicated to a specific VM.
TaskManagerVMWPGUID

TaskManagerVMWPGUID

Each VM runs as a Special User, this User's Name is the VM's GUID (example above).

To match the GUID of a VM to the respective VM Name, Open a PowerShell As Admin prompt and type:

get-vm | fl *

Get-VM | fl *

Get-VM | fl *

The above command will list ALL your VM's properties (GUIDs included).

Just skim through the Output of the above command until you find the VM that is not responding and match it to its respective GUID.

TaskManagerEndTaskVMWP

TaskManagerEndTaskVMWP

Once you have the VM's GUID, you may now Open Task Manager and Kill the vmwp.exe process linked to the VM that is not responding.

  • Sometimes "End task" wouldn't work and the vmwp.exe process may still hang around.

If that is the case, you might have to use the hammer stop the "Hyper-V Virtual Machine Management Service" (vmms) then Restart your whole Server (unfortunately that would take down all your other running VMs).

 

Senior Professional Network and Computer Systems Engineer during work hours and father when home.

Andrea strives to deliver outstanding customer service and heaps of love towards his family.

In this Ad-sponsored space, Andrea shares his quest for "ultimate" IT knowledge, meticulously brought to you in an easy to read format.

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook