Windows VMs for running android emulators don't work well, What is the best image for running an android emulator?

Liran Benzino 0 Reputation points
2024-02-18T08:55:10.2766667+00:00

Hey, I'm trying to run an Android emulator (and iOS in the near future) on a Windows VM, but it's very slow. I've tried some images, but when I try to run the Android emulator, I get a warning about nested virtualization, and the emulator boot takes hours. Are there any images recommended for this purpose? The last one I tried was android_studio-on-windows-server2022, Standard D4s v3 (4 vCPUs, 16 GiB memory). Thanks!

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,291 questions
Microsoft Intune Android
Microsoft Intune Android
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Android: An open-source mobile platform based on the Linux kernel, developed by Google, and maintained by the Open Handset Alliance.
242 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ahamed Musthafa Careem 386 Reputation points
    2024-02-18T10:24:50.1733333+00:00

    Hi @Liran Benzino , Running an Android emulator within a virtual machine on Windows can indeed be slow, especially if nested virtualization is not properly supported or enabled. Nested virtualization allows a hypervisor, like Hyper-V or VMware, to run within another hypervisor. Here are some recommendations to improve performance when running an Android emulator within a Windows VM:

    • Enable Nested Virtualization
    • Use Hyper-V Acceleration: If you're using Hyper-V as your VM platform, make sure to enable Hyper-V acceleration for your VM. This can significantly improve the performance of the Android emulator. You can enable Hyper-V acceleration by configuring the VM settings in Hyper-V Manager. Optimize VM Performance Settings: Adjust VM performance settings, such as CPU and RAM allocation, disk caching, and graphics acceleration, to optimize performance for running the Android emulator.

    The best solution would be to consider is using a Physical Device for Testing.

    1 person found this answer helpful.

  2. kobulloc-MSFT 24,321 Reputation points Microsoft Employee
    2024-02-22T01:39:16.0866667+00:00

    Hello, @Liran Benzino ! I think @Ahamed Musthafa Careem made some good points that I'd like to expand on a bit.

    How can I improve the performance of my Android emulator on an Azure VM?

    The first and most valuable resource is the Android emulator documentation which includes an overview on acceleration, Hyper-V, VM connection scenarios, and troubleshooting. Making sure that Hyper-V with Nested Virtualization is properly configured is going to be very important:

    https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/hardware-acceleration?view=net-maui-8.0

    Looking at your Standard_D4s_v3 VM, it may be worth reviewing your workload type and corresponding VM size. A Standard_D8s_v3 with more vCPUs may be more in line with an emulation workload, especially since local emulation is likely taking advantage of your GPU:

    https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/virtual-machine-recs

    Lastly, you aren't alone in searching for ways to improve Android Emulator performance. This thread in particular may be helpful which includes more guidance on acceleration for Hyper-V:

    (Microsoft Q&A) Android Emulator extremly laggy and slow on new system?


    I hope this has been helpful! Your feedback is important so please take a moment to accept answers.

    If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A! User's image

    0 comments No comments