3

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:

enter image description here

And Windows Hypervisor Platform as well:

enter image description here

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:

enter image description here

...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:

enter image description here

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:

enter image description here


I found there was a gihub repo - distributing Mesa3D and LLvmpip - downloading mesa3d-19.1.3-release-mingw.exe and running the cmd file:

enter image description here

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.

lolelo
  • 698
  • 6
  • 18
  • [The Xamarin docs](https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=windows#accelerating-android-emulators-on-windows) state _"You can't run a VM-accelerated emulator inside another VM, such as a VM hosted by VirtualBox, VMWare, or Docker. You must run the Android emulator directly on your system hardware_". Did you consider using the [Visual Studio Emulator for Android](https://visualstudio.microsoft.com/de/vs/msft-android-emulator/)? Didn't try but maybe it offers better support for nested VM. – MarkusM Jul 29 '19 at 05:35
  • It seems it's outdated and abandoned: https://stackoverflow.com/questions/44864647/running-api-level-24-on-vs-emulator-for-android-hyper-v. There is also a notice on top of the page - that it does not support hardware acceleration. – lolelo Jul 29 '19 at 16:44
  • Using `GPU Caps Viewer` it says `GL_VENDOR: VMware, Inc`. And android docs also states is not possible. – lolelo Jul 30 '19 at 13:03
  • Here is a longer discussion about running android emulator on windows vm: https://github.com/pal1000/mesa-dist-win/issues/26 – lolelo Jul 31 '19 at 16:26
  • I am currently doing a workaround by connecting my visual studio on the windows vm to my Mac (I think both has to be in the same vpn) following this set up: https://learn.microsoft.com/en-us/xamarin/android/troubleshooting/questions/connect-android-emulator-mac-windows - allowing me to use android installed on my mac. – lolelo Oct 31 '19 at 09:21
  • Did you get you Android emu to work on azure vm? – Major Apr 18 '20 at 23:42
  • @Major No I never did! – lolelo Apr 19 '20 at 08:46
  • thanks. oh well.. ive been trying multiple times and had no chance too. – Major Apr 20 '20 at 18:16
  • btw, if you still need it, I got a luck and have it running on ubuntu using kvm. no hyper v or haxm. – Major Apr 21 '20 at 01:22
  • Adding onto this. I tried for around a week, with Support team and self tries, but I guess it isn't possible to run AVD on azure VDI (Windows 10). – Sumit Badsara Jun 11 '20 at 08:13

4 Answers4

1

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.

Sumit Badsara
  • 769
  • 9
  • 23
0

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

Major
  • 455
  • 1
  • 5
  • 15
  • I was looking to create multi targeted libraries in Xamarin: https://stackoverflow.com/questions/57173464/how-to-multitarget-in-xamarin-forms-with-visual-studio-for-mac Which is only possible in Visual Studio on Windows:) – lolelo Jun 11 '20 at 17:21
0
  1. Just go to the link "https://github.com/intel/haxm".

  2. Scroll down to find "Downloads".

  3. Download the "haxm-windows_v7_7_1.zip" for windows & haxm-macosx_v7_7_1.zip for macoxs.

  4. Install the package and it will solve the issue.

Ticherhaz FreePalestine
  • 2,738
  • 4
  • 20
  • 46
-1

They is another android emulator that is working https://www.sanganakauthority.com/2020/04/run-android-emulator-and-android-studio.html

dheeraj reddy
  • 1,019
  • 2
  • 13
  • 24