Big Tech FOSS

Meta ports Android Cuttlefish emulator to macOS Apple Silicon with QEMU revival

Key Takeaway

Meta revived QEMU support in AOSP's Cuttlefish virtual-device framework to enable native high-fidelity Android emulation on Apple Silicon Macs, eliminating the need to maintain parallel Goldfish and Cuttlefish platforms.

Summary

Meta's Reality Labs has completed a native port of Cuttlefish, the Android Open Source Project's high-fidelity virtual-device framework, to macOS on Apple Silicon. The company previously maintained two separate emulator stacks: Goldfish, which ran everywhere but offered lower fidelity, and Cuttlefish, which accurately reproduced physical device behavior but was Linux-only. This fragmentation forced developers to choose emulators based on their workstation rather than their testing needs, and duplicated engineering effort across infrastructure, tooling, and CI pipelines.

The port required reviving QEMU as Cuttlefish's VMM after crosvm proved unsuitable for macOS, then solving three core gaps: making vhost-user virtio device backends build and run outside Linux, expanding QEMU's HVF memory-region tracking to handle larger configurations, and adding native Cocoa display support with BGRA rendering and touch translation. Meta also implemented Darwin build support, arm64 toolchain fixes, and the JIT entitlements required for Apple's code-signing and notarization. The unified platform now supports Bluetooth, Wi-Fi, cellular, 3D graphics, OTA updates, fastboot, and snapshotting for both internal and external developers.

QEMU revival and macOS hypervisor integration

  • vhost-user portability: The libvhost-user library and contrib backends including vhost-user-blk were gated to Linux builds; Meta relaxed these restrictions so virtio device backends can communicate with QEMU over sockets on macOS, preserving Cuttlefish's higher-fidelity device model.
  • HVF memory-region expansion: QEMU's Hypervisor.framework backend on Apple Silicon tracked insufficient memory regions for larger Cuttlefish configurations; Meta increased the tracking-slot count to accommodate these workloads.
  • Native Cocoa display path: Replaced WebRTC-dependent display with QEMU's Cocoa backend, adding BGRA pixel format support for artifact-free rendering, mouse-click-to-touch translation for touchscreen interaction, and a -g geometry flag for graphic_console_init.
  • Rutabaga graphics ABI alignment: Enabled unstable Rutabaga structs to match the Rust-side graphics ABI used in gfxstream and rutabaga configurations for GPU acceleration.
  • Build and signing infrastructure: Added Darwin build support, arm64 macOS toolchain fixes, JIT entitlement handling, and code-signing/notarization paths; Cuttlefish's orchestration layer was modified to recognize macOS as a valid host platform.

Why it matters

This work upstreams significant cross-platform improvements to QEMU and AOSP's Cuttlefish, reducing the barrier for Android platform developers on macOS to contribute without maintaining Linux workstations or accepting Goldfish's lower fidelity. For the broader open-source ecosystem, the vhost-user and HVF changes strengthen QEMU's portability on Apple Silicon, benefiting other projects that rely on virtio device passthrough or macOS virtualization.

Original reference: engineering.fb.com →