Files
docs/platforms/virtualization/hyper-v/forcefully-stop-guestvm.md
Nicole Rappe b0a094e6fa
All checks were successful
GitOps Automatic Documentation Deployment / Sync Docs to https://kb.bunny-lab.io (push) Successful in 5s
GitOps Automatic Documentation Deployment / Sync Docs to https://docs.bunny-lab.io (push) Successful in 9s
Add platforms/virtualization/hyper-v/forcefully-stop-guestvm.md
2026-02-19 15:31:10 -07:00

1.2 KiB

Purpose

If you have a GuestVM that will not stop gracefully either because the Hyper-V host is goofed-up or the VMMS service won't allow you to restart it. You can perform a hail-mary to forcefully stop the GuestVM's Hyper-V process.

!!! warning "May Cause GuestVM to be Inconsistent" This is meant as a last-resort when there are no other options on-the-table. You may end up corrupting the GuestVM by doing this.

Get the VMID of the GuestVM

Get-VM SERVER-01 | Select VMName, VMId

# Example Output
# VMName VMId
# ------ ------------------------------------
# DC3    3e4b6f91-6c6c-4075-9b7e-389d46315074

Extrapolate Process ID

Now you need to hunt-down the process ID associated with the GuestVM.

Get-CimInstance Win32_Process -Filter "Name='vmwp.exe'" |
Where-Object { $_.CommandLine -match "3e4b6f91-6c6c-4075-9b7e-389d46315074" } |
Select-Object ProcessId, CommandLine

# Example Output
# ProcessId CommandLine
# --------- ---------------------------------------------------------
# 12488     "C:\Windows\System32\vmwp.exe" -vmid 3e4b6f91-6c6c-4075-9b7e-389d46315074

Terminate Process

Lastly, you terminate the process by its ID.

Stop-Process -Id 12488 -Force