Nimesh Madhavan
Nimesh Madhavan

Reputation: 6318

Android emulator on Hyper V – how to get hardware acceleration

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?

Upvotes: 49

Views: 56129

Answers (5)

Sagar Zala
Sagar Zala

Reputation: 5134

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.

Upvotes: -1

Dinesh Rajan
Dinesh Rajan

Reputation: 2584

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

Upvotes: 9

ttt
ttt

Reputation: 6829

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

Upvotes: 11

Nimesh Madhavan
Nimesh Madhavan

Reputation: 6318

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

Upvotes: 92

James
James

Reputation: 69

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

Upvotes: 6

Related Questions