Android emulator and virtualbox cannot run at same

2019-01-08 10:38发布

Whenever I have Virtualbox running, I cannot start an Android emulator image (and vice versa). The error message in the AVD manager is

ioctl(KVM_CREATE_VM) failed: Device or resource busy
ko:failed to initialize KVM

How can I make both run at the same time?

That is a Ubuntu 64 bit, all involved software is of the latest released version.

12条回答
\"骚年 ilove
2楼-- · 2019-01-08 11:03

There is finally a fix for this.

Follow these steps for macOS:

  1. In Android Studio Go to Tools -> Android -> SDK Manager

  2. Confirm you have the latest version of Intel Emulator Accelerator HAXM installed (v6.1.1) Preferences panel in Android Studio.

  3. Go to the extras directory of the Android SDK location displayed in the preferences. On MacOS you can do this:

    open ~/Library/Android/sdk/extras

  4. Install the HAXM packing by opening IntelHAXM_6.1.1.dmg, then opening IntelHAXM_6.1.1.mpkg in the mounted folder, and following the installer instructions.

Follow these steps for Windows:

  1. In Android Studio Go to Tools -> Android -> SDK Manager

  2. Confirm you have the latest version of Intel Emulator Accelerator HAXM installed (v6.1.1) Preferences panel in Android Studio.

  3. Go to the extras directory of the Android SDK location displayed in the preferences. Something like:

    C:\Users\<username>\AppData\Local\Android\sdk\extras

  4. In that directory is some kind of file like intelhaxm-android.exe. Run it.

查看更多
一纸荒年 Trace。
3楼-- · 2019-01-08 11:03

This might be out of topic, due to the fact that OP requested VirtualBox + KVM in the same time, but still, it might be the workaround: I was looking for a way to launch Windows 7 and AVD on Ubuntu 18.10 x64. Turning off KVM is not an option due to the fact that performance of AVD is critical to me. I have installed Windows 7 via Virtual Machine Manager (virt-manager package) and now both the AVD and Windows 7 are hardware accelerated.

查看更多
时光不老,我们不散
4楼-- · 2019-01-08 11:05

You also can change CPT/ABI setting from x86 to arm in emulator settings.

查看更多
贼婆χ
5楼-- · 2019-01-08 11:06

Though it's a workaround either, but definitely better than disabling KVM as everyone suggesting.

Just run the virtualbox guest in KVM instead. For example (kvm here is just a script running a qemu-system-x86_64 -enable-kvm):

kvm Win7.vdi -boot c -m 2G -vga qxl
查看更多
劫难
6楼-- · 2019-01-08 11:07

I resolved it by installing HAXM 6.1.2.

Please refer to the following link for details :- https://forums.docker.com/t/cant-using-docker-for-mac-with-android-emulator-haxm/8939/11

查看更多
叼着烟拽天下
7楼-- · 2019-01-08 11:07

Another solution is to use libvirt backed vagrant using vagrant-libvirt plugin.

查看更多
登录 后发表回答