TechOnTip Weblog

Run book for Technocrats

How to KILL a Hyper-v Virtual Machine?

Posted by Brajesh Panda on May 13, 2011

All virtual machines usually run as a process instance under process “vmwp.exe”. So to kill any specific virtual machine we need to find the Process ID or Virtual Machine GUID f. Then you can use Windows Task Manager /Powershell/Commadline to kill the same

I have already mentioned how to find process id or virtual machine GUID in another post. Here it is! Now let’s go ahead kill this bumpy virtual machine. As soon as you kill the virtual machine vmwp.exe will restart the same. So if you want to turn it off use turn off parameters too.

Killing Virtual Machine Using Powershell

You can save below 3 lines in a ps1 (Powershell file) & utilize the same directly.

$VMName = read-host -Prompt “Enter Virtual Machine Name”

$kill = (gwmi -q “SELECT * FROM Msvm_ComputerSystem WHERE ElementName = ‘$VMname'” -n root\virtualization).ProcessID

Stop-Process -id $kill –F

Killing Virtual Machine Using Windows Task Manager

After you found the VM GUIDs, open up Windows Task Manager, Go to Performance Tab, Click on View Menu, Click Select Columns & make sure you select PID & Command Line.

Now from Command Line Colum find out the VMWP.exe process which is referring to the above GUID. And you can kill the process afterwards. Refer to the below screenshot


Advertisements

4 Responses to “How to KILL a Hyper-v Virtual Machine?”

  1. Save below script to a PS1 file & enjoy!

    # Get Details about virtual machines
    Get-WmiObject -Namespace root\virtualization -class msvm_computersystem | select elementname, operationalstatus, processid, name |ft -auto

    # Kill Hyper-v Virtual Machine
    $VMName = read-host -Prompt “Enter Virtual Machine Name To KILL”
    $kill = (gwmi -q “SELECT * FROM Msvm_ComputerSystem WHERE ElementName = ‘$VMname'” -n root\virtualization).ProcessID
    Stop-Process -id $kill -F -c

  2. […] most of the VMware administrators must know this. In past I have also posted another article about How to KILL a Hyper-v VM? I mostly use these steps when VM is unresponsive and power off button is grayed […]

  3. Heya! I realize this is somewhat off-topic but I needed to ask.
    Does operating a well-established website such as yours take a
    massive amount work? I’m brand new to blogging but I do write in my journal on a daily basis. I’d like to start a blog so I can easily share my personal experience and feelings
    online. Please let me know if you have any suggestions or tips for brand new aspiring blog owners.
    Appreciate it!

  4. hämorrhoiden symptome
    I loved as much as you’ll receive carried out right here. The sketch is attractive, your authored material stylish. nonetheless, you command get bought an edginess over that you wish be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this increase.

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

 
%d bloggers like this: