简体   繁体   中英

Running android emulator with Azure windows 10

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM