8

I had a Win 8.1 hosted OS, running VS2013, and could test my WinPhone app in the emulator fine. The host OS is Win7 Pro.

I reinstalled the hosted OS to Win10, and VS2015, and now I get the Hypervisor not enabled error when I try to test my app with the emulator:

enter image description here

I've tried disabling and re-enabling HyperV (in the hosted OS) as per:

Unable to start the Windows Phone Emulator

But to no avail.

I've also tried opening the BIOS setup (PhoenixBIOS) of the hosted machine, but there are no options that I can see that would help.

What else can I try to get it working?

(And why oh why didn't I back up the VM first?!)

Community
  • 1
  • 1
Benjol
  • 63,995
  • 54
  • 186
  • 268
  • Are there more entries in the windows-log-file giving a clue on what to look for? – lokusking Aug 10 '16 at 08:44
  • @lokusking, do you mean the event log? Can't see anything of note – Benjol Aug 10 '16 at 12:09
  • [Some stuff](https://social.technet.microsoft.com/Forums/de-DE/396c882f-2cc8-4bc8-804d-eec75c0b8066/virtual-machine-could-not-be-started-because-the-hypervisor-is-not-running?forum=winserverhyperv) to read in case you didnt already read it. and [more stuff](https://technet.microsoft.com/en-us/windows-server-docs/compute/hyper-v/best-practices-analyzer/windows-hypervisor-must-be-running) – lokusking Aug 10 '16 at 16:07
  • [This page](https://msdn.microsoft.com/en-us/library/windows/apps/jj863509(v=vs.105).aspx) from Microsoft gives information on what BIOS settings to look for, amongst other things. – heenenee Aug 11 '16 at 04:28
  • @lokusking, "Hypervisor launch failed; The hypervisor was unable to initialize successfully (phase 0x2), and was not started". Now trying to work out which F-key will take me into bios when rebooting VM... – Benjol Aug 11 '16 at 09:29

2 Answers2

3

Into the Workstation run Powershell in elevated mode(Run as Administrator) and run

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All

Stop Workstation and go to settings/processors/Virtualization engine and set:

  • Preferred mode: Automatic
  • Disable acceleration for binary translation: unchecked
  • Virtualize Intel VT-x/EPT or AMD-V/RVI: checked
  • Virtualize CPU performance counters: checked

Start Workstation and Run lusrmgr.msc and check also your account is in the Hyper-V Administratiors group

Check in the services that the HV Host Service and Hyper-V Virtual Machine Management are up and running.

If Error 31: A device attached to the system is not functioning follow the steps from here.

The fix is:

  • Shut down Workstation.
  • Open the registry (Start > Run > regedit).
  • Browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\hcmon.
  • Create a new key called Parameters.
  • In Parameters, create a new DWORD value entry named DisableDriverCheck, and then set the value to 1.
  • Reboot

Appears this issue is for Windows 7 host. The fix worked on the few I tried.

If Error 31 is still appearing run in the Workstation command prompt in elevated mode(Run as Administrator) and type

bcdedit /set "{current}" hypervisorlaunchtype auto

and then restart the Workstation.

Check again in the services that the HV Host Service and Hyper-V Virtual Machine Management are up and running.

Go to Network and Sharing Center/Change adapter settings and disable and re-enable all adapters with name: vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch)

And now you should run the emulator... ;)

Todd
  • 1,071
  • 8
  • 12
  • I gave up and went back to 8.1, but I'm now installing 10 again to give this a try. Thanks. – Benjol Aug 16 '16 at 07:12
  • :( It felt so close. I still have the Error 31 on HV Host Service. – Benjol Aug 16 '16 at 10:01
  • FWIW, upgrading to VS2015 on the Windows 8.1 VM, the emulator still works. So it's Win 10 the problem. – Benjol Aug 16 '16 at 10:08
  • Where did you get the Error 31 on the Host or on the Workstation? The fix is performed on the Host but is for the Workstation. Also there is known issue with the usb drivers on the host and vmware read here [link](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1016809) – Todd Aug 16 '16 at 17:10
  • A Code 31 error is caused by any number of reasons that prevents Windows from loading the driver for the particular hardware device. So the problem is with some driver I guess... – Todd Aug 16 '16 at 17:23
  • I get the error 31 when I try to start the HV Host Service inside the VM. I did the fix on the Host, as you said. Thanks for the info about the usb drivers too, strangely I can see my Lumia 735 from the VM, but not the Lumia 650 (Nokia -> Microsoft transition, I fear). – Benjol Aug 17 '16 at 09:17
  • I gave you the bounty anyway, even if not fixed, you went the extra mile and dug out info that I hadn't found elsewhere. – Benjol Aug 17 '16 at 09:18
  • Try `bcdedit /set "{current}" hypervisorlaunchtype auto` step, I edited a little bit the answer yesterday. – Todd Aug 17 '16 at 09:19
  • Thanks for your continued effort! That didn't work either. I forgot to say that the Virtual Machine Management service *is* running, it's just the HV Host which isn't happy. – Benjol Aug 18 '16 at 05:43
  • Hmm, it should be working, yes the HV Host Service is the actual hypervisor from the error, but this line enables the hypervisor in the Boot Configuration Database, I tested it and it starts the service... :( Can you write in the Workstation command prompt in elevated mode `bcdedit` and tell me in the Window Boot Loader section is there a record about hypervisorlaunchtype and if it is in off or auto state? – Todd Aug 18 '16 at 21:36
  • `hypervisorlaunchtype Auto` – Benjol Aug 19 '16 at 04:53
  • And HV Host Service is still not running and throwing error 31 on start? In Windows 10 Hyper-V requires SLAT-capable CPU to run. To check your CPU capabilities,in your host download the [Coreinfo utility](https://technet.microsoft.com/en-us/sysinternals/cc835722) unzip it and with command prompt in elevated mode run it with `coreinfo.exe -v`.If you have VMX and EPT with '-' character this indicates that these features are missing and you can't run hyper-v on windows 10. If they are with '*' your CPU supports Second Level Address Translation (SLAT) and you can run hyper-v. – Todd Aug 19 '16 at 15:07
  • Also click Start, click Administrative Tools, and then click Event Viewer on the Workstation and expand Applications and Services Logs/Microsoft/Hyper-V-Hypervisor, and then click Operational and look for info related to the problem why Hyper-V is not starting. – Todd Aug 19 '16 at 15:08
  • There's nothing at all in Hyper-V-Hypervisor. However, after restarting (the workstation), under Hyper-V-VMMS/Admin, I have an error `The virtualization infrastructure driver (VID) is not running.` Also in Windows Logs/System there is `The HvHost service terminated with the following error: A device attached to the system is not functioning` and `Hypervisor launch failed` – Benjol Aug 24 '16 at 05:14
  • Hyper-V-VMMS is the virtual machine management service and it is running right? The VID is part of the kernel of the Hyper-V and it is dependent from/relies on the hypervisor that's why it is not running. The hypervisor manages processor scheduling and memory allocation that's why everything relies on it. Check the if your CPU supports SLAT also Windows 10 SP1 should be installed but if you don't have it I don't recommend to update it for now because of the latest MS update issues...Also try reinstall the Hyper-V from Turn Windows Features on or off. – Todd Aug 24 '16 at 09:24
  • Yes Hyper-V-VMMS is running. SLAT is supported (checked with CoreInfo) in Host *and* workstation... Tried reinstall as well, to no avail :( – Benjol Aug 25 '16 at 14:21
  • I'm out of ideas :( It should be running...Probably something with the drivers it must be...Is your motherboard Gigabyte? On the net I found that hyper-v has problems with Gigabyte motherboards... – Todd Aug 28 '16 at 20:11
  • Well you've definitely earned your 500rep in any case, and I think this constitutes a handy resource for anyone else with similar problems. FWIW it's a Dell Precision T3600. – Benjol Aug 30 '16 at 04:46
  • Sorry for not finding solution for your problem. I'm not here for the rep points. I wanted to help as many others helped me here to find solutions of my problems for so many years... :) – Todd Aug 30 '16 at 10:34
3
  1. Try to open .vmx of your VM and add:

    hypervisor.cpuid.v0 = “FALSE”

  2. Select Virtualize Intel VT-x/EPT or AMD-V/RV1 on your VM settings.

enter image description here

pr0gramist
  • 8,305
  • 2
  • 36
  • 48