Killing a wedged virtual machine
While I would like to pretend that nothing ever goes wrong with Hyper-V – the fact of the matter is that sometimes things go wrong with the best systems.
Hyper-V has been designed in a modular fashion so that you can easily address any problems without affecting other virtual machines. But there can be a problem in figuring out what to do when things go wrong. Imagine that on my server the “FTP Server” has stopped responding – and I cannot even turn it off:
What I need to do is to kill the vmwp.exe process for the FTP Server. But how do I know which one to kill? Thankfully I can figure this out with a single line of PowerShell:
(gwmi -q "SELECT * FROM Msvm_ComputerSystem WHERE ElementName = 'FTP Server'" -n root\virtualization).ProcessID
Which will tell me exactly which one needs to be killed:
Now I can simply kill the vmwp.exe with a process ID of 2932 and restart the FTP Server.
Cheers,
Ben
Comments
Anonymous
April 19, 2011
I can see it being trivial to get access to the Process ID - any plans to show that Process ID in future versions of the Hyper-V Manager?Anonymous
April 19, 2011
Oh man, I wish I knew this. I had this happen to me Friday night when doing Windows Update deployment... I agree with goyuix, this would be a nice feature request to have the vmvp.exe tell us what guest OS it is running...Anonymous
April 20, 2011
I have had VMs go into a Stopping state and have attempted to use this to fix the issue on our 3 node cluster. Unfortunately, everytime I have attempted this the process does not die and the host stops responding forcing a hard shutdown.Anonymous
April 20, 2011
The comment has been removedAnonymous
April 28, 2011
This problem happened to me tonight. No way of shutting down the VM. I was going to try the powershell solution, but I couldn't find it on our 2008 server. I'm sure it was there somewhere, but ultimately the fix wasn't that difficult to figure out. Open Task manager and for all of the vmwp.exe tasks, watch the I/O Write bytes field. The field constantly changes when the VM is running, mine was frozen. I just killed that vmwp.exe task and the VM rebooted. Although this article pushed me in the right direction. Thanks, BenAnonymous
May 04, 2011
What about to use Reset or Turn Off VM command from Action menu in Hyper-V Manager console?Anonymous
May 16, 2011
Nice post.Much easier than looking up GUIDS manually. Wht do you do when the VMWP.exe wont terminate though? I've had it happen a couple of times now and only a hyper-v server restart (reset button) has worked.Anonymous
November 02, 2011
The comment has been removedAnonymous
August 07, 2012
Try changing the memory size on your VMAnonymous
May 01, 2015
I tried to stop BEN.exe it does not workAnonymous
March 06, 2016
I think this is one of the most vital info for me. And i'm glad reading your article.But want to remark on few general things, The web site style is perfect, the articles is really great : D. Good job, cheers