In October 2013, Microsoft released Windows 2012R2, containing many improved features. A good article outlining those improvements can be found here: http://www.petri.co.il/whats-new-in-windows-server-2012-r2.htm#
Although installing the Hyper-V Role is straightforward on a new system, I have seen couple of scenarios where the Hyper-V role will fail on installation. Scenario conditions are outlined below:
- Fresh install of Windows 2012R2 Server.
- All Windows Updates applied then rebooted.
- Post reboot, Hyper-V Role was installed.
- Rebooted machine to finalize installation of role
- Machine begins applying, gets to 99%, then fails to install the Hyper-V role. Windows performs rollback.
Resetting Windows Registry Files To Fix Hyper-V Role
The fix that worked for us was to open up a Command Prompt and select Run As Administrator (or create a batch file and run as an administrator) with the following text.
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%system32wbem
for /f %s in ('dir /b *.dll') do regsvr32 /s %s
regsvr32 %windir%system32tscfgwmi.dll wmiprvse /regserver net start winmgmt for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s cd C:WindowsSystem32wbemAutoRecover
for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s
After the commands above have been executed, the following should now run successfully:
- Install the Hyper-V Role
- Reboot the machine
- Hyper-V will now successfully apply
Note: There are several people on Microsoft’s forums that have said installing a fresh copy of Windows 2012R2 also fixes the issue; however, I have not verified this claim.
Resources used:
Server 2012 Hyper-V Host Not Responding http://social.technet.microsoft.com/Forums/windowsserver/en-US/db1a9205-…, Accessed November 27, 2013
Hyper-V Role installation fails without reason (Windows Server 2012), http://social.technet.microsoft.com/Forums/windowsserver/en-US/6bd6835a-…, Accessed November 27, 2013