Choose MACHINE, DISTRO and Image Targets in Yocto
MACHINE picks the hardware, DISTRO picks the policy and the image recipe picks the contents. Here is how to choose and change each one.

Every Yocto build is the product of three independent choices, and mixing them up is the commonest source of confusion in the first week. You choose the hardware you are building for, the policy the system follows, and the set of software that goes into the image. They sit in three different places, they are changed in three different ways, and they combine freely. This post names the three, shows where each is set, explains how to list what is available, and walks through changing each one on a Scarthgap 5.0 LTS tree. It assumes you have a build directory from the first-build post.
The three choices
| Choice | Variable or argument | Answers the question | Defined in |
|---|---|---|---|
| Machine | MACHINE | Which hardware, CPU and kernel? | conf/machine/<name>.conf in a layer |
| Distribution | DISTRO | Which policy: libc, init system, features, flags? | conf/distro/<name>.conf in a layer |
| Image | the bitbake target | Which packages end up on the root filesystem? | an image recipe, <name>.bb |
Think of it as a shopping list with three lines. The machine decides how the system is compiled and which kernel and bootloader it needs. The distribution decides how software is configured across the whole system. The image decides which software is present. Changing one does not require changing the others, though some combinations make no sense, for example a graphical image on a machine without a display.
MACHINE: the hardware
A machine configuration describes a board or an architecture: the tuning flags for the compiler (DEFAULTTUNE), the kernel recipe to use (PREFERRED_PROVIDER_virtual/kernel), the bootloader, the serial console, and the types of image files to produce. Poky's own layers give you the QEMU machines such as qemux86-64, qemuarm64 and qemuriscv64, and a few reference boards in meta-yocto-bsp. Real boards come from board support package layers supplied by the vendor or the community.
To see which machines your layers offer, list the machine configuration files:
ls ../meta*/conf/machine/*.conf | xargs -n1 basename | sed 's/.conf$//'beaglebone-yocto
genericarm64
genericx86
genericx86-64
qemuarm
qemuarm64
qemuarmv5
qemumips
qemumips64
qemuppc
qemuppc64
qemuriscv32
qemuriscv64
qemux86
qemux86-64The exact list depends on your release and the layers you have added, and some of these may be in a different folder name. Run it against your own tree. The command works because machine files are plain <name>.conf files below a conf/machine/ directory in each layer.
Set the machine in conf/local.conf:
MACHINE = "qemuarm64"Because the sample file sets MACHINE ??=, a plain = replaces it. You can also set it for a single invocation through the environment, without editing any file:
MACHINE=qemuarm64 bitbake core-image-minimalThat only works because MACHINE is passed through BB_ENV_PASSTHROUGH_ADDITIONS, a list of variables BitBake allows from the shell environment. Variables outside that list, such as an arbitrary one you invent, are ignored when exported from the shell. If you use this method, remember it is easy to forget which machine a build directory last built.
Each machine gets its own output directory, tmp/deploy/images/<machine>/, but all machines in one build directory share TMPDIR. Switching back and forth reuses the shared state cache, and the architecture-specific packages are stored under separate paths in tmp/work, so you can switch without a clean build.
DISTRO: the policy
A distribution configuration is a file in conf/distro/ that sets system-wide policy: which C library, which init system, which package format, the compiler options, and the default features. The Poky distribution is poky, set by DISTRO ?= "poky". Others you may meet are poky-tiny, a very small policy, poky-altcfg, which uses a different set of defaults, and distributions from other layers such as Arago or your own.
The value of DISTRO also gives the build its name in the banner and os-release. To use systemd instead of BusyBox init, you set features in the distribution, not in the image:
DISTRO_FEATURES:append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"Those four lines are the documented recipe for switching a Poky build to systemd, and the init post later in this series covers it end to end. They are an example of policy: they apply to every recipe and every image in the build. The colon form (:append) is the override syntax used since Honister; older posts show DISTRO_FEATURES_append, which no longer works on Scarthgap.
Changing DISTRO recompiles most things, because the policy is part of every recipe's task signature. Expect a long build after a distribution change, though the cache will return anything unaffected.
The image target: the contents
An image recipe is a .bb file that names the packages to install. You choose it by naming it on the command line. The images Poky ships under meta/recipes-core/images/ and meta/recipes-extended/images/ include:
| Image | What it holds |
|---|---|
core-image-minimal | A console boot with BusyBox and little else |
core-image-full-cmdline | A console system with common command-line tools and a full set of utilities |
core-image-base | A console image with support for hardware features listed in MACHINE_FEATURES |
core-image-sato | A graphical image with a mobile-style desktop |
core-image-weston | A Wayland compositor image |
List the image recipes in your layers with:
bitbake-layers show-recipes "*image*"NOTE: Starting bitbake server...
=== Matching recipes: ===
core-image-base:
meta 1.0
core-image-full-cmdline:
meta 1.0
core-image-minimal:
meta 1.0
core-image-sato:
meta 1.0Your output will list more, because the wildcard matches many names, and the layer name and version column depend on your tree. To use any of them, name it:
bitbake core-image-full-cmdlineYou can build several images in one invocation, and you can add packages to any image without writing a recipe by using IMAGE_INSTALL:append in local.conf, though a custom image recipe is the clean answer for anything you will keep. The dedicated custom-image post covers that.
How the three interact
A few rules explain most surprises.
The image does not choose the machine, but the machine can restrict the image.
MACHINE_FEATURESlists what the hardware offers, and an image feature such aswifiis installed only if the matching machine feature exists. That is whycore-image-basediffers between machines.The distribution can restrict recipes. A recipe may declare that it needs a distribution feature (
REQUIRED_DISTRO_FEATURES), and if the feature is missing it is skipped with a message that mentions it.The same recipes produce different binaries for different machines and distributions, because both enter the task hash. They do not share outputs unless the relevant variables match.
A common mistake is to try to solve a policy question inside the image, such as removing systemd from one image while the distribution still enables it. Decide first whether the choice is about the hardware, the policy, or the contents.
A worked change
Starting from the defaults, switch to an Arm 64-bit QEMU machine and a command-line image with SSH, leaving the distribution alone. In conf/local.conf:
MACHINE = "qemuarm64"
EXTRA_IMAGE_FEATURES += "ssh-server-dropbear"Then build and boot:
bitbake core-image-full-cmdline
runqemu qemuarm64 nographic slirpPoky (Yocto Project Reference Distro) 5.0.5 qemuarm64 ttyAMA0
qemuarm64 login:The console device name ttyAMA0 reflects the emulated Arm board's UART, where the x86 machine used ttyS0. That difference comes from the machine configuration, not from the image or the distribution, which is a neat confirmation that you changed the right layer of the choice.


