我的kvm Windows server2019 虚拟机无法正常重启?

Bubu 0 信誉分
2026-03-30T09:28:38.5766667+00:00

我的kvm Windows server 2019 虚拟机,在安装了virtio-win驱动之后,在系统内点击重启,发现无法正常重启,只能到关机状态。这是什么原因呢?

kvm宿主机 kylin v10 sp3

Windows ser ver 2019 版本号1809

virtio-win 版本0.1.285

Windows 商业版 | Windows Server | 设备和部署 | 设置升级和驱动程序
0 个注释 无注释

5 个答案

排序依据: 非常有帮助
  1. VPHAN 36,090 信誉分 独立顾问
    2026-03-31T07:50:23.6866667+00:00

    I have reviewed your updated configuration. Indeed, <acpi/> and <apic/> are properly configured.

    Regarding the Hyper-V Enlightenments and the reset state parameter you mentioned, they need to be placed inside the <features> tag.

    For Windows VMs running on KVM, enabling Hyper-V enlightenments is crucial. It allows KVM to emulate a Hyper-V environment. When Windows detects this, it uses specially optimized low-level interfaces, which significantly improves performance and reduces the chances of system freezes or Blue Screens of Death (BSOD).

    Here are the specific modifications I recommend:

    1. Add Hyper-V Enlightenment Parameters

    Please modify your <features> section to look like this (this includes the reset parameter you mentioned):

    <features>
    
    1. Add Hyper-V Clock: Since you are enabling the Hyper-V module, it is recommended to add hypervclock inside your <clock> tag. This helps resolve time drift and high CPU usage issues within the Windows VM:
    <clock offset='utc'>
    
    1. You mentioned trying to modify the memballoon, which is an excellent troubleshooting approach. Windows compatibility with the Virtio memory balloon driver can sometimes trigger instability or BSODs due to its memory reclamation mechanism (especially when the host system experiences memory pressure).

    To rule out this interference, you can completely disable it for now. At the bottom of the <devices> tag, change the original:

    <memballoon model='virtio'>
    

    to:

    <memballoon model='none'/>
    

    I suggest making these three modifications first, then use virsh define to redefine the VM and start it up for testing.

    此答案是否有帮助?

    0 个注释 无注释

  2. VPHAN 36,090 信誉分 独立顾问
    2026-03-31T07:17:42.1866667+00:00

    布布

    你分享的XML段只包含配置文件底部的虚拟硬件设备块。负责电源管理和重启信号的关键设置实际上位于XML文件的最顶部,在操作系统和功能部分,而这些设置在你的代码片段中是缺失的。你需要往上滚动到配置顶部,找到功能标签。在该部分内,确保ACPI和APIC电源接口都被显式启用,并确认Hyper-V启蒙模块中重置状态参数设置为开启,从而允许Windows内核成功处理KVM软重启。

    仔细看你提供的硬件部分,VirtIO内存气球设备非常可疑。VirtIO 气球驱动经常在 Windows Server 2019 环境中的 KVM 环境中导致重启死锁,因为它在软重启初始化时未能将锁定的内存页释放回主机。你应该在XML配置中修改memballoon标签,把model属性从virtio改为无。完成这些调整并保存配置后,完全关闭虚拟机,并从Kylin主机重新启动,应用新的硬件拓扑。

    此答案是否有帮助?


  3. VPHAN 36,090 信誉分 独立顾问
    2026-03-31T06:52:14.0966667+00:00

    根本原因不在于VirtIO驱动,而是Kylin主机底层KVM/QEMU配置与Windows Server 2019高级电源接口之间的交互问题。

    请尝试以下方法:

    1. 检查 <features> XML配置的部分并找到该 <hyperv> 块。你必须确保复位指令被明确声明。该参数的缺失 <reset state='on'/> 是Windows Server 2019无法在KVM上进行正常软重启,只能强制强制关机的最常见原因之一。此外,请验证 <synic state='on'/> <stimer state='on'/> 和 ,确保中断传递的正确。
    2. 不兼容的时钟源还可能导致内核在重启初始化阶段卡死。在 <clock> XML 部分,确保为 Windows 配置了专用的 Hyper-V 时钟源。添加或确认 的存在 <timer name='hypervclock' present='yes'/>,使 Windows 能够使用更稳定的虚拟时钟机制,避免重启时因时钟漂移导致的冻结。
    3. 如果XML硬件配置中包含 <panic model='isa'> (pvpanic设备)或配置的看门狗设备,请暂时注释删除或移除它们。在某些 Kylin V10 SP3 QEMU 构建中,pvpanic 模块错误拦截了 Windows 软重启的 ACPI 信号,导致虚拟机进入异常的暂停状态,而非执行重启。

    副总统

    此答案是否有帮助?


  4. Bubu 0 信誉分
    2026-03-30T10:45:06.07+00:00

    嗨,请问下如何确定是这个驱动不兼容的问题?

    此答案是否有帮助?

    0 个注释 无注释

  5. VPHAN 36,090 信誉分 独立顾问
    2026-03-30T10:08:11.9+00:00

    嗨,Bubu

    你遇到的问题是virtio-win 0.1.285存储驱动与你Kylin V10 SP3主机上的特定QEMU/KVM虚拟机监控程序版本之间的兼容性不匹配。标准的系统关机会发送ACPI断电信号,干净利落地终止机器,而软重启则需要主动虚拟硬件控制器执行重置命令。当较新的Virtio驱动未能正确识别来自旧虚拟机管理程序环境的重置命令时,Windows内核在重启过程中会死锁,并无限期卡住。

    要解决这个问题,你需要将VirtIO驱动包降级到一个稳定版本,保持与当前主机环境完全兼容,比如版本0.1.271。首先,从官方Fedora仓库下载virtio-win-0.1.271 ISO,并通过Kylin主机接口挂载到虚拟机。ISO 挂载完成后,在 Windows Server 2019 内打开设备管理器,手动回滚受影响的组件。展开存储控制器和网络适配器类别,右键点击已安装的 Red Hat VirtIO 设备,选择“更新驱动程序”,并直接指向已挂载的 ISO 驱动器路径,如 D:\vioscsi\2k19\amd64,以替换有问题的驱动程序文件。

    回滚核心虚拟设备后,同步相应的访客服务同样至关重要。在控制面板中打开程序和功能小程序,完全卸载当前的QEMU访客代理,然后在旧ISO上执行提供的安装程序。在Windows中进行一次最终的完全关机,然后从你的Kylin主机控制台重新启动虚拟机。你随后在系统内重启时会正确处理ACPI命令,使服务器能够重启而不死机。

    希望这个回答能给你带来一些有用的信息。如果有,请点击 “接受答案”。如果你有任何问题,欢迎留言。

    副总统

    此答案是否有帮助?


你的答案

提问者可以将答案标记为“已接受”,审查方可以将答案标记为“已推荐”,这有助于用户了解答案是否解决了提问者的问题。