Running Android Studio (and specifically an Android Virtual Device (ADV)) within a Windows VM on ESXi or in Azure

Chris Swinney 0 Reputation points
2024-05-19T07:51:00.0566667+00:00

We have a use case (training) where we need to run an emulated Android Virtual Device within a Windows VM running atop either VMware ESXi or in Azure (effectively a nested hypervisor). I have this working in multiple ways, and whilst Android Studio complains that nested hypervisor and I expected some slowdown, things are pretty unusable. For example, booting an OOTB Pixel 3a image takes an hour.

I want to know if anyone has this working reasonably and what setup they might use.

FWIW, I have tried the following type 1 hypervisor and Windows OS:

ESXi:

  • Windows 2019
  • Windows 2022
  • Windows 11

Azure (using Standard_D4s_v4 instance)

  • Windows 2022 Datacentre

Further, none of the Type 1 hypervisors have access to GPU acceleration. I thought I might get this from Azure, but the 'N' series instances (with GPUs) do not support nested virtualisation. I have set the config.ini for the AVDs to use:

hw.gpu.enabled

I have also tried a combination of hardware acceleration within the VMs:

  • AEHD (takes over an hour to boot an image - gave up)
  • WHPX (takes over an hour to boot an image - gave up)
  • HAXM (this seems to be the best option, albeit it is now deprecated, and you see errors within the AVD saying things like "System UI isn't responding")

I completely get the nested hypervisors are suboptimal. However, they do serve a purpose, but I haven't seen any nested application perform quite so poorly as an AVD. Am I simply expecting too much?

If I am missing anything, I would be grateful for your input.We have a use case (training) where we need to run an emulated Android Virtual Device within a Windows VM running atop either VMware ESXi or in Azure (effectively a nested hypervisor). I have this working in multiple ways, and whilst Android Studio complains that nested hypervisor and I expected some slowdown, things are pretty unusable. For example, booting an OOTB Pixel 3a image takes an hour.

I want to know if anyone has this working reasonably and what setup they might use.

FWIW, I have tried the following type 1 hypervisor and Windows OS:

ESXi:

  • Windows 2019
  • Windows 2022
  • Windows 11

Azure (using Standard_D4s_v4 instance)

  • Windows 2022 Datacentre

Further, none of the Type 1 hypervisors have access to GPU acceleration. I thought I might get this from Azure, but the 'N' series instances (with GPUs) do not support nested virtualisation. I have set the config.ini for the AVDs to use:

hw.gpu.enabled

I have also tried a combination of hardware acceleration within the VMs:

  • AEHD (takes over an hour to boot an image - gave up)
  • WHPX (takes over an hour to boot an image - gave up)
  • HAXM (this seems to be the best option, albeit it is now deprecated, and you see errors within the AVD saying things like "System UI isn't responding")

I completely get the nested hypervisors are suboptimal. However, they do serve a purpose, but I haven't seen any nested application perform quite so poorly as an AVD. Am I simply expecting too much?

If I am missing anything, I would be grateful for your input.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,705 questions
0 comments No comments
{count} votes