一些 PC 用户可能遇到的众多Hyper-V问题之一是虚拟机在其 Windows 10 或 Windows 11 计算机上陷入停止状态。(Stopping)这篇文章提供了最合适的解决方案,受影响的用户可以尝试成功解决问题。
此错误最可能的罪魁祸首包括 -
- Windows 操作系统(Windows OS)主机的过时版本/内部版本。
- 存储故障。
- RRA 服务配置错误。
- Windows 电源选项。
如何在Hyper-V中强制停止 VM ?
要强制停止虚拟机(Machine)(VM),请按照以下说明操作;在运行虚拟机的服务器上,打开任务管理器(Task Manager),导航到详细信息(Details)选项卡。现在,找到具有用户名虚拟机GUID的 vmwp.exe 进程,然后选择并单击结束任务以强制关闭。单击停止进程(Stop Process)按钮确认操作。
Hyper-V虚拟机(Virtual Machine)卡在停止状态(State)
如果您的Hyper-V 虚拟机卡在 Stopping State(Hyper-V Virtual Machine is stuck in Stopping State),您可以尝试以下我们推荐的解决方案(不分先后顺序),看看是否有助于解决问题。
- 杀死虚拟机进程
- 更改电源选项
- 禁用路由(Routing)和远程访问(Remote Access)( RRA )服务(Service)。
在您尝试以下任何解决方案之前,解决问题的最简单快捷的方法就是重新启动 Windows 主机(rebooting the Windows host machine)。重新启动主机后,VM 将清除并正常启动。此外,请检查更新并在您的(check for updates)Windows 11 设备上安装任何可用位,因为该问题也可能是由Windows错误引起的,该错误通常在后续CU(CUs)中进行修补。
1]杀死虚拟机进程
此解决方案要求您识别有问题的 VM 的GUID,假设您正在运行多个VM(VMs),然后在Task Manager中终止该进程。但是,如果您在主机上运行单个虚拟机,则不需要识别GUID,因为虚拟机工作进程(Virtual Machine Worker Process)或 vmwp.exe 不会被多次列出 - 在这种情况下,只需打开任务管理(Task Manager)并杀死那里列出的唯一 vmwp.exe 进程。
要终止Windows PC 上卡在停止状态的 Hyper-V 虚拟机(Hyper-V Virtual Machine stuck in Stopping State),请执行以下操作:
- 按Windows key + X打开高级用户菜单。
- 然后按键盘上的I启动 PowerShell。
- 在PowerShell控制台中,输入或复制并粘贴下面的命令,然后按 Enter(Enter)。用有问题的 VM 的实际名称替换<VMname>占位符。
Get-VM <VMname> | fl *
- 现在,记下VMId,因为您需要它来确定要结束的正确进程。
- 接下来,打开任务管理器(open Task Manager)。
- 在任务管理器中,切换到详细信息(Details) 选项卡。
- 现在,通过按键盘上的 V 键找到vmpw.exe进程。(vmpw.exe)如果您有多个正在运行的虚拟机(VMs),则会列出多个进程。
- 现在,使用前面提到的VMid来查找正确的进程。
- 最后,突出显示用户(User)名与 ID 相关的进程并终止该进程(kill the process)。
2]更改电源选项
如果您的 Windows 主机显示器的电源(Power)选项未配置为永不关闭,您可能会遇到此问题,因为显示设置会影响 Hyper-V 虚拟机的状态。在这种情况下,您只需将显示设置为从不关闭(set the display to never Turn off)即可解决问题。
3]禁用路由(Disable Routing)和远程访问(Remote Access)(RRA)服务(Service)
如果远程访问服务配置错误,则可能会出现此问题,因为您的网络接口可能会干扰该服务,从而导致 VM 卡住。在这种情况下,您可以禁用路由(Routing)和远程访问(Remote Access)( RRA ) 服务来解决手头的问题。
要在Windows(Windows) PC 上禁用RRA服务,请执行以下操作:
- 按Windows key + R调用“运行”对话框。
- 在 Run 对话框中,输入services.msc并按 Enter打开 Services(open Services)。
- 在“服务(Services)”窗口中,滚动并找到“路由和远程访问”(Routing and Remote Access )服务。
- 双击(Double-click)条目以编辑其属性。
- 如果服务正在运行,请单击停止(Stop) 按钮将其停止。
- 服务停止后,仍然在属性窗口中,单击启动类型(Startup type)上的下拉菜单,然后从菜单中选择已禁用(Disabled )。
- 单击应用(Apply)>确定(OK)以保存更改。
- 重启电脑。
就是这样!
相关(Related):修复Hyper-V 虚拟机卡在已保存状态。
Hyper-V 重置有什么作用?
当您执行 Hyper-V 重置时,该操作将重置托管在本地或远程Hyper-V 管理服务器(Hyper-V Management Server)上的特定虚拟机。如果要执行任务或控制本地计算机,则需要选择本地(Local)服务器单选按钮,否则如果要控制远程计算机,请选择远程服务器单选按钮。(Remote)Restart -VM cmdlet 重新启动虚拟机。运行此 cmdlet 会导致“硬” 重启(restart),例如关闭计算机电源,然后再次备份。
Fix Hyper-V Virtual Machine stuck in Stopping State
One of the numerous Hyper-V issues some PC users may encounter is when the virtual machine gets stuck in the Stopping state on their Windows 10 or Windows 11 computer. This post provides the most suitable solutions affected users can try to successfully resolve the issue.
The most likely culprits to this error include-
- Outdated version/build of Windows OS host.
- Storage Failure.
- RRA service misconfiguration.
- Windows Power Options.
How do I force stop a VM in Hyper-V?
To force-stop a Virtual Machine (VM), follow these instructions; on the server where the virtual machine is running, open the Task Manager, navigate to the Details tab. Now, locate the vmwp.exe process that has the GUID for the user name virtual machine then select and click End Task to force the shutdown. Confirm the action by clicking the Stop Process button.
Hyper-V Virtual Machine stuck in Stopping State
If your Hyper-V Virtual Machine is stuck in Stopping State, you can try our recommended solutions below in no particular order and see if that helps to resolve the issue.
- Kill the Virtual Machine process
- Change Power options
- Disable Routing and Remote Access (RRA) Service.
Before you try any of the solutions below, the easiest and quickest way to resolve the issue is simply by rebooting the Windows host machine. Once you have rebooted the host machine, the VM will clear out and start normally. Also, check for updates and install any available bits on your Windows 11 device as the issue might also be caused by a Windows bug which is often patched in subsequent CUs.
1] Kill the Virtual Machine process
This solution requires you to identify the GUID of the problematic VM, assuming you’re running multiple VMs, and then kill the process in Task Manager. However, if you have a single virtual machine running on the host machine, you don’t need to identify the GUID because the Virtual Machine Worker Process or vmwp.exe won’t be listed multiple times – in this case, simply open up Task Manager and kill the only vmwp.exe process listed there.
To kill the Hyper-V Virtual Machine stuck in Stopping State on your Windows PC, do the following:
- Press Windows key + X to open Power User Menu.
- Then press I on the keyboard to launch PowerShell.
- In the PowerShell console, type in or copy and paste the command below and hit Enter. Substitute the <VMname> placeholder with the actula name of the problematic VM.
Get-VM <VMname> | fl *
- Now, make a note of the VMId as you will need this to identify the right process to end.
- Next, open Task Manager.
- In Task Manager, switch to the Details tab.
- Now, locate the vmpw.exe process by pressing the V key on the keyboard. Multiple processes will be listed if you have multiple VMs running.
- Now, use the VMid noted earlier to find the right process.
- Finally, highlight the process whose User name correlates with the ID and kill the process.
2] Change Power options
If the Power options of the display of your Windows host machine is not configured to never turn off you may experience this issue because the display setting affects the state of your Hyper-V virtual machines. In this case, you can simply set the display to never Turn off to resolve the issue.
3] Disable Routing and Remote Access (RRA) Service
This issue can occur if there is misconfigured remote access service as your network interface might be interfering with the service, and consequently causes the VM to get stuck. In this case, you can disable the Routing and Remote Access (RRA) service to resolve the issue at hand.
To disable the RRA service on your Windows PC, do the following:
- Press Windows key + R to invoke the Run dialog.
- In the Run dialog box, type services.msc and hit Enter to open Services.
- In the Services window, scroll and locate the Routing and Remote Access service.
- Double-click on the entry to edit its properties.
- If the service is running, stop it by clicking the Stop button.
- After the service has been stopped, still in the properties window, click the drop-down on the Startup type and select Disabled from the menu.
- Click Apply > OK to save changes.
- Restart PC.
That’s it!
Related: Fix Hyper-V Virtual Machine stuck in Saved State.
What does Hyper-V reset do?
When you perform a Hyper-V reset, the operation will reset a specific virtual machine hosted on a local or remote Hyper-V Management Server. If you want to perform the task or control the local computer, you’ll need to select the Local server radio button, otherwise select the Remote server radio button if you want to control a remote computer. The Restart-VM cmdlet restarts a virtual machine. Running this cmdlet results in a “hard” restart, like powering the computer down, then back up again.