I following the guide here:
https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?tabs=vswin
to run Android Emulator using Windows Hypervisor Technology. I'm currently working on Azure VM D_v3 series. During debug my sample app, I've got this error:
2>emulator: CPU Acceleration: DISABLED
2>emulator: CPU Acceleration status: Please disable Hyper-V before using the Android Emulator. Start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot.
2>emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
2>Please ensure Windows Hypervisor Platform (WHPX) is properly installed and usable.
2>CPU acceleration status: Please disable Hyper-V before using the Android Emulator. Start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot.
WHPX is for sure enabled in Windows Features. Have any idea? Is it possible with azure?
Try disabling OpenGL. It worked for me in a DSv3 VM.
It can be disabled by going to Program Files (or Program Files x86 if you're on a 64-bit machine)\Microsoft XDE\10.0.10586.0\SKUs\Android\xdesku.xml and deleting this line: GuestDisplayProvider="VsEmulator.OpenGLGuestDisplay".
If there are multiple versions under xde, pls identify which version has SKUs\Android.
Ref:
https://social.msdn.microsoft.com/Forums/en-US/d7c0bbc5-eb29-4080-8398-e55111d98c91/vs-android-emulator-cannot-boot?forum=visualstudiogeneral
Today's version of Azure VM may not have full nested virtualization capabilities enabled which may not allow Android emulator on Azure. Dsv3 or Esv3 version machines only have nested virtualization enabled. I tried and could not run Android emulator. While for now you can use Visual Studio Emulator for Android [older version of Android API]on Azure VM. Refer details for step by step guide - https://www.sanganakauthority.com/2020/04/run-android-emulator-and-android-studio.html
Related
I am running into an issue where I can't start the xamarin android emulator, it says:
Device error: WARNING | unexpected '-prop' value ('monodroid.avdname=pie_9_0_-_api_28'), only 'qemu.' properties are supported
WARNING | unexpected '-prop' value ('emu.uuid=c23d7e88-c1e4-4283-bb2b-e2632b5c3c16'), only 'qemu.' properties are supported
ERROR | x86 emulation currently requires hardware acceleration!
CPU acceleration status: Hyper-V detected and Windows Hypervisor Platform is not available. Please either disable Hyper-V or upgrade to Windows 10 1803 or later. To disable Hyper-V, start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot. If u
More info on configuring VM acceleration on Windows:
https://developer.android.com/studio/run/emulator-acceleration#vm-windows
General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.
I need Hyper-V to be enabled for the emulator acceleration, otherwise if i disable it, the apps on the emulator run painfully slowly. The thing is I had hyper-v enabled before, and all of my emulators ran just fine with it, then suddenly I started getting this error. Both Hyper-V and Windows Hypervisor Platform are enabled in windows features. I also have HAXM accelerator installed for the android. I also tried running the following commands: bcdedit /set hypervisorlaunchtype auto and dism /online /enable-feature /feature-name:Microsoft-Hyper-V -All; both commands resulted in "operation completed successfully". I also tried running "C:\Program Files (x86)\Android\android-sdk\emulator\emulator-check.exe" accel, and this is what I got:
accel:
0
Please disable Hyper-V before using the Android Emulator. Start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot.WHPX (10.0.19042) is installed and usable.
accel
I am not sure what is going on, and why my emulators suddenly can not run with Hyper-V enabled. Has anyone faced this issue before? Any help would be much appreciated. Thanks
Uninstall HAXM; it reads: WHPX (10.0.19042) is installed and usable.
This is the "Windows Hypervisor Platform" ...
https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=windows
It's very weird but still to this day I can't start the android emulator in VS2019. However, I found a workaround - I can start the android emulator in VS2017, so I start it there and run the app from VS2019. Extremely weird, but if anyone is having that issue and needs a workaround urgently, that's what you can do.
I don't know if this is helpful at all, but as for today, that's the only solution I found.
(Also, consider switching to VS2022. Seems to work fine there as well)
I am trying to run an android emulator on an azure VM running windows, Windows 10 Pro version 1809 - But I am getting the following error message running the android emulator:
C:\Program Files (x86)\Android\android-sdk\emulator>emulator -AVD androidemulatorapi28
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure the Windows Hypervisor Platform (WHPX) is properly installed and usable.
CPU acceleration status: HAXM is not installed on this machine
The hyper-v is enabled:
And Windows Hypervisor Platform as well:
The size of the VM is D2_v3 and Dv3 - series is supposed to support Nested Virtualization. Here, here and here are claims about it being so and that android emulator functions. And as I far as I have understood:
...is part of Dv3 series.
What could be the problem?
I am able to run an Ubuntu VM in Hyper-V of the Azure Windows VM.
Disabling Hyper-V and Windows Hypervisor Platform, installing HAXM and running I get this error:
According to the writer of this medium article and this StackOverflow discussion - A special custom implementation of OpenGL is necessary - because the particular azure VM size doesn't come with a GPU. However, following the steps of the article I get another type of crash - when using the Mesa3D+LLvmpip version of opengl32.dll from the authors Github repo, replacing the OpenGL file in system32 and running the android emulator:
I found there was a gihub repo - distributing Mesa3D and LLvmpip - downloading mesa3d-19.1.3-release-mingw.exe and running the cmd file:
There is the following message in cmd:
This deployment utility targets systems without working GPUs and any use case
where hardware-accelerated OpenGL is not available. This mainly covers
virtual machines in cloud environments and RDP connections. It can be
used to replace Microsoft Windows inbox OpenGL 1.1 software render
driver with Mesa3D soft pipe, llvmpipe or SWR driver.
...which seems to be a fit for the driver rendering problem.
I was able to git rid of all cmd warnings and error by-avd myandroidemulatorapi28, and any with of following two flags -gpu angle_indirect or -gpu swiftshader_indirect. And set QEMU_AUDIO_DRV=none before running it. The GUI message about the driving issue still comes up and there is a black screen.
According to the owner of the mesa-dist-win GitHub repo - he could reproduce the GUI message diver complaint and still run the emulator successfully - when imitating the state of a VM with his machine.
Note: This is not a solution, this is for sharing details of what I learned after trying out around 10-20 ways:
To enable virtualization in azure VDI, you need to enable Hyper-V feature.
After that you can see in your task manager->Performance that the virtualization is set to true.
If not, try enabling it from command prompt.
bcdedit /set hypervisorlaunchtype auto
After that virtualization is enabled.
Now, you won't be able to install Intel HAXM, as there is a race condition between Hyper-V and Intel HAXM for virtualization.
So, Without Intel HAXM, AVD won't run.
Without Enabling Virtualization with Hyper-V, there will be just black screen in AVD, and it won't boot.
So, I believe there is no solution to this problem until now, I have search everything on google, stackoverflow. If someone finds a solution, please post it over here.
Im facing the same issue with you using Win10 or Windows Server 2019 for DV3 and EV3 series. But I got it working on ubuntu if you are open for that option. No hyper v or haxm required, it is using KVM
Just go to the link "https://github.com/intel/haxm".
Scroll down to find "Downloads".
Download the "haxm-windows_v7_7_1.zip" for windows & haxm-macosx_v7_7_1.zip for macoxs.
Install the package and it will solve the issue.
They is another android emulator that is working
https://www.sanganakauthority.com/2020/04/run-android-emulator-and-android-studio.html
I installed docker.app on the my and I want to start up android x86 emulator in the docker image.
Unfortunately I met the following error(s) while trying to start the emulator. (emulator #nexus7)
ERROR: x86 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: KVM requires a CPU that supports vmx or svm
Given my Mac OS actually seems to support vmx, how could I startup android x86 emulator?
The way I've managed to do this (for now) is somewhat convoluted: I've set up an ubuntu vm in Parallels and enabled "nested virtualization"
With that setting I've managed to spin up and run our Android UI tests via docker on a Mac.
I've yet to figure out how to do that without the additional Parallels VM layer.
I just installed the Windows 10 anniversary update and now I can't start my Android emulators.
Android Studio shows the following message.
Android Emulator is incompatible with Hyper-V
But as you can see in the following image, Hyper-V is disabled.
I already rebooted the machine. I also tried running the following command from an elevated command prompt:
bcdedit /set hypervisorlaunchtype off
No luck.
Tried launching the emulator from a command prompt fails with the following message:
emulator -avd Nexus_5_API_23
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM 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.
Has anyone run into this issue?
The problem in my case is that I had Credential Guard and Virtualization Based Security.
I disabled the mentioned Windows 10 features using Device Guard and Credential Guard hardware readiness tool.
Unzip the tool, in a Powershell command go to the folder where you unzipped the tool and type:
DG_Readiness_Tool_v2.0.ps1 -Disable
After rebooting I was able to reinstall HAXM and start my emulators.
You can turn off Hyper-V in the services menu (type "Services" in the Search thingy), and also use the Services menu to turn it back on. Even though it may not be necessary I still reboot after doing it this way.
EDIT: And also did you run Command Prompt as Admin?
EDIT2: Reinstall Intel HAXM, as #Morrison_Chang says
I got this problem when installing android studio ? Although the program runs OK ! But what is the use of HAXM, what if I did not enable INTEL VT -x ?
But what is the use of HAXM
It enables the use of the Android x86 emulator images, which run significantly faster than the ARM emulator images.
what if I did not enable INTEL VT -x ?
You will not be able to install or use HAXM. As a result, you will be limited to development using the ARM emulator images, actual Android devices, and possibly third-party emulators (e.g., Genymotion).
You could check if it's already enabled by trying a few commands.
Start with
bcdedit /set hypervisorlaunchtype off
VT-x must be enabled for hypervisor to run, and hypervisor has to be off for HAXM to run so by trying to turn it off, you can possibly do 2 things at once.
You can also try installing HAXM and it will tell you if disabled.
You can also check your CPU capabilities by looking it up at https://ark.intel.com or getting the Intel CPU ID utility at http://www.intel.com/content/www/us/en/support/processors/processor-utilities-and-programs/intel-processor-identification-utility.html
You doesn't have to use AVD which comes with Android Studio, you can try third party AVD, such as Genymotion or Bluestack. Genymotion is the one that I prefer.