Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Can't run more than 8 emulators #140

Closed
insidiaGithub opened this issue Dec 4, 2018 · 7 comments
Closed

Can't run more than 8 emulators #140

insidiaGithub opened this issue Dec 4, 2018 · 7 comments

Comments

@insidiaGithub
Copy link

Hi!

I was install last android studio with 7.3.2 HAXM and QEMU emulator version 2.12.0. I try to start 9 android emulators but can start only 8. I get this error when try to start 9th emulator:

Failed to create VM. Error code: 31
Failed to create vm ffffffff
Failed to create HAX VM
No accelerator found.
qemu-system-x86_64.exe: failed to initialize HAX: Invalid argument

I have 16 GB of ram memory in my PC. I try to change ram, hype and other memory in emulators, but I always get this error. Also I try run 9 emulators on other PC and get the same error. Could you help me?

@krytarowski
Copy link
Contributor

This is the design to support up to 8 emulators.

@insidiaGithub
Copy link
Author

This is the design to support up to 8 emulators.

Sorry, but why can not I run more than 8?
This means that for automated testing I need more than 20 virtual machines and I have to create 3 servers for this? thank you

@krytarowski
Copy link
Contributor

krytarowski commented Dec 4, 2018

Internal code is structured against that number. Also if you want to add more, than we might run out of minor numbers per device type. We already support 8 VMs x 16 VCPUs that is 128 minor devices.

If you need something more advanced, probably there is an option to go for something other than HAXM. You might also adapt your setup that is within the supported range of VMs.

@raphaelning
Copy link
Contributor

@krytarowski was right. The 8 VM limitation seems to be an early design decision (long before I started working on this project). Maybe it's because the original authors chose to generate VM IDs using an 8-bit seed:

haxm/core/vm.c

Lines 39 to 40 in 98c8126

static uint8_t vm_mid_bits = 0;
#define VM_MID_BIT 8

If that's the only place in the code that enforces this limitation, we should be able to replace it with an uint64_t seed and support 64 VMs. BTW, which version of Windows are you using?

@insidiaGithub
Copy link
Author

insidiaGithub commented Dec 4, 2018

Internal code is structured against that number. Also if you want to add more, than we might run out of minor numbers per device type. We already support 8 VMs x 16 VCPUs that is 128 minor devices.

If you need something more advanced, probably there is an option to go for something other than HAXM. You might also adapt your setup that is within the supported range of VMs.

thanks for the quick and detailed response

@insidiaGithub
Copy link
Author

@raphaelning, thank you for your responce. I clone repo and change this:
static uint64_t vm_mid_bits = 0;
#define VM_MID_BIT 64 - This I also changed to 64. Without this change does not work

I build solution in Debug conf and install debug certificate, than I replace IntelHaxm.sys and restart intelhaxm service. After that I can run more than 8 Android VM.

I think it would be nice if you ever fixed it in the main branch. Thanks again =)

@insidiaGithub
Copy link
Author

insidiaGithub commented Dec 4, 2018

Pull request #141

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants