How to Stop a Stuck Hiper-V Máquina virtual.
It is stuck in the Stopping o Running state and doesn’t give any Turn Off, Shutdown, Ahorrar, Pause or Reset options.
One way it’s possible to kill off that stuck máquina virtual is to open Task Manger and end the task responsible for that machine. Unfortunately, it’s not quite that simple because the Máquina virtual Worker Process which is responsible for running the máquina virtual appears numerous times, once for each running guest machine!
Método 1
If you have a small number of VMs:
- Abierto Task Manager and view the Details pestaña;
- You will see many vmwp.exe running processes with the Username column including the machine GUIDs;
- Browse to the location where the virtual machines are stored and open the folder of the máquina virtual which is currently hung. From here we can find the machine configuration file and make note of the GUID for that machine;
- Now we know which GUID relates to the máquina virtual that we are looking to stop. Jump back to Task Manager, right-click on the correct process, y End Process.
NOTA: This process should only be used as a last resort as it could cause corruption of the máquina virtual!
Método 2
If you have a bunch of running VMs. The fastest way is to find the needed máquina virtual GUID with the PowerShell command.
Get-VM <vmname> | fl *
Now we know which GUID relates to the máquina virtual that we are looking to stop. Jump back to Task Manager, right-click on the correct process, y End Process.
This command pulls a list of máquina virtual names and GUIDs then compares that to a list of GUIDs in the Command Line of the processes running and returns máquina virtual names with the associated Process ID (no máquina virtual GUID).
Get-WmiObject Win32_Process -Filter "Name like '%vmwp%'" | %{$vm=get-vm -id $_.CommandLine.split(" ")[1];"$($_.processID)`t$($vm.name)"}
Método 3
Usar Sysinternals Process Explorer.