Skip navigation

Q: How can I stop a Hyper-V virtual machine?

A: Each virtual machine (VM) has its own worker process in the parent partition (your Windows Server 2008/2008 R2 server with Hyper-V role enabled). Most likely that worker process has hung or experienced a problem.

The solution is to kill the process for the worker process for that VM. A new worker process will automatically be launched when you start the VM again.

To find the process ID for the worker process for the hung VM, you can use Windows PowerShell. In the command below, replace <MyUnresponsiveVM> with the name of your VM that has hung:

(Get-WmiObject -q "SELECT * FROM Msvm_ComputerSystem WHERE ElementName = 'MyUnresponsiveVM'" -n root\virtualization).ProcessID

For example, I typed the command

PS C:\>(Get-WmiObject -q "SELECT * FROM Msvm_ComputerSystem WHERE ElementName = 'savdalclient.savilltech.net'" -n root\virtualization).ProcessID

and it returned 6168 as the process ID.

You can then kill the process with this command:

Stop-Process -Id <process ID>
    

Here it's used in my example:

Stop-Process -Id 6168

and I received this:

Confirm

Are you sure you want to perform the Stop-Process operation on the following item: vmwp(6168)?

[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y

You would type Y to confirm you want the process to stop.

 

Need more help? Still got issues? Check out all of the FAQs for Windows by John Savill.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish