49

Microsoft recently announced support for running android emulator on hyper V.(https://blogs.msdn.microsoft.com/visualstudio/2018/05/08/hyper-v-android-emulator-support/)

I am trying to start the Android emulator 27.2.9.0 on my Windows 10 (April 2018 Update) Hyper V enabled machine with the following command :

> cd C:\Users\<username>\AppData\Local\Android\sdk\emulator
> emulator -avd <avd name> -feature WindowsHypervisorPlatform

And I am getting the following error message:

emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Windows Hypervisor Platform (WHPX) is properly installed and usable.
CPU acceleration status: Please disable Hyper-V before using the Android Emulator.
 Start a command prompt as Administrator,
 run 'bcdedit /set hypervisorlaunchtype off', reboot.

I have added the "WindowsHypervisorPlatform = on" line to C:\Users<your-username>.android\advancedFeatures.ini, but that didn't help.

What am I missing?

Henke
  • 4,445
  • 3
  • 31
  • 44
Nimesh Madhavan
  • 6,290
  • 6
  • 44
  • 55
  • After trying all the mentioned answers, and if none of them worked for window 10 revision 1709 and above, refer the [answer](https://stackoverflow.com/a/63087853/3049065) which can solve this issue. – Mahendran Sakkarai Jul 27 '20 at 05:32

5 Answers5

92

Well, it turned out that I had "Hyper-V" enabled, but "Windows Hypervisor Platform" was not enabled. (Who knew these are two different things!). Once it was enabled the emulator started to work.

enter image description here

Nimesh Madhavan
  • 6,290
  • 6
  • 44
  • 55
  • 13
    I don´t have this Windows Hypervisor Platform, even if my windows is updated. What´s wrong? – Little Monkey Nov 07 '18 at 11:13
  • 1
    Thanks! I've been chasing a bunch of red herrings with avdmanager, sdkmanager and tns. This was the ticket. – grantwparks Jan 20 '19 at 00:09
  • Even though I followed the MS article I totally missed the second Hyper V section to turn on. Thank you. I am referring to this MS article https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?tabs=vswin&pivots=windows – Yeronimo Dec 05 '19 at 17:06
  • 1
    Be aware, my computer blue screened attempting to enable this the first time. After it rebooted, I tried again and it worked. Just letting you know in case you have anything open that should be saved/closed beforehand. – Shayne Ephraim May 14 '20 at 22:15
  • @LittleMonkey, are you using Windows Home edition? Hyper-V is available on 64-bit versions of Windows 10 Pro, Enterprise, and Education. It is not available on the Home edition. See https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/ – g5thomas Dec 22 '20 at 19:58
  • Wow. They need to add this to the docs. – Jonesopolis Aug 31 '22 at 11:58
11

I just had to uninstall the "Hyper-V Hypervisor" and the emulator started working. I'm using Windows 10 (1803). The emulators stop working if I install "Hyper-V Hypervisor".

enter image description here

tedi
  • 6,350
  • 5
  • 52
  • 67
9

With latest Android Studio, you do not need Hyper-V on AMD.

Just enable "Windows Hypervisor Platform" (turn windows features on and off screen) and x86 images should automatically become usable

enter image description here

Dinesh Rajan
  • 2,376
  • 23
  • 19
  • This did the tric for me on a Ryzen CPU, I wish it was obvious in the official docs, but AMD's not even mentioned (only Intel and HAXM). – Sebastián Vansteenkiste Jan 03 '23 at 19:16
  • I was missing the Hypervisor Driver for AMD processors. To install it go to (in VS) "Extras > Android > SDK Manager". Then in the SDK Manager go to "Tools > Extras > Android Emulator Hypervisor Driver for AMD processors" – kegesch Mar 10 '23 at 08:54
6

There are a few things I did to get this working on my pc.

  • Install Visual Studio 15.8 Preview 1 or later
  • Remove and Reinstall the emulator within the Visual Studio Preview
  • I removed HAXM from the "Extras" within the android sdk manager (from the visual studio menu).
  • The path for the advancedFeatures.ini is C:\Users\Your Username\advancedFeatures.ini to set WindowsHypervisorPlatform = on
  • Open Turn Windows features on or off and select Hyper-V and the Windows Hypervisor Platform checkboxes. (Requires restart)

There is another guide from Microsoft here: https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?tabs=vswin

James
  • 69
  • 3
  • Thanks for the Microsoft link. It made me realise that I didn't have the latest update (version 1803) after recently upgrading to Windows 10 Pro. – the_new_mr Nov 22 '18 at 17:33
  • My 12 month old installation of Android SDK and emulator, as of today, is running on Hyper-V with_out_ requiring Visual Studio or Xamarin software. – John Dec 25 '19 at 22:33
  • I resolved the problem by removing HAXM from Android SDK :) – Husam Ebish Feb 12 '22 at 02:38
-1

Run the below command in cmd opened as Administrator to disable hyper-v and then reboot the machine:

bcdedit /set hypervisorlaunchtype off

This command works for me.

Sagar Zala
  • 4,854
  • 9
  • 34
  • 62