VS Code + DevContainer

Here’s a guide for using Visual Studio Code (VS Code) to develop with Yocto in a containerized environment. If your host is already a Yocto-supported Linux distribution, you can also build natively — see Native Build Environment.

Linux distribution

When using a containerized environment for building yocto, the host does not have to be a Yocto-supported distro.

Requirements

Setup

1. Check out the BSP as described in the BSP Setup page.

2. Open the cloned BSP repository with VS Code.

The Wrynose BSP ships its own .devcontainer configuration (Dockerfile and devcontainer.json), so VS Code should directly prompt you to reopen the current directory in a Container.

3. In VS Code reopen the folder in a Container. If not prompted, search for Dev Container: Reopen in Container command using strg + shift + P.

Shared Yocto files

The dev container uses a shared docker volume (yocto-shared-wrynose) for Yocto downloads (DL_DIR) and the sstate-cache, so they are reused across builds and containers.


The container is set up automatically to be able to build Yocto. Key aspects include:

  • Supported Linux distribution for building with Yocto (Ubuntu 24.04)

  • bitbake-setup preinstalled

  • uuu (NXP’s USB flashing tool) preinstalled

  • Shared Yocto downloads and sstate-cache in a docker volume

4. Open a terminal in the container and run the interactive setup as described on the Building Images page:

bitbake-setup init

5. (Optional) Install the recommended Yocto Project BitBake extension and open the bitbake.code-workspace file generated in your setup directory under bitbake-builds. The extension provides a GUI to manage, build and develop recipes.

A devtool workspace can be created to directly edit a recipe’s source and also create patches automatically. For more information on how to use the Yocto Project Extension see Yocto Project BitBake.