<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Zephyr Development Environment for Students</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Johannes Witzig</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Flavio Felder</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vixay Phimmasane</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Simon Künzli</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andreas Rüst</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>1Institute of Embedded Systems, Zurich University of Applied Sciences</institution>
          ,
          <addr-line>8401 Winterthur</addr-line>
          ,
          <country country="CH">Switzerland</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2026</year>
      </pub-date>
      <abstract>
        <p>The Institute of Embedded Systems at the Zurich University of Applied Sciences uses Zephyr both in research projects and for several lab exercises for BSc, MSc, and students in continuing education. These labs include topics like embedded security, bootloaders, and general operating system concepts. In this paper, we discuss the challenge of providing a uniform Zephyr development environment that can be set up quickly and reliably. At the Institute of Embedded Systems (InES), as an institute at a university of applied sciences, we have two main areas of activity. On the one hand, we teach in programs for undergraduates (bachelor's) and graduates (master's) and in continuing education. On the other hand, we work in research projects that are either publicly funded or funded by industry partners. Teaching about Real-time operating systems and their use is an essential topic in our electrical engineering, computer science, and systems engineering curricula. Zephyr is ideally suited for this purpose as it is open source, has momentum, and includes various communication stacks that enable the creation of small student projects with reasonable efort. In research projects, we need our firmware to support many diferent microcontrollers, transceivers, and sensors. At our institute, we have been working with Zephyr since version 1.14 (2019). After a first successful evaluation of the RTOS in a Master's thesis, we started using it in research projects of various kinds [1], [2] . At the same time, we have started introducing Zephyr into classes through lecture content, laboratories, and student projects like Bachelor's theses. As the students only work with Zephyr for a few hours, the efort of setting up a native Zephyr development environment on all the students' laptops seemed too high. In order to lower this efort for students to get a working Zephyr development environment, we discussed options. Initially, we used a standard Ubuntu desktop virtual machine (VM) to provide a development environment to the students. After testing this VM for one semester, we identified the following problems: • Not reproducible • Time-consuming to set up and maintain • Large (≈ 10 GiB) • Uses a lot of resources (storage, RAM, CPU) • Forces students to work inside the VM • File sharing is unreliable • Prompts the user to install updates Setting up a new VM is manual, time-consuming labor, and each time it is repeated, the output will be slightly diferent.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;container</kwd>
        <kwd>development environment</kwd>
        <kwd>education</kwd>
        <kwd>WSL</kwd>
        <kwd>Zephyr</kwd>
        <kwd>ZHAW</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>The student’s feedback for the VM solution revealed that the large size of the VM was especially
problematic. Some students first had to free up space on their storage drives prior to the installation.
Furthermore, VirtualBox’s integrated file sharing feature proved to be unreliable.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Novelty of This Work</title>
      <p>When using Zephyr in lab exercises, we need a way for the students to create, compile, and flash
Zephyr applications. As time in the laboratories is limited, typically two hours per topic, we want the
students to focus on the task instead of setting up their development environment. In other words,
we try to maximize the time students spend on the laboratory’s content while minimizing the time
spent debugging the development environment. Zephyr is new for the students; every student has a
diferent setup on their laptop. Additionally, the laboratory supervisors must be able to provide help
eficiently. We therefore seek an environment that has the following properties.</p>
      <p>
        • Uniform
• Reproducible
• Easy to set up and use
• Easy to maintain
• Works on Windows, macOS, and Linux (aarch64 and x86_64)
The solution that we have now arrived at is based on a container. Students who use macOS or a Linux
distribution can run the container using a container engine like Podman [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], while Windows users can
use the container image as a WSL2 distro  [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Compared to the VM, the container has the following
notable advantages.
      </p>
      <p>
        • Suficiently reproducible
• Lean resource usage
• Small (≈ 2 GiB / ≈ 0.5 GiB compressed)1
• Reliable file sharing
• Students can use their familiar editor to work on the assignments
We are aware that there is an oficial Zephyr developer container image  [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. However, this image
contains things we do not need and is therefore a lot larger (≈ 20 GiB).
      </p>
      <p>
        One inconvenience that we still face is that WSL2 does not provide access to USB devices by default.
This, for example, prevents us from flashing the firmware to the target from within the environment.
Microsoft’s solution to this problem is to use a tool that tunnels USB over IP  [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. We tested it on a few
systems and ultimately decided not to use it. It was dificult to get the USB devices to work on some
systems due to firewall issues. Instead, we now use SEGGER tools on the host operating system as
an alternative. This works well as the compiled Zephyr binary inside the WSL2 distribution is easily
accessible for tools that run on the host (Figure  1). Instead of programming the target using west
flash, for example, we use the J-Flash Lite GUI tool on the host.
1The size of the container heavily depends on included zephyr modules.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Implementation</title>
      <p>Containers are built from a Containerfile. We use the latest stable Debian version as a base and
install all required packages, the Zephyr SDK, and the Zephyr source code.</p>
      <p>
        Our work is publicly available at [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. The repository also includes the instructions that we hand out
to the students.
      </p>
      <p>The following is a simplified version of the Containerfile1that we use to build our container.
# Install apt packages
# Install pip packages
# Install Zephyr SDK
# Clone Zephyr
A container image can then be built from this file using Podman2. Several build arguments are
supported:
• The Zephyr version
• The SDK version
• Which Zephyr modules to install (all modules are installed when this is not specified)
• Which additional Python and system packages to install
The following command builds a container image with Zephyr v4.2.0 for Nordic Semiconductor’s nRF
platform.
podman build \
--build-arg="ZEPHYR_VERSION=4.2.0" \
--build-arg="SDK_VERSION=0.17.2" \
--build-arg="MODULES=cmsis_6 hal_nordic mbedtls mcuboot segger" \
. -t zephyr_nrf_v4.2.0
1The complete Containerfile can be found in Appendix A.
2Podman is an application for managing Open Container Initiative (OCI) containers. Podman’s command line interface is
designed to be compatible with Docker’s.</p>
      <p>
        Depending on whether the students want to run the container in a container engine or on WSL2, the
following steps difer.
3.1. Container Engine
In order to provide the container to students who use a container engine, the container can be exported
(and compressed) to a file with the following command.
podman save zephyr_nrf_v4.2.0 | zstd -19 &gt; zephyr_nrf_v4.2.0.tar.zst
The students can then import the container using Podman’s load command.
podman load --input zephyr_nrf_v4.2.0.tar.zst
3.2. WSL2
When using Windows, the container can be used as a WSL2 distro by importing the container’s
iflesystem. Microsoft calls this a custom distro [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The following commands export the container’s
iflesystem.
cid=$(podman create zephyr_nrf_v4.2.0)
podman export $cid | zstd -T0 -19 &gt; zephyr_nrf_v4.2.0_wsl.tar.zst
podman rm $cid
On Windows, the students can then import the filesystem as a WSL2 distro by running the following
commands in PowerShell.
mkdir "C:\WSL\zephyr_nrf_v4.2.0"
wsl --import zephyr_nrf_v4.2.0 "C:\WSL\zephyr_nrf_v4.2.0" `
zephyr_nrf_v4.2.0_wsl.tar.zst
wsl -d zephyr_nrf_v4.2.0
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Results and Discussion</title>
      <p>We currently use the containerized environment in three separate courses:
• Microcomputer Systems (BSc program)
• Embedded Real-Time Software (MSc program)
• Security in Embedded Systems (continuing education)
In the Microcomputer Systems course and the Embedded Real-Time Software course, we use Zephyr
to study real-world implementations of general operating system concepts. This includes threads,
scheduling (priorities, cooperative vs preemptive, time slicing), and resource locks (mutexes,
semaphores). We also look at diferent debugging methods with SEGGER Ozone and SEGGER SystemView
(Figure 3). For these courses, we use a development kit with a custom carrier board (Figure 2 ) that adds
additional peripherals and allows the design of intuitive lab exercises. With approximately 10 hours
of Zephyr-based lab exercises per course, we believe that the use of the proposed container solution
outweighs a native Zephyr installation, despite its described limitations. The container solution’s
simplicity in terms of installation is especially appealing, considering the students’ heterogeneous
laptop setups.</p>
      <p>Figure  2 shows the development kit in action, displaying the current output of a lab exercise
featuring the dining philosophers problem that is used to teach the use of semaphores and mutexes
with Zephyr. Figure 3 shows the respective events recorded by SEGGER SystemView.
Figure 2: STM32F429I-DISC1 development kit attached to a custom carrier board running a dining
philosophers application.
Finally, in the Security in Embedded Systems course ofered in continuing education, the participants
study firmware security. The participants work on a proof-of-concept application that implements
secure boot and secure over-the-air firmware updates using MCUBoot and Sysbuild. In another lab,
we cover certificate-based authentication to a server using a secure element. In this course, we use a
development kit with a secure element extension board (Figure 4).</p>
    </sec>
    <sec id="sec-5">
      <title>5. Future Work</title>
      <p>On the one hand, we are still gaining experience with the current container solution and hardware
boards. On the other hand, we are currently working on replacing one of the boards (Figure 2 ) with a
new, adapted custom board that uses an STM32H5 chip. Because of a design constraint (multiple use
of data connections) in today’s custom carrier board (see Figure 2 ), the display does not work with
Zephyr versions newer than 3.1. Besides fixing this annoyance, the new chip that we plan to use has
a Cortex-M33, which allows us to extend the security-related lab exercises on all course levels with
ARM TrustZone.</p>
      <p>Furthermore, we intend to gradually replace most of our course content with Zephyr-based
versions. For instance, we are currently working on lab exercises for running tests on the target using
Ztest and Twister.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusion</title>
      <p>As Zephyr sees wider adoption in our university, providing a uniform development environment for
our students is important. Discussions with industry partners in our projects also suggest that Zephyr
is becoming increasingly widespread in the industry.</p>
      <p>We have tried several approaches to provide a uniform Zephyr development environment for
our students. While a standard virtual machine has problems with reproducibility and uses a lot of
resources, the container compensates for these disadvantages.</p>
      <p>We have successfully used a container as a Zephyr development environment in several courses at
our university, and it has proven its practicality in over 2 years of coursework.</p>
      <p>The container is small, suficiently reproducible, and easy to set up and maintain. It allows students
to use their familiar editor while providing a uniform development experience, and allows both
students and lecturers to focus on the lab tasks.</p>
    </sec>
    <sec id="sec-7">
      <title>Declaration on Generative AI</title>
      <p>The authors have not employed any Generative AI tools.
# Set non-interactive frontend for apt-get to skip any user confirmations
ENV DEBIAN_FRONTEND=noninteractive
# Install base packages
ARG ADDITIONAL_APT_PACKAGES=""
RUN apt-get -y update &amp;&amp; \
apt-get -y upgrade &amp;&amp; \
apt-get install --no-install-recommends -y \
python3-pip \
git \
cmake \
device-tree-compiler \
wget \
xz-utils \
ninja-build \
${ADDITIONAL_APT_PACKAGES}
# Install Zephyr SDK
ARG SDK_VERSION
RUN test -n "${SDK_VERSION}" || (echo "SDK_VERSION build argument not set" &amp;&amp; false)
WORKDIR /opt/toolchains
RUN HOST_ARCHITECTURE=$(uname -m) &amp;&amp; \</p>
      <p>wget --quiet -O sdk.tar.xz https://github.com/zephyrproject-rtos/sdk-ng/releases/download/\
v"${SDK_VERSION}"/zephyr-sdk-"${SDK_VERSION}"_linux-"${HOST_ARCHITECTURE}"_minimal.tar.xz &amp;&amp; \
tar -xf sdk.tar.xz &amp;&amp; \
rm sdk.tar.xz &amp;&amp; \
cd zephyr-sdk-"${SDK_VERSION}" &amp;&amp; \
wget --quiet -O toolchain.tar.xz https://github.com/zephyrproject-rtos/sdk-ng/releases/download/\
v"${SDK_VERSION}"/toolchain_linux-"${HOST_ARCHITECTURE}"_arm-zephyr-eabi.tar.xz &amp;&amp; \
tar -xf toolchain.tar.xz &amp;&amp; \
./setup.sh -t arm-zephyr-eabi -c &amp;&amp; \
rm toolchain.tar.xz zephyr-*.sh
# Clean up stale packages
RUN apt-get clean -y &amp;&amp; \
apt-get autoremove --purge -y &amp;&amp; \
rm -rf /var/lib/apt/lists/*
# Install python dependencies
ARG ADDITIONAL_PYTHON_PACKAGES=""
RUN pip install --break-system-packages west pyelftools pylink-square ${ADDITIONAL_PYTHON_PACKAGES} &amp;&amp; \
echo "export PATH=~/.local/bin:\"$PATH\"" &gt;&gt; ~/.bashrc</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Noseda</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Künzli</surname>
          </string-name>
          , “
          <article-title>Attacking Secure-Element-Hardened MCUboot Using a Low-Cost Fault Injection Toolkit,” in Innovative Security Solutions for Information Technology</article-title>
          and Communications, Springer,
          <year>2024</year>
          , pp.
          <fpage>126</fpage>
          -
          <lpage>143</lpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>031</fpage>
          -52947-4_
          <fpage>10</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>F.</given-names>
            <surname>Schranz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Phimmasane</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Witzig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rüst</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Schmid</surname>
          </string-name>
          , “
          <article-title>User Assistance System for Smart Commercial Buildings - Use Cases and</article-title>
          Proof of Concept,”
          <source>in Proceedings of the 2024 European Conference on Computing in Construction, in Computing in Construction</source>
          , vol.
          <volume>5</volume>
          .
          <string-name>
            <surname>Chania</surname>
          </string-name>
          , Greece: European Council on Computing in Construction,
          <year>July 2024</year>
          . doi:
          <volume>10</volume>
          .35490/EC3.
          <year>2024</year>
          .
          <volume>190</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Podman</given-names>
            <surname>Developers</surname>
          </string-name>
          , “What is Podman?.
          <source>” Accessed: July</source>
          <volume>10</volume>
          ,
          <year>2025</year>
          . [Online]. Available: https://docs. podman.io/en/latest/
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Mirosoft</given-names>
            <surname>Corporation</surname>
          </string-name>
          , “
          <article-title>What is the Windows Subsystem for Linux?</article-title>
          .
          <source>” Accessed: July</source>
          <volume>10</volume>
          ,
          <year>2025</year>
          . [Online]. Available: https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Zephyr</given-names>
            <surname>Developers</surname>
          </string-name>
          , “Zephyr Docker Images.”
          <source>Accessed: July</source>
          <volume>08</volume>
          ,
          <year>2025</year>
          . [Online]. Available: https:// github.com/zephyrproject-rtos/docker-image
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Mirosoft</given-names>
            <surname>Corporation</surname>
          </string-name>
          , “
          <article-title>Connect USB devices</article-title>
          .” Accessed: June 18,
          <year>2025</year>
          . [Online]. Available: https://learn.microsoft.com/en-us/windows/wsl/connect-usb
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7] Institute of Embedded Systems, Zurich University of Applied Sciences, “Zephyr Development Environment Container.”
          <source>Accessed: July</source>
          <volume>16</volume>
          ,
          <year>2025</year>
          . [Online]. Available: https://github.com/InESIoT/zephyr_development_environment_container
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Mirosoft</given-names>
            <surname>Corporation</surname>
          </string-name>
          , “
          <article-title>Import any Linux distribution to use with WSL</article-title>
          .” Accessed: June 18,
          <year>2025</year>
          . [Online]. Available: https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>