Docker for Mac conflict with Android emulator. #24530

Closed
jaggerwang opened this Issue Jul 12, 2016 · 19 comments

Comments

Projects
None yet
@jaggerwang

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?

@justincormack

This comment has been minimized.

Show comment
Hide comment
@justincormack

justincormack Jul 12, 2016

Contributor

Hi, can you file an issue against the Android emulator. We are simply using the Apple Hypervisor framework, and I think HAXM is not compatible with that, and also has an incorrect error message.

Contributor

justincormack commented Jul 12, 2016

Hi, can you file an issue against the Android emulator. We are simply using the Apple Hypervisor framework, and I think HAXM is not compatible with that, and also has an incorrect error message.

@jaggerwang

This comment has been minimized.

Show comment
Hide comment
@jaggerwang

jaggerwang Jul 12, 2016

Already filed, https://code.google.com/p/android/issues/detail?id=215784.
But Why Docker for Mac is still using Hypervisor, I'm using the latest native version, and it is not needing VirtualBox anymore.

Already filed, https://code.google.com/p/android/issues/detail?id=215784.
But Why Docker for Mac is still using Hypervisor, I'm using the latest native version, and it is not needing VirtualBox anymore.

@justincormack

This comment has been minimized.

Show comment
Hide comment
@justincormack

justincormack Jul 13, 2016

Contributor

We use Hypervisor Framework, not Virtual box, I think the HAXM error message is wrong.

Contributor

justincormack commented Jul 13, 2016

We use Hypervisor Framework, not Virtual box, I think the HAXM error message is wrong.

@kenyee

This comment has been minimized.

Show comment
Hide comment
@kenyee

kenyee Jul 30, 2016

I've been trying to figure out the cause of this as well...want to use Docker for setting up a developer server environment locally but when I fire up Docker, HAXM emulators blow up...

kenyee commented Jul 30, 2016

I've been trying to figure out the cause of this as well...want to use Docker for setting up a developer server environment locally but when I fire up Docker, HAXM emulators blow up...

@oandreazza

This comment has been minimized.

Show comment
Hide comment
@oandreazza

oandreazza Aug 2, 2016

Same problem here

Same problem here

@giulioroggero

This comment has been minimized.

Show comment
Hide comment
@giulioroggero

giulioroggero Oct 13, 2016

Same problem...

Same problem...

@imshenyz

This comment has been minimized.

Show comment
Hide comment
@imshenyz

imshenyz Nov 3, 2016

Same problem, mark.

imshenyz commented Nov 3, 2016

Same problem, mark.

@barakethan

This comment has been minimized.

Show comment
Hide comment
@barakethan

barakethan Nov 4, 2016

Same here...

Same here...

@justincormack

This comment has been minimized.

Show comment
Hide comment
@justincormack

justincormack Nov 4, 2016

Contributor

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.

Contributor

justincormack commented Nov 4, 2016

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.

@kenyee

This comment has been minimized.

Show comment
Hide comment
@kenyee

kenyee Nov 4, 2016

FWIW, I added a post to the HAXM forum. I filed a Virtualbox ticket too. Wish there were some way to just get everyone in the same room to hash it out :-(

kenyee commented Nov 4, 2016

FWIW, I added a post to the HAXM forum. I filed a Virtualbox ticket too. Wish there were some way to just get everyone in the same room to hash it out :-(

@huang03jun

This comment has been minimized.

Show comment
Hide comment

Pls subscribe here for it progress: https://code.google.com/p/android/issues/detail?id=198497

@davidmarquis

This comment has been minimized.

Show comment
Hide comment
@davidmarquis

davidmarquis Jan 24, 2017

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)

davidmarquis commented Jan 24, 2017

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)

@kenyee

This comment has been minimized.

Show comment
Hide comment
@kenyee

kenyee Jan 24, 2017

Or use Docker Toolbox and Genymotion.

kenyee commented Jan 24, 2017

Or use Docker Toolbox and Genymotion.

@paweljanowiak2

This comment has been minimized.

Show comment
Hide comment
@paweljanowiak2

paweljanowiak2 Mar 21, 2017

If you use docker toolbox and parallels it is possible to run an emulator with HAXM.
https://github.com/Parallels/docker-machine

If you use docker toolbox and parallels it is possible to run an emulator with HAXM.
https://github.com/Parallels/docker-machine

@plastiv

This comment has been minimized.

Show comment
Hide comment
@plastiv

plastiv Apr 5, 2017

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

plastiv commented Apr 5, 2017

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

@noomz

This comment has been minimized.

Show comment
Hide comment
@noomz

noomz Apr 10, 2017

@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

noomz commented Apr 10, 2017

@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

@Nimrodda

This comment has been minimized.

Show comment
Hide comment
@Nimrodda

Nimrodda Jun 2, 2017

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.

Nimrodda commented Jun 2, 2017

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.

@jenskuhrjorgensen

This comment has been minimized.

Show comment
Hide comment
@jenskuhrjorgensen

jenskuhrjorgensen Sep 27, 2017

I couldn't run Docker and my Android simulator simultaneously, but the awesome answers provided by @noomz and @Nimrodda led me to my fix:

I checked my HAXM version with emulator-check accel from /path/to/Android/sdk/tools (I'm on a Mac) and the installed version (6.0.1) was not in sync with what Android Studio claimed I had installed (6.2.1).

Upgrading HAXM on https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm fixed the problem for me. Hooray 😃

I couldn't run Docker and my Android simulator simultaneously, but the awesome answers provided by @noomz and @Nimrodda led me to my fix:

I checked my HAXM version with emulator-check accel from /path/to/Android/sdk/tools (I'm on a Mac) and the installed version (6.0.1) was not in sync with what Android Studio claimed I had installed (6.2.1).

Upgrading HAXM on https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm fixed the problem for me. Hooray 😃

@rafalfaro-hangar

This comment has been minimized.

Show comment
Hide comment
@rafalfaro-hangar

rafalfaro-hangar Mar 2, 2018

In my case the problem is if I open android emulator after docker the sound in the emulated device crashes. If I reverse the order it works.

In my case the problem is if I open android emulator after docker the sound in the emulated device crashes. If I reverse the order it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment