Hyper-V Turn Off vs Shutdown | Virtual Machine Power Options
Hyper-V Turn Off vs Shutdown, they seem similar, but apparently, they are 2 different options on Hyper-V and other hypervisors. So, what is the difference between them? I will answer it in this article.
Case: The difference between “Turn Off” and “Shutdown” in Hyper-V?
Simple question, when I am in Hyper-V manager there are two options that seem similar but I am sure they are different. "Turn Off..." and "Shut Down..." What do they each do?
- Question from serverfault.com
Hyper-V is one of the most popular Type-1 hypervisors. You may also be bothered by the 2 Hyper-V power options “Turn Off” and “Shut Down” which seem to have similar functions, as in the case above. They both seem to refer to closing the virtual machine, but since they are listed as 2 different options, there must also be some differences in their functions.
In this article, I will answer what’s the difference between Hyper-V turn off vs shutdown, and introduce other power options that may confuse you.
What is the difference between Hyper-V Turn Off vs Shutdown
Right-click on the name of the running virtual machine on Hyper-V Manager, you can see the power options including Turn Off… and Shut Down…. What do they each refer to? What happens when you turn off a virtual machine? And what is the difference between turn off and shut down?
Here are the explanations:
- Turn Off: Instantly forcibly turns off the virtual machine as if you had pulled the power plug (only use if the VM is frozen).
- Shut Down: Same action as navigating inside the VM to Start > Shut Down. This gracefully initiates the shutdown procedure on the virtual machine’s operating system.
Except for the dropping menu of Hyper-V VMs, you can also see these options in VM Settings > Management > Automatic Stop Action. You can select what this virtual machine will do when the physical computer shuts down.
- Save the virtual machine state: Hyper-V will reserve disk space equal to the amount of memory used by the virtual machine when it is running so that memory can be written to disk when the physical computer shuts down.
- Turn off the virtual machine: This option will pull the plug on the virtual machine. No state information is saved. The guest OS will act as if the virtual machine lost power if/when it is started up again. You can use this option if you don’t care about the state of a virtual machine and you need a quicker host shutdown.
- Shut down the guest operating system: The guest OS of the virtual machine will be gracefully shut down when before the host will be shut down or restarted. No state is saved. The downside is that the integration service that controls shutting down the guest operating system must be installed and enabled on the virtual machine and the guest OS and its services will take time to start up when the host restarts. You should consider delaying and ordering the startup of virtual machines if you select this option.
Therefore, if you want to save the current state of your virtual machine and take care of the software and guest OS, you should choose to Shut Down your virtual machine. But if your virtual machine is not responding, and you backed up Hyper-V virtual machines or are prepared for the possible data loss, then you may choose to Turn Off the VM.
Backup your VM before forcibly turn off it (free)
Sometimes your VM is totally frozen or just not responding, forcibly turning off it may cause more or less data loss. It is recommended that you backup your VMs before such risky operations. You can try free virtual machine backup software -- AOMEI Cyber Backup to backup VMs in simple steps. More »
Other similar virtual machine power options
Just like Hyper-V turn off vs shutdown, there are other virtual machine power options that are confusing to people unfamiliar with virtual machines. For example, the same confusion may also lie in Hyper-V reset vs turn off.
- Turn Off: forcibly turn off the virtual machine without preserving the state.
- Reset: hard reset the virtual machine, same as if holding down the power button on a physical machine for a few seconds to make it turn off instead of shut down, then start the machine again.
- Restart: gracefully shutdown the virtual machine following the operating system’s shutdown procedure and restart it.
As Shut Down is a software level action, Turn Off and Reset are BIOS level actions. Therefore, you should use Reset command only in emergency situation when your Hyper-V VM is totally frozen.
Except for Hyper-V, there are also same confusion of power options on VMware. For example, what is the difference between reset and restart in VMware.
- Reset: hard reset the guest machine as resetting a physical machine by pressing the power button. Any programs running in the virtual machine may be adversely affected.
- Restart: gracefully shutdown the virtual machine following the operating system’s shutdown procedure and restart it.
What to do if your Hyper-V VM stuck in the stopping state
As you can see, Turn Off can be a risky operation and better be used only when the virtual machine is totally frozen or unresponsive, otherwise you may run into errors such as Hyper-V VM stuck in the stopping state, and possibly receive an error message Hyper-V failed to change state.
But what if the Turn Off, Shut Down, and Reset options are all unavailable? In this situation, you may need to using PowerShell commands to forcibly kill a frozen Hyper-V VM. Before you start, please remember to backup your VMs to avoid unexpected data loss.
1. Launch Windows PowerShell, and run the following command to get the VM’s GUID:
$VMGUID = (Get-VM "VMNAME").ID
2. Find the vmwp.exe process identifier (PID) for this VMGUID:
$VMWMProc = (Get-WmiObject Win32_Process | ? {$_.Name -match 'VMWP' -and $_.CommandLine -match $VMGUID})
3. Then, using the Stop-Process command, you must force-terminate this process:
Stop-Process ($VMWMProc.ProcessId) –Force
Summary
If you are not familiar with hypervisors and virtual machines, you may be confused by those power options that look functionally alike. And even minor mistake may cause serious consequences.
Therefore, in this article, I analyzed what is the difference between Hyper-V Turn Off vs Shutdown and other virtual machine power options, and introduced 1 way to kill the Hyper-V VM stuck in the stopping state.
Before you doing such a risky operation, please remember to backup your VMs to avoid unexpected errors. The best way to protect your VM data is to perform regular backups following the 3-2-1 backup rule.