Running android emulator with Azure windows 10

2019-08-20 10:36发布

问题:

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.

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.