Microsoft Troubleshooting

VM stuck at Stopping (Hyper V )

Force kill a VM instance

One of my colleagues is working with Microsoft on an issue with upgrading a VM from Server 2012 R2 to Server 2019.  While working on the action plan that Microsoft provided, he encountered an issue that the VM is stuck at the “Stopping” state.  He did not know what to do and ask Microsoft in the email about this. 

I stepped in and force stopped the machine for him, so he does not waste more time with Microsoft. 

To Force Stop this machine, you need to go to the Folder that contains the vhdx and the objects for this VM. 

If you go to Task Manager -> details tab, you will see a bunch of vmwp.exe running.  Look for the Machine ID in the User name field.  Once you find it, right click on it and end task.  This will force a reboot of the VM and the VM will no longer be in a “stopping” or “starting” state.

Alternatively, do it with PowerShell by first getting the PID associated with the VM process.

$Name = #Put the name of the VM here

$VM = Get-VM -Name $Name

$VMProcess = (Get-WmiObject Win32_Process | ? {$_.Name -match 'VMWP' -and $_.CommandLine -match $})

Stop-Process ($VMProcess.ProcessID) -Force

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s