title: Running android emulator with Azure windows 10
body: <p>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:</p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>The hyper-v is enabled:</p>
  
  <p><a href="https://i.stack.imgur.com/oYUZh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oYUZh.png" alt="enter image description here"></a></p>
  
  <p>And Windows Hypervisor Platform as well:</p>
  
  <p><a href="https://i.stack.imgur.com/rn35H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rn35H.png" alt="enter image description here"></a></p>
  
  <p>The size of the VM is <code>D2_v3</code> and Dv3 - series is supposed to support Nested Virtualization. <a href="https://social.msdn.microsoft.com/Forums/en-US/0ded3eee-17cf-4f69-9337-589037436733/using-android-x86-on-azure-virtual-machines?forum=WAVirtualMachinesforWindows" rel="nofollow noreferrer">Here</a>, <a href="https://stackoverflow.com/questions/30191202/is-there-any-way-that-i-can-make-android-emulator-run-on-azure-virtual-machine">here</a> and <a href="https://stackoverflow.com/questions/56364841/running-android-emulator-hyper-v-based-on-a-azure-vm-windows-server-2016">here</a> are claims about it being so and that android emulator functions. And as I far as I have understood:</p>
  
  <p><a href="https://i.stack.imgur.com/VUeWX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VUeWX.png" alt="enter image description here"></a></p>
  
  <p>...is part of Dv3 series.</p>
  
  <p><strong>What could be the problem?</strong></p>
  
  <hr>
  
  <p>I am able to run an Ubuntu VM in Hyper-V of the Azure Windows VM.</p>
  
  <p>Disabling <code>Hyper-V</code> and <code>Windows Hypervisor Platform</code>, installing <code>HAXM</code> and running I get this error:</p>
  
  <p><a href="https://i.stack.imgur.com/XEEKx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XEEKx.png" alt="enter image description here"></a></p>
  
  <p>According to the writer of this <a href="https://medium.com/@everton.rreis/android-emulator-on-azure-vm-fe4df57a6955" rel="nofollow noreferrer">medium article</a> and this StackOverflow <a href="https://stackoverflow.com/questions/48433641/does-azure-allow-app-need-opengl-any-way-to-go-around?source=post_page---------------------------">discussion</a> - 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 <code>Mesa3D+LLvmpip version of opengl32.dll</code> from the authors Github repo, replacing the OpenGL file in system32 and running the android emulator: </p>
  
  <p><a href="https://i.stack.imgur.com/ljXfC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ljXfC.png" alt="enter image description here"></a> </p>
  
  <hr>
  
  <p>I found there was a <a href="https://github.com/pal1000/mesa-dist-win#downloads" rel="nofollow noreferrer">gihub repo</a> - distributing Mesa3D and LLvmpip - downloading <a href="https://github.com/pal1000/mesa-dist-win/releases" rel="nofollow noreferrer">mesa3d-19.1.3-release-mingw.exe</a> and running the cmd file:</p>
  
  <p><a href="https://i.stack.imgur.com/tE12J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tE12J.png" alt="enter image description here"></a></p>
  
  <p>There is the following message in cmd:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>...which seems to be a fit for the driver rendering problem.</p>
  
  <hr>
  
  <p>I was able to git rid of all cmd warnings and error by<code>-avd myandroidemulatorapi28</code>, and any with of following two flags <code>-gpu angle_indirect</code> or <code>-gpu swiftshader_indirect</code>. And <code>set QEMU_AUDIO_DRV=none</code> before running it. The GUI message about the driving issue still comes up and <strong>there is a black screen</strong>.</p>
  
  <p>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.  </p>