Antivirus and Hyper-V (or: Why can’t I start my virtual machine?)

A little while ago our support team put together this KB article in response to a problem that a lot of people have been reporting.  Basically, what is happening is that users are having problems starting virtual machines after they install antivirus software in the management operating system.  The root cause of the problem is that a number of these programs monitor file access in a way that interferes with Hyper-V’s attempts to open virtual machine files.  If you see this problem – you have two options:

  1. Don’t install antivirus.  Now – before you choke on your coffee or get your pitch-forks – listen to me for a moment.  If you are running a server core configuration, or a full server configuration, and you have nothing running in the management operating system other than Hyper-V, and you do not have people logging in and browsing the web in the management partition, etc… Then you do not really need to have antivirus software installed as there is limited risk of a virus.
  2. Install antivirus and set up the following exclusions (most antivirus programs allow you to exclude specific directories, files and processes from scanning to help deal with issues such as these):
  • Default virtual machine configuration directory (Normally this is C:ProgramDataMicrosoftWindowsHyper-V)
  • Custom virtual machine configuration directories
  • Default virtual hard disk directory (Normally this is C:UsersPublicDocumentsHyper-VVirtual Hard Disks)
  • Custom virtual hard disk directories
  • Snapshot directories
  • Vmms.exe
  • Vmwp.exe

Then everything should be just fine.

Cheers,
Ben