Search code examples
androidandroid-emulatorvirtual-machinevirtualboxvirtualization

Running Android Emulator together with a VirtualBox machine


I'm on Windows 10 1903 and need to run a Linux VM while working with the Android Emulator. I'm on an AMD Ryzen 5 3600x CPU.

If I disable Windows Hypervisor Platform, the VM works, but the emulator doesn't (other than arm images, I believe, but I haven't tested those, as their performance isn't ideal).

VirtualBox seems to have some recent support for this, but the latest Windows update broke it as per this thread.

Apparently, using the Genymotion emulator is an option, but not a free one, unfortunately. Switching to Linux is also not an option.

Is there a way to do this without relying on arm images? Any ideas would be appreciated, as I've already sunk way too much time on this.

For some more context, the vm log shows these messages (of interest):

00:00:01.324766 ********************* End of CFGM dump **********************
00:00:01.324820 HM: HMR3Init: Attempting fall back to NEM: AMD-V is not available
00:00:01.353579 NEM: WHvCapabilityCodeHypervisorPresent is TRUE, so this might work...
00:00:01.353588 NEM: WHvCapabilityCodeExtendedVmExits      = 0x0000000000000007

and eventually:

00:00:01.354665 NEM: Adjusting APIC configuration from X2APIC to APIC max mode.  X2APIC is not supported by the WinHvPlatform API!
00:00:01.354667 NEM: Disable Hyper-V if you need X2APIC for your guests!

I'm assuming this has to do with Hyper-V taking up all the AMD-V usage capability, or, in this case, Windows Hypervisor Platform, as that's the only Windows virtualization feature enabled.


Solution

  • An alternative is using the newly released AMD Hypervisor emulator by Google.

    Took me a while to find it, but it makes so you don't need either Hyper-V or WHP, solving this issue quite nicely. Performance also seems up to par with HAXM.