Fuchsia emulator (FEMU)

The Fuchsia emulator (FEMU) allows you to test Fuchsia components and applications without needing a Fuchsia device. FEMU is included in Fuchsia source, and it’s downloaded by jiri as part of jiri update or jiri run-hooks. It’s fetched into the Fuchsia directory /prebuilt/third_party/aemu.

You can call FEMU with fx using fx vdl. Alternatively, you can call FEMU from the Fuchsia IDK using fvdl.

FEMU and other emulators

FEMU is the default emulator for Fuchsia. FEMU is based on the Android Emulator (AEMU), which is a fork of QEMU. Due to legacy issues, there may be references to AEMU in the code and documentation.

In some instances, such as emulating Zircon, you must use QEMU instead.

FEMU Features

FEMU looks and behaves like a Fuchsia device, with the exception that no paving is required.

FEMU features include:

  • GUI Support: You can run Fuchsia with the GUI (by default) or without the GUI (using the --headless argument).
  • GPU Support: You can run with the host’s GPU (by default) with full Vulkan support, or you can choose software rendering using SwiftShader.
  • Remote Development: You can use a remote desktop with FEMU, either with Chrome Remote Desktop or from the command line using fx emu-remote command.

To see full list of supported flags:

fx vdl start --help

To configure these features, see the Set up and start FEMU page.

If you’re using the Fuchsia IDK, fvdl supports the same flags as fx vdl

FEMU limitations

FEMU image and board support

When setting up FEMU using fx set, FEMU only supports the following boards:

  • qemu-x64
  • qemu-arm64

When using the Fuchsia IDK to set up FEMU, you are limited to the following pre-built images:

  • qemu-x64
  • workstation.qemu-x64-release
  • qemu-arm64

Note: ARM64 support (qemu-arm64) is very limited and not recommended.

FEMU networking

On Linux, Fuchsia Emulator should generally be run with the -N flag that provides networking through an emulated NIC. Instructions for setting up networking for FEMU is in Setting up the Fuchsia Emulator.

Note: Without -N, your emulator won't be discoverable using fx list-devices. However, you can manually set the SSH address and use fx tools to interact with your emulator.

If starting the emulator without -N (i.e fx vdl start), an available TCP port from the host will be picked and forwarded to the emulator's SSH port. When the emulator launches successfully, instruction to set fx tools with the correct SSH port are printed in the terminal output. Then, you can manually set the SSH device:

fx set-device{{ '<var>' }}SSH_PORT{{ '</var>' }}

To verify fx is using the correct port:

fx status

You should see the SSH address printed next to Device name. To SSH into the emulator:

fx ssh

Emulating Zircon

If you only want to emulate Zircon, you must use fx qemu instead. Read Debugging the Kernel using QEMU to learn more. This is for kernel developers. Most Fuchsia developers do not need to use this workflow.

FEMU common usage

To use FEMU, you must first download the Fuchsia source and build Fuchsia.

Alternatively, you can use the Fuchsia IDK and use pre-built system images.

Then you can use FEMU to do the following: