moby: Docker for Mac conflict with Android emulator.

Output of docker version:

Client:
 Version:      1.12.0-rc2
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   906eacd
 Built:        Fri Jun 17 20:35:33 2016
 OS/Arch:      darwin/amd64
 Experimental: true
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Output of docker info:

Containers: 5
 Running: 0
 Paused: 0
 Stopped: 5
Images: 159
Server Version: 1.12.0-rc2
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 137
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host overlay null
Swarm: inactive
Runtimes: default
Default Runtime: default
Security Options: seccomp
Kernel Version: 4.4.14-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.954 GiB
Name: moby
ID: ONYM:IOTV:M6Q6:R6Q4:PGPH:DIU3:QJ3O:5JOQ:WIVT:E7ED:4NIN:PYKQ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 21
 Goroutines: 28
 System Time: 2016-07-12T10:45:02.68400469Z
 EventsListeners: 1
No Proxy: 127.0.0.1
Username: jaggerwang
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8

Additional environment details (AWS, VirtualBox, physical, etc.):

Steps to reproduce the issue:

  1. Start docker
  2. Start Android emulator from AVD manager.

Describe the results you received: The AVD manager complains “emulator: ERROR: Unfortunately, there’s an incompatibility between HAXM hypervisor and VirtualBox 4.3.30+ which doesn’t allow multiple hypervisors to co-exist”. When stopped docker, the emulator can be started.

Describe the results you expected: Emulator runs fine.

Additional information you deem important (e.g. issue happens only occasionally): Docker for Mac is not nedd VirtualBox anymore, so I’ve already uninstalled VirtualBox using the uninstall tool in VirtualBox image. This is like virtual machine related problem, but Docker is not need VirtualBox anymore, why still have this problem?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 19 (3 by maintainers)

Most upvoted comments

Issue is fixed with Intel HAXM 6.1.1 🎆 It is possible to run x86 android emulators and docker at the same time 🎉

Download an update here https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager

or brew cask install intel-haxm

Confirmation of bug fix: https://code.google.com/p/android/issues/detail?id=198497#c10

Same problem here

FYI: Don’t trust the HAXM version that Android Studio SDK Manager is showing as installed!

In my case Android Studio SDK Manager showed that I have HAXM 6.1.1 installed when in fact I had HAXM 6.0.3 installed after checking it with the command from @noomz above.

Uninstalling and reinstalling it via Android Studio SDK Manager fixed it. Verified afterwards with the same command that indeed 6.1.1 was installed.

Finally I can use Docker and the emulator together at the same time.

@plastiv I can’t install latest HAXM 6.1.1 with brew cask so I manually download dmg version.

FYI, to check HAXM version you can run /path/to/Android/sdk/tools/emulator -accel-check

Someone commented on the Android issues link above:

Yes, you can manually add "-no-accel -smp 1" to the emulator command line and it would run without hardware acceleration. Please either set AVD cores to 1 or don't miss the '-smp 1' parameter, as emulator runs very slowly without acceleration, and it becomes even slower if it needs to emulate more than a single core

Without acceleration, the emulator is indeed too slow to even be usable.

Looks like the only plausible workarounds are to either use an actual Android device for testing (ugh) or get out of Docker (ugh)

Please can you complain to the Android emulator not here, we cannot fix this problem: we are using the Apple supported hypervisor framework, while HAXM is using a custom kernel extension, and it is their responsibility to make it compatible with the rest of the Apple operating system.

It might also be worth complaining on the Intel HAXM forum, as it appears that the problematic software is from Intel not Google https://software.intel.com/en-us/forums/android-applications-on-intel-architecture

Closing as we cannot resolve this.