Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 632
Gabriel Ferreira Avatar asked Jan 14 '20 14:01

Gabriel Ferreira


People also ask

Can I run Android Emulator in VirtualBox?

Of course, you can install BlueStacks or other Android emulators, but most of these emulators use the Android-x86 On VirtualBox (AOVB) technology to emulate Android on PC.

Can you run Android Emulator on virtual machine?

Android Emulator allows you to run emulations of Android devices on Windows, macOS or Linux machines. The Android Emulator runs the Android operating system in a virtual machine called an Android Virtual Device (AVD). The AVD contains the full Android software stack, and it runs as if it were on a physical device.

Can you run emulator in VirtualBox?

No There is no way except nested virtualization. Even Genymotion will not work as genymotion itself is virtual box. To use virtual box in virtual box you need nested virtualization, which affects the performance.

Can VirtualBox run Android apps?

All you need to do is to install your chosen version of Android on a normal virtual machine or VM using VirtualBox. Simply follow the steps below and you'll have Android up and running in no time.


1 Answers

Workaround was to use Hyper-V Quick Create, which also uses Hyper-V. That way, I can have both the emulator and the VM working with Hyper-V without any conflicts or further changes.

I'd still like to know of other alternatives, if there are any. Also, I'll hopefully go back to VirtualBox whenever it is updated, as performance on this Microsoft VM Connection suite doesn't seem to be on par.

Don't quite know if this kind of situation is common, or even relevant for most people, but I'll try to keep this answer updated with any related news.

like image 109
Gabriel Ferreira Avatar answered Sep 29 '22 02:09

Gabriel Ferreira