Score:0

Windows VM suddenly run very slow in KVM/QEMU

cn flag

I have several times experience a Windows VM suddenly start to run extremely slow, seems mostly related to slow storage IO. Seen this in different versions, but in this particular case is Win10 LTSC 1809

This happens whatever storage configuration I use (qcow2/raw image, block-device, VirtioSCSI or VirtioIO).

If I reinstall Windows using the same VM-XML and VM disk-storage the VM runs fine so it can only be related to some configurations in Windows itself.

Haven't been able to find any errors in event viewer.

Score:0
cn flag

I did actually find the following event viewer message:

The hypervisor did not enable mitigations for CVE-2018-3646 for virtual machines because HyperThreading is enabled and the hypervisor core scheduler is not enabled. To enable mitigations for CVE-2018-3646 for virtual machines, enable the core scheduler by running "bcdedit /set hypervisorschedulertype core" from an elevated command prompt and reboot.

Event though this didn't solve the problem to enable this mitigation it got me thinking if this problem was Hyper-V related and I started to look that way.

And sure enough, it was related to HVCI (Hypervisor-protected code integrity) was enabled. Further info:

docs.microsoft.com

ourwindowsman.wordpress.com

If I disable HVCI it runs fine again, which can be done with this registry change:

reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Enabled" /t REG_DWORD /d 0 /f

I assume you can make your VM run fine with HVCI enabled but one of the requirements seems to be you have to use secure-boot which I don't and will not, so I haven't tested it furter.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.