Hardware acceleration android studio

Содержание
  1. Аппаратное ускорение для производительности эмулятора (Hyper-V & HAXM)
  2. Ускорение эмуляторов Android в Windows
  3. Ускорение с помощью Hyper-V
  4. Проверка поддержки Hyper-V
  5. Включение ускорения Hyper-V
  6. Ускорение с помощью HAXM
  7. Проверка поддержки HAXM
  8. Установка HAXM
  9. Устранение неполадок
  10. Ускорение эмуляторов Android в macOS
  11. Ускорение с помощью платформы гипервизора
  12. Ускорение с помощью HAXM
  13. Проверка поддержки HAXM
  14. Установка HAXM
  15. Устранение неполадок
  16. Configure hardware acceleration for the Android Emulator
  17. Configure graphics acceleration
  18. Requirements
  19. Configure graphics acceleration in the AVD Manager
  20. Configure graphics acceleration from the command line
  21. Enable Skia rendering for Android UI
  22. Configuring VM acceleration
  23. General requirements
  24. Development environment requirements
  25. Virtualization extension requirements
  26. Restrictions
  27. About hypervisors
  28. Check if a hypervisor is installed
  29. Configure VM acceleration on Windows
  30. Choose a hypervisor on Windows
  31. Double-check when disabling Hyper-V
  32. Configure VM acceleration using Intel HAXM on Windows
  33. Configure VM acceleration using Android Emulator Hypervisor Driver for AMD Processors on Windows
  34. Configure VM acceleration using Windows Hypervisor Platform
  35. Configure VM acceleration on macOS
  36. Configure VM acceleration on Linux
  37. Requirements
  38. Check whether KVM is currently installed on Linux
  39. Install KVM on Linux

Аппаратное ускорение для производительности эмулятора (Hyper-V & HAXM)

В этой статье рассказывается, как использовать функции аппаратного ускорения компьютера для обеспечения максимальной производительности эмулятора Android Emulator.

Visual Studio упрощает тестирование и отладку приложений Xamarin.Android с помощью Android Emulator в ситуациях, когда использовать устройство с Android невозможно или неудобно. Однако если на компьютере недоступно аппаратное ускорение, Android Emulator работает слишком медленно. Вы можете значительно повысить производительность эмулятора Android Emulator, используя специальные образы виртуальных устройств на платформе x86 в сочетании с функциями виртуализации на компьютере.

Сценарий HAXM WHPX Hypervisor.Framework
У вас процессор Intel X X X
У вас процессор AMD X
Требуется поддержка Hyper-V X
Требуется поддержка вложенной виртуализации Ограниченный
Требуется использовать такие технологии, как Docker (С WSL2) X X

Ускорение эмуляторов Android в Windows

Следующие технологии виртуализации доступны для ускорения эмулятора Android:

Microsoft Hyper-V и платформа гипервизора Windows (WHPX) . Hyper-V — это функция виртуализации в Windows, которая позволяет запускать виртуализированные компьютерные системы на физическом главном компьютере.

Intel Hardware Accelerated Execution Manager (HAXM) . HAXM — это механизм виртуализации для компьютеров на базе процессоров Intel.

Для достижения наилучшего взаимодействия с пользователем в Windows рекомендуется использовать WHPX для ускорения Android Emulator. Если WHPX недоступен на вашем компьютере, можно использовать HAXM. Эмулятор Android автоматически использует аппаратное ускорение, если соблюдены следующие условия:

Аппаратное ускорение доступно и включено на компьютере разработчика.

Эмулятор работает с образом системы, созданным для виртуального устройства на платформе x86.

Нельзя запустить эмулятор на базе ускоренной виртуальной машины внутри другой виртуальной машины, например под управлением VirtualBox, VMware или Docker (если не используется WSL2). Эмулятор Android следует запускать непосредственно на системном оборудовании.

Сведения о запуске и отладке с помощью эмулятора Android см. в статье Отладка в Android Emulator.

Ускорение с помощью Hyper-V

Перед включением Hyper-V прочтите следующий раздел, чтобы убедиться, что компьютер поддерживает Hyper-V.

Проверка поддержки Hyper-V

Hyper-V работает на платформе гипервизора Windows. Чтобы использовать эмулятор Android с Hyper-V, компьютер должен отвечать следующим условиям для поддержки платформы гипервизора Windows:

Оборудование компьютера должно соответствовать следующим требованиям:

  • 64-разрядный ЦП Intel или AMD Ryzen с преобразованием адресов второго уровня (SLAT).
  • ЦП должен поддерживать расширения режима мониторинга виртуальной машины (VT-c на процессорах Intel).
  • Не менее 4 ГБ памяти.

В BIOS компьютера необходимо включить следующие элементы:

  • Технология виртуализации (может иметь другое название в зависимости от производителя системной платы).
  • Предотвращение исполнения данных на основе оборудования.

Компьютер необходимо обновить до Windows 10, обновление за апрель 2018 г. (сборка 1803), или более поздней версии. Выполните следующие действия, чтобы проверить актуальность вашей версии Windows:

В поле поиска Windows введите Сведения.

В результатах поиска выберите Сведения о компьютере.

Прокрутите диалоговое окно Сведения до раздела Характеристики Windows.

Должна быть указана версия не ранее 1803:

Чтобы убедиться, что компьютерное оборудование и программное обеспечение совместимо с Hyper-V, откройте командную строку и введите следующую команду:

Если все указанные требования Hyper-V имеют значение Да, компьютер поддерживает Hyper-V. Пример:

Включение ускорения Hyper-V

Если ваш компьютер соответствует приведенным выше критериям, выполните следующие действия для ускорения эмулятора Android с помощью Hyper-V.

Введите компоненты windows в поле поиска Windows и выберите Включение и отключение компонентов Windows в результатах поиска. В диалоговом окне Компоненты Windows включите Hyper-V и платформу гипервизора Windows:

После внесения этих изменений перезагрузите компьютер.

В Windows 10 с обновлением за октябрь 2018 г. (RS5) и более поздних версий необходимо только включить Hyper-V, так как он будет автоматически использовать платформу гипервизора Windows (WHPX).

Установите Visual Studio 15.8 или более поздней версии (в этой версии Visual Studio интегрированная среда разработки поддерживает запуск эмулятора Android с Hyper-V).

Установите пакет Android Emulator версии 27.2.7 или более поздней. Чтобы установить этот пакет, выберите инструменты Android > пакет SDK для Android Manager в Visual Studio. Откройте вкладку Инструменты и убедитесь, что установлена версия эмулятора Android не ниже 27.2.7. Кроме того, убедитесь, что установлен компонент Android SDK Tools версии 26.1.1 или более поздней:

При создании виртуального устройства (см. раздел Управление виртуальными устройствами с помощью Android Device Manager) не забудьте выбрать образ системы на базе x86. Если вы используете образ системы на основе ARM, виртуальное устройство не ускорится и будет работать медленно.

Теперь технология Hyper-V должна быть включена, и вы можете запустить эмулятор Android с ускорением.

Ускорение с помощью HAXM

Если компьютер не поддерживает Hyper-V, используйте HAXM для ускорения эмулятора Android. Отключите отключить Device Guard, чтобы использовать HAXM.

Проверка поддержки HAXM

Чтобы определить, поддерживает ли оборудование HAXM, следуйте инструкциям из раздела Мой процессор поддерживает технологию виртуализации Intel?. Если оборудование поддерживает HAXM, проверьте, установлен ли HAXM:

Откройте окно командной строки и введите следующую информацию:

Посмотрите в выходных данных, запущен ли процесс HAXM. Если да, для состояния intelhaxm будет отображаться RUNNING . Пример:

Если STATE не имеет значение RUNNING , HAXM не установлен.

Если компьютер поддерживает HAXM, но он не установлен, установите его, выполнив действия, приведенные в следующем разделе.

Установка HAXM

Пакеты установки HAXM для Windows можно найти на странице выпусков GitHub, посвященной Intel Hardware Accelerated Execution Manager. Чтобы скачать и установить решение HAXM, выполните следующие действия:

Скачайте с веб-сайта Intel последнюю версию установщика подсистемы виртуализации HAXM для ОС Windows. Скачивая установщик HAXM с веб-сайта Intel, вы гарантированно получаете последнюю версию этой программы.

Откройте файл haxm-N.N.N-setup.exe (где N.N.N — это номер версии), чтобы запустить установщик HAXM. Примите значения по умолчанию, предлагаемые в диалоговых окнах установщика:

При создании виртуального устройства (см. раздел Управление виртуальными устройствами с помощью Android Device Manager) не забудьте выбрать образ системы на базе x86. Если вы используете образ системы на основе ARM, виртуальное устройство не ускорится и будет работать медленно.

Устранение неполадок

Сведения о решении проблем с аппаратным ускорением см. в руководстве по устранению неполадок для эмулятора Android.

Ускорение эмуляторов Android в macOS

Следующие технологии виртуализации доступны для ускорения эмулятора Android:

Платформа гипервизора Apple. Гипервизор входит в состав macOS 10.10 и более поздних версий и позволяет запускать виртуальные машины на компьютере Mac.

Intel Hardware Accelerated Execution Manager (HAXM) . HAXM — это механизм виртуализации для компьютеров на базе процессоров Intel.

Рекомендуется использовать платформу гипервизора для ускорения эмулятора Android. Если платформа гипервизора недоступна на компьютере Mac, можно использовать HAXM. Эмулятор Android автоматически использует аппаратное ускорение, если соблюдены следующие условия:

Аппаратное ускорение доступно и включено на компьютере разработчика.

Эмулятор работает с образом системы, созданным для виртуального устройства на платформе x86.

Вы не можете запускать эмулятор на базе ускоренной виртуальной машины внутри другой виртуальной машины, например под управлением VirtualBox, VMWare или Docker. Эмулятор Android следует запускать непосредственно на системном оборудовании.

Сведения о запуске и отладке с помощью эмулятора Android см. в статье Отладка в Android Emulator.

Ускорение с помощью платформы гипервизора

Для использования эмулятора Android с платформой гипервизора компьютер Mac должен соответствовать следующим критериям:

Mac должен работать под управлением macOS 10.10 или более поздней версии.

ЦП компьютера Mac должен поддерживать платформу гипервизора.

Если компьютер Mac соответствует этим критериям, Android Emulator будет автоматически использовать платформу гипервизора для ускорения. Если вы не уверены, поддерживает ли Mac платформу гипервизора, см. руководство Устранение неполадок, чтобы проверить это.

Если платформа гипервизора не поддерживается на компьютере Mac, используйте решение HAXM для ускорения эмулятора Android (описывается далее).

Ускорение с помощью HAXM

Если компьютер Mac не поддерживает платформу гипервизора (или ваша версия macOS ниже 10.10), используйте Intel Hardware Accelerated Execution Manager (HAXM) для ускорения эмулятора Android.

Прежде чем использовать эмулятор Android с HAXM в первый раз, рекомендуется проверить наличие установленного решения HAXM и его доступность для эмулятора Android.

Проверка поддержки HAXM

Проверьте, установлен ли HAXM:

Откройте терминал и введите следующую команду:

Эта команда предполагает, что пакет SDK для Android установлен в расположении по умолчанию

/Library/Developer/Xamarin/android-sdk-macosx; в противном случае измените этот путь для расположения пакета SDK для Android на Mac.

Если решение HAXM установлено, приведенная выше команда вернет подобный результат:

Если решение HAXM не установлено, возвращается следующее сообщение:

Если решение HAXM не установлено, установите его, выполнив действия, приведенные в следующем разделе.

Установка HAXM

Пакеты установки HAXM для macOS можно найти на странице Intel Hardware Accelerated Execution Manager. Чтобы скачать и установить решение HAXM, выполните следующие действия:

Скачайте с веб-сайта Intel последнюю версию установщика подсистемы виртуализации HAXM для ОС macOS.

Запустите установщик HAXM. Примите значения по умолчанию, предлагаемые в диалоговых окнах установщика:

Устранение неполадок

Сведения о решении проблем с аппаратным ускорением см. в руководстве по устранению неполадок для эмулятора Android.

Источник

Configure hardware acceleration for the Android Emulator

The Android Emulator can use hardware acceleration features to improve performance, sometimes drastically. This page describes how you can configure graphics and virtual machine (VM) acceleration to get higher performance from the emulator.

Configure graphics acceleration

Graphics acceleration uses your computer’s hardware (typically the GPU) to make screen rendering faster. Android devices use OpenGL for Embedded Systems (OpenGL ES or GLES) for rendering both 2D and 3D graphics on the screen.

When you create an Android Virtual Device (AVD) in the AVD Manager, you can specify whether the emulator should use hardware or software to emulate the GPU of the AVD. Hardware acceleration is recommended and is typically faster. However, you might need to use software acceleration if your computer uses graphics drivers that aren’t compatible with the emulator.

By default, the emulator decides whether to use hardware or software graphics acceleration based on your computer setup. If your GPU hardware and drivers are compatible, the emulator uses the GPU. Otherwise, the emulator uses software acceleration (using your computer’s CPU) to simulate GPU processing.

If you start the emulator from the command line, you can also override the graphics acceleration setting in the AVD for that virtual device instance.

Requirements

To use graphics acceleration, your development environment must meet the following requirements:

  • SDK Tools: Latest release recommended (version 17 minimum)
  • SDK Platform: Latest release recommended (Android 4.0.3, Revision 3, minimum)

Configure graphics acceleration in the AVD Manager

To configure graphics acceleration for an AVD, follow these steps:

  1. Open the AVD Manager.
  2. Create a new AVD or edit an existing AVD.
  3. On the Verify Configuration page, find the Emulated Performance section.
  4. Select a value for the Graphics: option.
  5. Click Finish.

Configure graphics acceleration from the command line

To specify a graphics acceleration type when you run an AVD from the command line, include the -gpu option, as shown in the following example:

The value of mode can be set to one of the following options:

  • auto : Let the emulator choose between hardware or software graphics acceleration based on your computer setup.
  • host : Use the GPU on your computer for hardware acceleration. This option typically provides the highest graphics quality and performance for the emulator. However, if your graphics drivers have issues rendering OpenGL, you might need to use the swiftshader_indirect or angle_indirect options.
  • swiftshader_indirect : Use a Quick Boot-compatible variant of SwiftShader to render graphics using software acceleration. This option is a good alternative to host mode if your computer can’t use hardware acceleration.
  • angle_indirect : (Windows only) Use a Quick Boot-compatible variant of ANGLE Direct3D to render graphics using software acceleration. This option is a good alternative to host mode if your computer can’t use hardware acceleration. In most cases, ANGLE performance should be similar to using host mode because ANGLE uses Microsoft DirectX instead of OpenGL. On Windows, Microsoft DirectX drivers typically have fewer issues than OpenGL drivers. This option uses Direct3D 11 and requires Windows 10, Windows 8.1, or Windows 7 SP1 with the Windows 7 Platform Update.
  • guest : Use guest-side software rendering. This option provides the lowest graphics quality and performance for the emulator.

Note: If you enable a graphics acceleration option that your computer doesn’t support, you are likely to see incorrect images displayed during emulation.

The following mode options are deprecated:

  • swiftshader : Deprecated in version 27.0.2 Use swiftshader_indirect instead.
  • angle : Deprecated in version 27.0.2. Use angle_indirect instead (Windows only).
  • mesa : Deprecated in version 25.3. Use swiftshader_indirect instead.

Enable Skia rendering for Android UI

When using images for API level 27 or higher, the emulator can render the Android UI with Skia. Skia helps the emulator render graphics more smoothly and efficiently.

To enable Skia rendering, use the following commands in adb shell:

Configuring VM acceleration

VM acceleration uses your computer’s processor to significantly improve the execution speed of the emulator. A tool called a hypervisor manages this interaction using virtualization extensions that your computer’s processor provides. This section outlines the requirements for using VM acceleration and describes how to set up VM acceleration on each operating system.

General requirements

To use VM acceleration with the emulator, your computer must meet the general requirements in this section. Your computer also needs to meet other requirements that are specific to your operating system.

Development environment requirements

To use VM acceleration, your development environment must meet the following requirements:

Virtualization extension requirements

In addition to the development environment requirements, your computer’s processor must support one of the following virtualization extensions technologies:

  • Intel Virtualization Technology (VT, VT-x, vmx) extensions
  • AMD Virtualization (AMD-V, SVM) extensions

Most modern processors support these virtualization extensions. If you’re not sure whether your processor supports these extensions, check the specifications for your processor on the manufacturer’s site. If your processor doesn’t support one of these extensions, then you can’t use VM acceleration.

Restrictions

VM acceleration has the following restrictions:

  • You can’t run a VM-accelerated emulator inside another VM, such as a VM hosted by VirtualBox, VMWare, or Docker. You must run a VM-accelerated emulator directly on your host computer.
  • Depending on your operating system and hypervisor, you can’t run software that uses another virtualization technology at the same time that you run a VM-accelerated emulator. For example, VirtualBox, VMWare, and Docker currently use a different virtualization technology, so you can’t run them at the same time as the accelerated emulator.

About hypervisors

VM acceleration requires a hypervisor.

Without a hypervisor and VM acceleration, the emulator must translate the machine code from the VM block by block to conform to the architecture of the host computer. This process can be quite slow. With a hypervisor, the VM and the architecture of the host computer match, so the emulator can run code directly on the host processor using the hypervisor. This improvement drastically increases both the speed and performance of the emulator.

The hypervisor that will work best for you depends on your computer’s operating system and configuration. For more information, see one of the following sections:

Check if a hypervisor is installed

You can use the emulator -accel-check command-line option to check if a hypervisor is currently installed on your computer.

The following examples show how to use the emulator accel-check option. In each example, Sdk is the location of the Android SDK:

Configure VM acceleration on Windows

VM acceleration on Windows can use one of three hypervisors: the Intel Hardware Accelerated Execution Manager (HAXM), the Android Emulator Hypervisor Driver for AMD Processors or the Windows Hypervisor Platform (WHPX).

Choose a hypervisor on Windows

Use the following criteria to determine which hypervisor you should use:

Criteria Hypervisor
You have an Intel processor and do not need to run Hyper-V at the same time as the Android Emulator. Use Intel HAXM.
You have an Intel processor and do need to run Hyper-V at the same time as the Android Emulator. Use WHPX.
You have an AMD processor and do not need to run Hyper-V at the same time as the Android Emulator. Use Android Emulator Hypervisor Driver for AMD Processors.
You have an AMD processor and do need to run Hyper-V at the same time as the Android Emulator. Use WHPX.

Double-check when disabling Hyper-V

Hyper-V must be disabled to use Intel HAXM or the Android Emulator Hypervisor Driver for AMD Processors. However, unchecking «Hyper-V» in Windows Features Dialog might not guarantee that Hyper-V is disabled. Quite a few features in Windows 10 will enable Hyper-V implicitly. Users may not even know Hyper-V is activated when they enable one of these features.

To our best knowledge, these includes Virtual Machine Platform, Windows Hypervisor Platform, Windows Sandbox, Core Isolation, Credential Guard. Additionally, Windows Subsystem for Linux version 2 requires Virtual Machine Platform, meaning that it implicitly requires Hyper-V. This list is not exhaustive, please notify us on our bug tracker if you find an item that should be included here.

Double-check that the features listed above are also disabled when disabling Hyper-V. Reference Microsoft documentation and the examples below to find out how each individual feature can be disabled.

Some platforms fail to immediately disable Hyper-V when it is switched off. When this occurs, there is no error returned by the Windows OS and Hyper-V appears disabled in the Windows Features Dialog. Please file a bug on Microsoft’s issue tracker when this occurs.

Configure VM acceleration using Intel HAXM on Windows

Before you can install and use Intel HAXM, your computer must meet the following requirements:

  • Intel processor with Virtualization Technology (VT-x), Intel EM64T (Intel 64) features, and Execute Disable (XD) Bit functionality enabled
  • 64-bit Windows 10, Windows 8, or Windows 7 (or 32-bit version of the operating system on a 64-bit processor)
  • To use Intel HAXM on Windows 10 or 8, you must turn off Hyper-V in the Windows Features Dialog.
    Note: Installing certain software might turn Hyper-V back on. Refer to Disabling Hyper-V for more details.

To install the Intel HAXM driver, follow these steps:

  1. Open the SDK Manager.
  2. Click the SDK Update Sites tab and then select Intel HAXM.
  3. Click OK.
  4. After the download finishes, run the installer. Typically, you can find the installer in the following location: sdk \extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe
  5. Use the wizard to complete the installation.

After installing Intel HAXM, confirm that the virtualization driver is operating correctly by entering the following command in a Command Prompt window:

You should see a status message that includes the following information:

You can adjust the amount of memory available to the Intel HAXM kernel extension by running the installer again.

You can uninstall Intel HAXM using either the installer or the Windows Control Panel. Before you uninstall Intel HAXM, shut down any x86 emulators that are currently running.

Configure VM acceleration using Android Emulator Hypervisor Driver for AMD Processors on Windows

Before you can install and use the Android Emulator Hypervisor Driver for AMD Processors, your computer must meet the following requirements:

  • AMD processor with Secure Virtual Machine (SVM) Technology
  • 64-bit Windows 10, Windows 8, or Windows 7 (32-bit Windows is not supported)
  • To use Android Emulator Hypervisor Driver for AMD Processors on Windows 10 or 8, you must turn off Hyper-V in the Windows Feaures Dialog.
    Note: Installing certain software might turn Hyper-V back on. Refer to Disabling Hyper-V for more details.

The Android Emulator Hypervisor Driver for AMD Processors can be installed via the SDK Manager in Android Studio 4.0 Canary 5 or later, or from Github (see below). To install from the SDK Manager, follow these steps:

  1. Open Tools->SDK Manager.
  2. Click the SDK Tools tab and then select Android Emulator Hypervisor Driver for AMD Processors.
  3. Click OK to download and install the Android Emulator Hypervisor Driver for AMD processors.

After installation, confirm that the driver is operating correctly by entering the following command in a Command Prompt window:

You should see a status message that includes the following information:

The following error message means either that SVM is not enabled in your BIOS or that Hyper-V is not disabled (Refer to Disable Hyper-V).

The Android Emulator Hypervisor Driver for AMD Processors can also be downloaded and installed from github. After unpacking the driver package, run «silent_install.bat» in a Command Prompt with Administrator privileges. Successfully completing a new installation would have the following output:

Upgrading an installation would result in the following output, which includes messages regarding the old driver’s uninstallation:

You can uninstall Android Emulator Hypervisor Driver for AMD Processors using the following commands in a Command Prompt with Administrator privileges.

Note: Shut down any x86 emulators before uninstalling the Android Emulator Hypervisor Driver for AMD Processors.

Configure VM acceleration using Windows Hypervisor Platform

Before you can enable WHPX, your computer must meet the following requirements:

  • Intel processors: Support for Virtualization Technology (VT-x), Extended Page Tables (EPT), and Unrestricted Guest (UG) features. VT-x must be enabled in your computer’s BIOS settings.
  • AMD processors: AMD Ryzen processor recommended. Virtualization or SVM must be enabled in your computer’s BIOS settings.
  • Android Studio 3.2 Beta 1 or higher (download from developer.android.com)
  • Android Emulator version 27.3.8 or higher (download using the SDK Manager)
  • Windows 10 with April 2018 Update or higher

To install WHPX on Windows, follow these steps:

  1. From the Windows desktop, right-click the Windows icon and select Apps and features.
  2. Under Related settings, click Programs and Features.
  3. Click Turns Windows Features on or off.

Select Windows Hypervisor Platform

Click OK.

Once the installation has finished, restart your computer.

Configure VM acceleration on macOS

On Mac OS X v10.10 Yosemite and higher, the Android Emulator uses the built-in Hypervisor.Framework by default, and falls back to using Intel HAXM if Hypervisor.Framework fails to initialize.

To use VM acceleration on macOS when the Hypervisor.Framework is not available, you must install the Intel HAXM kernel extension.

To install the Intel HAXM kernel extension, follow these steps:

  1. Open the SDK Manager.
  2. Click the SDK Update Sites tab and then select Intel HAXM.
  3. Click OK.
  4. After the download finishes, run the installer. Typically, you can find the installer in the following location: sdk /extras/intel/Hardware_Accelerated_ExecutionManager/IntelHAXM version .dmg
  5. Follow the on-screen instructions to complete the installation.

After installation finishes, confirm that the new kernel extension is operating correctly by opening a terminal window and running the following command:

You should see a status message containing the following extension name, indicating that the kernel extension is loaded:

You can adjust the amount of memory available to the Intel HAXM kernel extension by running the installer again.

You can stop using the Intel HAXM kernel extension by uninstalling it. Before you uninstall it, shut down any x86 emulators that are currently running, then run the following command in a terminal window:

Configure VM acceleration on Linux

Linux-based systems support VM acceleration through the KVM software package. Follow the instructions for installing KVM on your Linux system, and verify that KVM is enabled. For Ubuntu systems, see Ubuntu KVM Installation.

Requirements

Running KVM requires specific user permissions. Make sure that you have sufficient permissions as specified in the KVM installation instructions.

To use VM acceleration on Linux, your computer must also meet these requirements:

  • For Intel processors: Support for Virtualization Technology (VT-x), Intel EM64T (Intel 64) features, and Execute Disable (XD) Bit functionality enabled.
  • For AMD processors: Support for AMD Virtualization (AMD-V).

Check whether KVM is currently installed on Linux

You can use the emulator -accel-check command-line option to check whether you have KVM installed. Alternatively, you can install the cpu-checker package containing the kvm-ok command.

The following example shows how to use the kvm-ok command.

Install the cpu-checker package:

An output of 1 or greater means that virtualization is supported. An output of 0 means that your CPU doesn’t support hardware virtualization.

Run the kvm-ok command:

Expected output: INFO: /dev/kvm exists KVM acceleration can be used

If you get the following error, it means that you can still run virtual machines. Your virtual machine will be slower without the KVM extensions. INFO: Your CPU does not support KVM extensions KVM acceleration can NOT be used

Install KVM on Linux

Use the following command to install KVM:

Cosmic (18.10) or later

Lucid (10.04) or later

Karmic (9.10) or earlier

Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.

Источник

Читайте также:  Сбросить настройки до заводских android лджи
Оцените статью