Android HAXM 不适用于 Linux

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22216708/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 05:39:48  来源:igfitidea点击:

HAXM not working on Linux

androidandroid-emulatorhaxm

提问by Prashanth Sams

回答by Digit

HAXM is only needed on Windows and OS X. On Linux, you need to have KVM installed.

HAXM 仅在 Windows 和 OS X 上需要。在 Linux 上,您需要安装 KVM。

See the "Configuring VM Acceleration on Linux" section on: https://developer.android.com/studio/run/emulator-acceleration#vm-linux

请参阅“在 Linux 上配置 VM 加速”部分:https: //developer.android.com/studio/run/emulator-acceleration#vm-linux

Just download x86 based system images in the SDK Manager, then start the AVD, KVM will be auto-detected and used automatically if your machine/system supports it.

只需在 SDK 管理器中下载基于 x86 的系统映像,然后启动 AVD,如果您的机器/系统支持,KVM 将被自动检测并自动使用。

回答by hennzen

As already mentioned by @Digit, you do not need HAXM on Linux but KVM.

正如@Digit 已经提到的,Linux 上不需要 HAXM,而是 KVM。

Although the links in the other answers give a comprehensive answer, for those who like it short, on my Ubuntu, this was just enough:

尽管其他答案中的链接给出了全面的答案,但对于那些喜欢简短的人来说,在我的 Ubuntu 上,这已经足够了:

sudo apt-get install kvm

回答by Jerry101

The Intel Hardware Accelerated Execution Manager provides hardware-assisted virtualization. It should (hopefully) work the same with more recent versions of the Android emulator. Use the Android SDK Manager to download the KitKat x86 emulator.

英特尔硬件加速执行管理器提供硬件辅助虚拟化。它应该(希望)与更新版本的 Android 模拟器工作相同。使用 Android SDK Manager 下载 KitKat x86 模拟器。

Here's a more recent Intel document: http://software.intel.com/en-us/android/articles/speeding-up-the-android-emulator-on-intel-architectureand Google's documentation: http://developer.android.com/tools/devices/emulator.html

这是最近的 Intel 文档:http: //software.intel.com/en-us/android/articles/speeding-up-the-android-emulator-on-intel-architecture和 Google 的文档:http://developer。 android.com/tools/devices/emulator.html

Do follow those instructions.

请务必遵循这些说明。

If it still doesn't work for you, there are many possible causes such as: not having an Intel CPU, not installed properly, need to set BIOS settings, need to reboot, need to allocate lots of memory to HAXM, need to keep the AVD memory size down, attempting to configure the emulator to use the host GPU, ...

如果它仍然不适合您,可能的原因有很多,例如:没有 Intel CPU、未正确安装、需要设置 BIOS 设置、需要重新启动、需要为 HAXM 分配大量内存、需要保持AVD 内存大小减小,尝试将模拟器配置为使用主机 GPU,...

What are the specific symptoms? Do try searching for them on Google.

具体症状是什么?请尝试在 Google 上搜索它们。

Also search for Hardware Accelerated Execution Manager linuxfor more documentation and experience reports.

还可以搜索Hardware Accelerated Execution Manager linux以获取更多文档和体验报告。

回答by Martin Zeitler

KVM has to be enabled by inserting the kernel module:

必须通过插入内核模块来启用 KVM:

sudo modprobe kvm-intel

How to Start Intel Hardware-assisted Virtualization (hypervisor) on Linux to Speed-up Intel Android x86 Emulatormight help; verbose output is also useful for testing:

如何在 Linux 上启动英特尔硬件辅助虚拟化(管理程序)以加速英特尔 Android x86 模拟器可能会有所帮助;详细输出也可用于测试:

emulator -avd ... -verbose

should log something like:

应该记录如下内容:

emulator: CPU Acceleration: working
emulator: CPU Acceleration status: KVM (version 12) is installed and usable.

the qemuhowtostates:

qemuhowto状态:

You must have kvm module (kvm-intel or kvm-amd) installed for your kernel, and the permission of /dev/kvm is set to allow your user to access it. Otherwise the KVM support will be disabled and it may run very slow.

您必须为您的内核安装 kvm 模块(kvm-intel 或 kvm-amd),并且 /dev/kvm 的权限设置为允许您的用户访问它。否则 KVM 支持将被禁用,并且运行速度可能会很慢。