This document describes how to set up and run the Fuchsia emulator (FEMU), including networking and GPU support setup.
To run FEMU, you must have:
Before you can use FEMU, you need to build Fuchsia using fx set
,
specifying a qemu board and supported product. This example uses
qemu-x64
for the board and workstation
for the product:
fx set workstation.qemu-x64 --release [--with=...]
fx build
Note: More information on supported boards and products is in the Fuchsia emulator overview.
For Fuchsia's ephemeral software to work with FEMU, you need to configure an IPv6 network.
To enable networking in FEMU using tap networking, run the following commands:
sudo ip tuntap add dev qemu mode tap user $USER
sudo ip link set qemu up
User Networking (SLIRP){: .external} is the default networking set up for FEMU on macOS. This networking set up does not support Fuchsia device discovery.
The most common way to run FEMU is with networking enabled, using the following commands.
To support device discovery without access to external networks.
fx vdl start -N
To get access to external networks:
{% dynamic if user.is_googler %}
Note: Command will differ depending on the type of machines you use.
-
{Corp}
To use FEMU on a corp machine, see go/fuchsia-emulator-corp.
-
{Non-Corp}
Note:
FUCHSIA_ROOT
is the path to the Fuchsia checkout on your local machine (ex:~/fuchsia
).fx vdl start -N -u {{ '<var>' }}FUCHSIA_ROOT{{ '</var>' }}/scripts/start-unsecure-internet.sh
{% dynamic else %}
Note: FUCHSIA_ROOT
is the path to the Fuchsia checkout on your local machine (ex: ~/fuchsia
).
fx vdl start -N -u {{ '<var>' }}FUCHSIA_ROOT{{ '</var>' }}/scripts/start-unsecure-internet.sh
{% dynamic endif %}
Once you run the command, a separate window opens with the title "Fuchsia Emulator". After the Fuchsia emulator launches successfully, the terminal starts with the SSH console. You can run shell commands in this window, just like you would on a Fuchsia device.
On macOS, Fuchsia device discovery does not work. However, you can still use fx
tools such as fx ssh
.
fx vdl start
From the output, take note of the instruction on running fx set-device
, you will need it for the steps below.
Note: When you launch FEMU for the first time on your Mac machine after starting up (ex: after a reboot), a window pops up asking if you want to allow the process “aemu” to run on your machine. Click “allow”.
Run fx set-device
to specify the launched Fuchsia emulator SSH port. For SSH_PORT
, use the value that the fx vdl start --host-gpu
command outputted.
fx set-device 127.0.0.1:{{ '<var>' }}SSH_PORT{{ '</var>' }}
By default FEMU uses multi-touch input. You can add the argument --pointing-device mouse
for mouse cursor input instead.
fx vdl start --pointing-device mouse
If you don't need graphics or working under the remote workflow, you can run FEMU in headless mode:
fx vdl start --headless
By default, FEMU launcher uses software rendering using SwiftShader.
To force FEMU to use a specific graphics emulation method, use the parameters --host-gpu
or --software-gpu
to the fx vdl start
command.
These are the valid commands and options:
GPU Emulation method | Explanation | fx vdl start flag |
---|---|---|
Hardware (host GPU) | Uses the host machine’s GPU directly to perform GPU processing. | fx vdl start --host-gpu |
Software (host CPU) | Uses the host machine’s CPU to simulate GPU processing. | fx vdl start --software-gpu |
FEMU currently supports a limited set of GPUs on macOS and Linux for hardware graphics acceleration. FEMU uses a software renderer fallback for unsupported GPUs.
Operating System | GPU Manufacturer | OS / Driver Version |
---|---|---|
Linux | Nvidia Quadro | Nvidia Linux Drivers 440.100+ |
macOS | Intel HD Graphics | macOS version 10.15+ |
macOS | AMD Radeon Pro | macOS version 10.15+ |
To exit FEMU, run dm poweroff
in the FEMU terminal.
- To learn more about how FEMU works, see the Fuchsia emulator (FEMU) overview.
- To learn more about Fuchsia device commands and Fuchsia workflows, see Explore Fuchsia.