Improving the performance of Windows Hyper-V 2016

This guide explains how to improve the performance of Hyper-V 2016.

Recently I installed a new Hyper-V server. However, it wasn’t performing as good as I’d hoped. After searching the internet for a while, I think these are the most important steps to make your server perform better.

Convert generation 1 to generation 2 machines

Although it’s officially not supported, you can convert generation 1 machines to generation 2, which are much faster. The script can be found here.

Note that it’s smart to disable Windows Defender during this process:

Set-MpPreference -DisableRealtimeMonitoring $true

You can re-enable it again using this code:

Set-MpPreference -DisableRealtimeMonitoring $false

Exclude the Virtual Machine Worker Process from Windows Defender

Start regedit.exe and navigate to this key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Processes

It might be possible that you need to replace the owner in order to add items to this key. I recommend changing it back to the SYSTEM user after making these changes.

Now add these 2 entries:

Name Type Data
vmwp REG_DWORD 0x0
vmwp.exe REG_DWORD 0x0
vmms REG_DWORD 0x0
vmms.exe REG_DWORD 0x0

Exclude the Virtual Machine Disks directory from Windows Defender

Start regedit.exe and navigate to this key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths

It might be possible that you need to replace the owner in order to add items to this key. I recommend changing it back to the SYSTEM user after making these changes.

Name Type Data
[vm directory, e.g. C:\MyVMs] REG_DWORD 0x0
C:\ProgramData\Microsoft\Windows\Hyper-V REG_DWORD 0x0