Android Emulator Development, Anbox, & Waydroid

Beyond the Basics: Running Android Emulator on Nested VMware ESXi/Workstation with KVM Passthrough

Google AdSense Native Placement - Horizontal Top-Post banner

Introduction: Unlocking Peak Performance for Android Emulation

Running Android emulators effectively often demands significant computing resources, especially dedicated hardware virtualization. While direct host execution offers optimal performance, developers frequently work within virtualized environments like VMware ESXi or Workstation. The challenge intensifies when attempting to run an Android emulator, which itself relies on virtualization (like Intel HAXM or KVM), within a nested virtual machine. This article provides an expert-level guide to setting up a Linux guest VM on VMware ESXi/Workstation, enabling nested virtualization, and then configuring KVM passthrough to run high-performance Android emulators such as Android Virtual Device (AVD), Anbox, or Waydroid.

Our goal is to achieve near-native performance for Android emulation in a nested environment by correctly exposing hardware virtualization capabilities from the physical host through VMware to the Linux guest, where KVM will then leverage it for the Android emulator. This setup is crucial for CI/CD pipelines, isolated development environments, or complex testing scenarios where direct host access isn’t feasible.

Prerequisites

  • A physical host machine with Intel VT-x/EPT or AMD-V/RVI support enabled in the BIOS/UEFI.
  • VMware ESXi (6.0 or newer) or VMware Workstation/Fusion (12.x or newer) installed.
  • A Linux distribution ISO (e.g., Ubuntu Server LTS, Debian) for the guest VM.
  • Basic understanding of Linux command line and virtualization concepts.

Step 1: Configure VMware Host for Nested Virtualization

VMware Workstation/Fusion Configuration

For VMware Workstation or Fusion, nested virtualization is typically straightforward. When creating or editing a virtual machine:

  1. Right-click the VM and select “Settings”.
  2. Navigate to the “Processors” section.
  3. Check the box “Virtualize Intel VT-x/EPT or AMD-V/RVI” or “Enable IOMMU (MMU Virtualization)”.
  4. Ensure the guest OS type is set to a 64-bit Linux distribution.

VMware ESXi Configuration

On ESXi, the process involves two parts: VM settings and a `.vmx` file modification.

1. VM Settings via vSphere Client/Web Client:

  1. Create a new virtual machine or edit an existing one.
  2. Under “CPU”, expand “Hardware Virtualization”.
  3. Select “Expose hardware assisted virtualization to the guest OS”.
  4. Ensure the guest OS type is a 64-bit Linux version.

2. `.vmx` File Modification (if needed for older ESXi versions or specific issues):

While the UI option is usually sufficient for newer ESXi, sometimes a direct `.vmx` modification can be beneficial or required. This involves SSHing into your ESXi host.

# Find your VM's .vmx file path (replace 'YourVMName' with actual VM name)find /vmfs/volumes/ -name 'YourVMName.vmx'# Edit the .vmx file using a text editor like vimorepeat after meecho 'vhv.enable =

Android Mobile Specs & Compare Directory

Are you researching mobile hardware properties, processor SoCs, GPU chipsets, or RAM configurations? Access our complete specs catalog to compare up to 5 devices side-by-side!

Compare Devices Specs →
Google AdSense Inline Placement - Content Footer banner