android-avd icon indicating copy to clipboard operation
android-avd copied to clipboard

/dev/kvm not working

Open amitg25 opened this issue 5 years ago • 1 comments

Hello, I was follow most steps listed here but it seems below command is not working for me.

docker run -it --rm --device /dev/kvm -p 5554:5554 -p 5555:5555 thedrhax/android-avd

I am on MacOS X. After googleing around i found that i need a KVM ubutu machine to resolve this machine but not sure what are the steps i should take to resolve this issue on MacOS X. So far i have done following steps

  1. Install VirtualBox with ubutu image.
  2. Again tried above given docker command but with no help.

Can you please help resolve this? Or guide what is required to resolve this issue.

amitg25 avatar Apr 15 '19 22:04 amitg25

Hi,

  1. It won't work in virtual machine because VirtualBox doesn't support nested hardware-accelerated virtualization. There are other virtual machines that support passing VT-x extension to their guests but it would be very inefficient setup (VM inside VM);

  2. To start AVD on your host you need to make sure that /dev/kvm exists. If it doesn't, you will need to enable VT-x and install/enable Intel HAXM. These answers may help;

  3. If Docker runs natively on macOS, it should be possible to mount /dev/kvm into container the same way as on Linux (--device /dev/kvm). However, I don't have any devices with macOS, so I can't test it myself;

  4. This container is more suitable for headless setups on Linux servers. On desktop you might want to use AVD without Docker (directly or via Android Studio). It will have the same functionality as well as faster UI and more flexibility.

Hope this helps, Dmitry

TheDrHax avatar Apr 18 '19 13:04 TheDrHax