ksoichiro / dockerfiles

Dockerfile examples.
54 stars 22 forks source link

KVM error when running the emulator in docker #3

Open le1nux opened 9 years ago

le1nux commented 9 years ago

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!

emilianobonassi commented 8 years ago

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

le1nux commented 8 years ago

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

emilianobonassi commented 8 years ago

@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.

samblackmore commented 7 years ago

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.

alanbuenoerlabs commented 7 years ago

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

selvakumar1994 commented 6 years ago

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..