Fix Hyper-V Virtual Machine Stuck in Stopping State



RECOMMENDED: Click here to fix Windows errors and optimize system performance

If for any reason your virtual machine running on Hyper-V stops working, stops responding and does not start / does not end / does not reboot after pressing the appropriate buttons on the Hyper-V console, your only option to solve this problem is to kill it by force. The process responsible for this virtual machine in the host operating system. We are going to show you how to forcefully restart Hyper-V dependent virtual machines running on Windows Server 2016/2019 without rebooting the entire host and running virtual machines (if you don’t have a Hyper-V. HA cluster and without a live migration).

For example, suppose that one of your Hyper-V Virtual Machines is either off (critical shutdown) or in startup state (x% startup).

The guest operating system is not responding and the “Turn Off”, “Shutdown” and “Reset” buttons in Hyper-V are not available or when you click return the next error:

  • The application has detected an error when trying to change the state of the virtual machine.
  • The status cannot be changed.
  • An operation cannot be performed while the object is in its current state.

Kill virtual machine

With kill we do not want to get rid of the virtual machine completely. Rather, it means completing the dependent process of the virtual machine and restarting it normally. This is a rather simple process, when there is one virtual machine running on the main computer. If you do, you can skip some of the steps that we are going to list below to find the GUID of the problematic virtual machine.

If you have a small number of virtual machines:

  • Open the task manager and open the “Details” tab.
  • You will see how many vmwp.exe processes are running in the “Username” column, including the computer’s GUID.
  • Go to the location of the virtual machines and open a folder for the virtual machine currently locked. From there, we can find the configuration file for the machine and record the GUID of that machine.
  • Now we know which GUID refers to the virtual machine that we want to shut down. Go back to Task Manager, right-click the correct process and stop the process.
  • NOTE. This process should only be used as a last resort as it can damage the virtual machine!

If you use more than one virtual machine.

The fastest way is to find the right GUID for the virtual machine using the Powersell command.

Get-VM | fl *.

Now we know which GUID refers to the virtual machine we want to shut down. Go back to task manager, right-click the correct process and stop the process.



Update:

We now recommend using this tool for your error. Additionally, this tool fixes common computer errors, protects you against file loss, malware, hardware failures and optimizes your PC for maximum performance. You can fix your PC problems quickly and prevent others from happening with this software:

  • Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
  • Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
  • Step 3 : Click “Repair All” to fix all issues.

download



This command gets the list of virtual machine names and GUIDs and compares it with the list of GUIDs on the command line of the running processes. It returns the names of virtual machines with the corresponding process identifier (not the virtual machine GUID).

Get-WmiObject Win32_Process -Filter “Name as ‘% vmwp%'” | % {$ vm = get-vm -id $ . CommandLine.split (“) [1]; “$ ($ . processID)` t $ ($ vm.name) “}.

Download Process Explorer from Microsoft Sysinternals

The process browser screen consists of two panels. The top window always displays a list of currently active processes, including the names of their own accounts, while the information displayed in the bottom window depends on the mode in which Process Explorer is in: if it is in Handle mode, this means that the process selected in the top window has been opened; when Process Explorer is in DLL mode, it displays the DLLs and memory card files loaded by the process. Process Explorer also has a powerful search function that quickly shows which processes have specific open descriptors or loaded DLLs.

Process Explorer’s unique features make it useful for tracking DLL version issues or troubleshooting, as well as for getting an overview of Windows and applications.

Change power settings

In fact, your Windows host computer’s power settings may also affect the state of your Hyper-V virtual machines. One respondent who faced the same problem said that changing the display to never turn it off solved the problem for them. So it’s worth a try. This is how it is done:

  • Open the Start menu by pressing the Windows key and searching for Power Plan.
  • Press Enter to see the result.
  • From there, in the pop-up menu, set the Disable Display option to Never.
  • Finally, click the Save Changes button.


RECOMMENDED: Click here to troubleshoot Windows errors and optimize system performance