dockerfiles icon indicating copy to clipboard operation
dockerfiles copied to clipboard

KVM error when running the emulator in docker

Open le1nux opened this issue 9 years ago • 6 comments

Hello ksoichiro,

great work. Your android docker files helped me a lot recently. However when I want to run the emulator using the following command I get an KVM error: emulator -avd testEmulator -force-32bit -no-skin -no-audio -no-window

error: emulator: ERROR: x86_64 emulation currently requires hardware acceleration! Please ensure KVM is properly installed and usable. CPU acceleration status: KVM is not installed on this machine (/dev/kvm is missing).

I installed kvm in docker and when I check via kvm-ok if it works properly I'm getting the following error: INFO: /dev/kvm does not exist HINT: sudo modprobe kvm_intel modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/3.13.0-24-generic/modules.dep.bin'

When I run sudo modprobe kvm_intel I get the following ouput: modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/3.13.0-24-generic/modules.dep.bin'

I'm definitely not an expert on the topic of virtualization and kvm. How did you get around this bug? I adjusted some parts of your scripts to my purposes but I'm quite sure, that these didn't cause the errors. Any solutions?

Best regards!

le1nux avatar Jun 04 '15 13:06 le1nux

@le1nux, I incurred in your same issue, try to run the container with docker run --privileged.

emilianobonassi avatar Oct 03 '15 11:10 emilianobonassi

Thanks for the info. Next time I use it will try running it with the privileged flag.

le1nux avatar Oct 15 '15 11:10 le1nux

@le1nux :+1: , anyway if you use Docker on Mac OS X or any solution which use VirtualBox to embed Docker you can't because VirtualBox doesn't support Nested Virtualization. I hope you are using linux as host system.

emilianobonassi avatar Oct 15 '15 11:10 emilianobonassi

I had this same issue and my solution was to switch to an ARM image instead of Intel. Expect it to run slower since it won't use hardware acceleration but it's a workaround.

samblackmore avatar Oct 20 '16 18:10 samblackmore

@emilianobonassi, thanks. It's working now for me too!

alanbuenoerlabs avatar Jun 13 '17 14:06 alanbuenoerlabs

how to connect android emulator in jenkins pipeline script?.now i strucking in get the android instrumentation testing and code coverage report.anyone help me..

selvakumar1994 avatar Aug 16 '18 04:08 selvakumar1994