8

I am trying to understand if it is feasible to run the Android Emulator with HAXM-based acceleration and VirtualBox side by side on the same Windows host.

I have a Windows host running a 64 bit Linux guest under VirtualBox. I occasionally need to use Android Studio under the VM, including the Android emulator. x86 Android images require hardware-assisted virtualization, but unfortunately, VirtualBox does not implement nested Virtualization when running on Intel processors, it only does for AMD-V virtualization extensions, and my PC uses Intel hardware. So my best bet would be to move the emulator outside the VM and try to run it alongside other VM's, using adb's ability to connect to devices over TCP to remotely control the emulator.

I am currently running a Windows 10 1903 host, on which I have installed both VirtualBox 6.0.10 and Android Emulator 29.0.11 using Intel HAXM 7.5.2. I've read that, starting from a certain version, HAXM can coexists with other hypervisors. This seems to be confirmed by my experience since I can successfully run the Android Emulator and one or more VirtualBox machines in parallel on the same host.

However, it looks like that the two hypervisors are interfering in some subtle way that causes apps running under the Android Emulator to behave erratically. For example, while navigating through system settings, activities would just crash and dialogs are dismissed for no apparent reasons without giving me the time to close them.

But the most critical problem is that, if I try to run an instrumented test suite against an app installed on the emulator, I get all sorts of random failures and crashes. I have verified that, if I close all VirtualBox VM's and run test suites remotely from a different host, everything goes smoothly.

This has left my with some options, none of which are perfect for my workflow:

  1. move the emulator to a second physical host and remotely connect to it via adb connect. This way I always need to have two PC's with me;
  2. migrate to VMWare Workstation, which implements nested virtualization on VT-x capable CPU's.

My question is if anybody has actually been able to run the hardware-accelerated Android emulator alongside VirtualBox in a stable manner. Maybe the interference can be limited by careful usage of some QEmu/VirtualBox options.

0

You must log in to answer this question.

Browse other questions tagged .