Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Hyper-V "The virtual machine could not be started because the hypervisor is not running" (event 3112): causes and fixes

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

When a Hyper-V virtual machine will not start and the log shows The virtual machine could not be started because the hypervisor is not running., the Windows hypervisor did not load when the host booted. Microsoft's guidance names four causes: data execution prevention (DEP) or the NX/XD setting turned off in the firmware, hardware virtualization turned off, the boot entry not set to launch the hypervisor, and the Secure Mode Extensions (SMX) feature. The event and the boot entry are read first. Each setting is changed one at a time, with a restart between changes.

What the error means

Hyper-V runs virtual machines on a thin layer, the hypervisor, that starts before Windows. If it did not load at boot, Windows runs without it and every VM start is refused. Microsoft's page for this error says that after you install the Hyper-V role and try to start a VM, the Hyper-V-Worker log can show this event:

Log Name: Microsoft-Windows-Hyper-V-Worker-Admin
Source: Microsoft-Windows-Hyper-V-Worker
Event ID: 3112
Level: Error
Description: The virtual machine could not be started because the hypervisor is not running.

The Microsoft page for the Windows Server 2012 era shows the dialog form: Virtual machine 'VM_Name' could not be started because the hypervisor is not running (Virtual machine ID <Virtual_Machine_ID>). It adds three actions: verify that the processor supports hardware-assisted virtualization, verify that hardware-assisted virtualization and hardware-assisted data execution protection are enabled in the BIOS, and check any changes made to the Boot Configuration Data store, so that the hypervisor is configured to launch automatically.

The problem here is that the hypervisor never started. A different problem is a third-party virtualization product that cannot start VMs while Hyper-V runs. Microsoft documents that separately, and its fix is the opposite of the one here.

Likely causes

Cause What you see How to confirm
DEP, or Execute Disable and NX, is off in the firmware Event 3112 after installing the role The firmware setup shows the setting off; HP servers call it "No Execute Memory Protection" in Microsoft's page
Hardware virtualization (Intel VT-x or AMD-V) is off Event 3112 The firmware setup
The boot entry does not launch the hypervisor Event 3112 after a change to the boot configuration bcdedit /enum {current} lists hypervisorlaunchtype as Off, or not as Auto
Firmware change made but the machine was only reset The setting is on, yet the hypervisor did not load Microsoft says changing the BIOS requires turning the power off and on, and says resetting is not sufficient
SMX is enabled in the BIOS and the execution environment changed The dialog form of the error on Windows Server 2012 or Windows 8 Microsoft's page names Secure Mode Extensions; the BIOS shows it enabled

Prove the cause before changing anything

These checks only read.

1. Read the event. Microsoft's Get-WinEvent page shows the hash table form that filters on log name and event ID:

Get-WinEvent -FilterHashtable @{ LogName='Microsoft-Windows-Hyper-V-Worker-Admin'; Id=3112 }

One or more events with the description above confirm the symptom. No event means a different fault.

2. Ask whether the hypervisor is running. On an existing Hyper-V host, Microsoft's requirements page says systeminfo shows in its Hyper-V Requirements section:

systeminfo

Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed. is the good result. The page shows only the good line. Its absence is a practical sign that the hypervisor is not running, not a statement from Microsoft. Continue with the checks below.

3. Read the boot entry. Run the bcdedit commands in an elevated Command Prompt. In PowerShell the identifier must be quoted, as "{current}" (BCDEdit /set page). The BCDEdit /enum page lists the entry, and says {current} is the identifier of the current boot entry on its /set page:

bcdedit /enum {current}

Look for hypervisorlaunchtype. The BCDEdit /set page gives its values as Off or Auto. A value of Off explains the event. If the line is missing, Microsoft's pages give no default, so go on to the firmware checks.

4. Check the firmware. Microsoft's requirements page lists a 64-bit processor with second-level address translation (SLAT), VM Monitor Mode extensions, virtualization support turned on in the BIOS or UEFI, and hardware-enforced data execution prevention available and enabled. Read each setting in the firmware setup or the server's management console. The same page adds that if Turn Windows features on or off lists Windows Hypervisor Platform instead of Hyper-V, the system might not be compatible with Hyper-V, and the requirements above are the place to look. The page also says the processor must have SLAT to install the Hyper-V virtualization components such as the Windows hypervisor, so check the processor before any change.

Fix

Fix one cause at a time and restart in between.

Firmware settings (virtualization, DEP, SMX)

First write down the current value of every firmware setting you will change, with the date, in the change record.

Disruptive step: the next step turns the host off and on. Every VM on the host stops, or must be moved first.

Move or shut down the VMs. Enter the firmware setup. Turn on virtualization support and DEP (Execute Disable, NX or XD), as Microsoft's creation guidance says. If the SMX feature is on and the dialog form of the error appears, Microsoft says to contact the hardware manufacturer about a BIOS or firmware update and disable SMX in the BIOS. Microsoft says: "If you edit the BIOS to enable either setting, you must turn off the power to the physical computer and then turn it back on." It also says: "Resetting the physical computer is not sufficient."

To back out: return each setting to the value you wrote down, and turn the power off and on again.

The boot entry

First save the current entry and the whole boot configuration store to files, in an elevated Command Prompt. Copy both files off the host:

bcdedit /enum {current} > C:\bcd-enum-before.txt
bcdedit /export C:\bcd-before.bak

Risk: the next command edits the boot configuration. The BCDEdit /set page warns: "Changing some boot entry options using the BCDEdit /set command could render your computer inoperable." It also says: "Before setting BCDEdit options you might need to disable or suspend BitLocker and Secure Boot on the computer." The change applies at the next restart, which stops every VM on the host.

Set the hypervisor to launch, as Microsoft's guidance says, then restart the host:

bcdedit /set hypervisorlaunchtype auto

To undo it: read C:\bcd-enum-before.txt. If it shows hypervisorlaunchtype, set it back to that value, Off or Auto, then restart:

bcdedit /set hypervisorlaunchtype off

Use Auto in place of off if that was the saved value. If the line was absent from the saved file, import the saved store instead, then restart. The BCDEdit page says of /import: "This command deletes any existing entries in the system store before the import takes place." Anything changed in the store since the export is lost.

bcdedit /import C:\bcd-before.bak

If Windows does not start after the change, Microsoft's pages describe no way to import the store from the recovery environment.

Confirm the fix

  1. The VM starts, and no new event 3112 appears in the Hyper-V-Worker-Admin log.
  2. systeminfo shows the line A hypervisor has been detected.
  3. bcdedit /enum {current} shows hypervisorlaunchtype as Auto.

What to watch afterwards

  • After a firmware update, check the virtualization, DEP and SMX settings again, since Microsoft says some computers need a BIOS update to run Hyper-V VMs.
  • After any edit of the boot configuration, run bcdedit /enum {current} and keep the output.
  • Keep an exported boot store for each host, labelled with its date.

Example (illustrative): On hv01, starting the VM app01 fails, and Get-WinEvent -FilterHashtable @{ LogName='Microsoft-Windows-Hyper-V-Worker-Admin'; Id=3112 } returns one event. bcdedit /enum {current} shows hypervisorlaunchtype as Off. The engineer exports the store with bcdedit /export C:\bcd-before.bak, runs bcdedit /set hypervisorlaunchtype auto, moves the VMs in a window and restarts. systeminfo now shows A hypervisor has been detected. and app01 starts.

Risks and limits

  • These commands have not been run or lab-tested.
  • Microsoft's pages are for Windows Server.
  • The SMX case is described for Windows Server 2012 and Windows 8. No page gives a current-version equivalent.
  • Microsoft's pages give no default value for hypervisorlaunchtype when it is absent, so none is assumed here.
  • Hyper-V running inside a virtual machine needs nested virtualization. That case is not covered here.
  • Editing the boot configuration, changing firmware settings and restarting a host are disruptive. A BitLocker or Secure Boot dependency can stop the host starting.

Sources