You are here

Planet GNOME

Subscribe to Feed Planet GNOME
Planet GNOME - https://planet.gnome.org/
Përditësimi: 15 orë 49 min më parë

Ivan Molodetskikh: Easy Sandboxing on Linux with Bubblewrap

Dje, 09/08/2026 - 6:51md

In these turbulent times, one frequently needs to run some tooling in a sandbox. The goal is mainly to reduce the blast radius: make it so programs within the sandbox cannot damage the host system (e.g. delete or overwrite something unintended), but also, to a lesser extent, to hide most of the filesystem to avoid exfiltrating sensitive data.

Recently, Bartosz Taudul (of Tracy fame) showed how to use systemd-nspawn for this purpose. He creates a container configuration, installs a distro inside, and bind-mounts some cache and project folders from the host. The mounts have an overlayfs on top, so within the container, tools can write over the files, but those writes do not affect the host filesystem.

I also want to share my sandboxing approach. My goal was to make it easy to use and reduce friction as much as possible, so that I always have a sandbox at my fingertips.

The result boils down to spawning a container-like environment, sharing enough of the host filesystem read-only to make all host binaries runnable, and sharing the current working directory read-write. Within this sandbox, you don’t need to install a separate distro—everything from your host just works, while the filesystem is kept mostly isolated (except for the folder where you run the sandbox).

For example, I’ll run the script in a Tracy checkout.

┌ ((8c8d451a)) ~/s/c/tracy └─ box fish Welcome to fish, the friendly interactive shell Type help for instructions on how to use fish yalter@sandbox ~/s/c/tracy>

I can run the build since all my host binaries are accessible:

yalter@sandbox ~/s/c/tracy> meson setup build The Meson build system Version: 1.11.2 Source dir: /home/yalter/source/cpp/tracy Build dir: /home/yalter/source/cpp/tracy/build Build type: native build Project name: tracy Project version: 0.13.1 C++ compiler for the host machine: /usr/bin/ccache c++ (clang 22.1.8 "clang version 22.1.8 (AerynOS)") C++ linker for the host machine: c++ ld.lld 22.1.8 Host machine cpu family: x86_64 Host machine cpu: x86_64 Checking if define "_MSC_VER" exists: NO Run-time dependency threads found: YES Found pkg-config: YES (/usr/bin/pkg-config) 2.5.1 Build targets in project: 1 Found ninja-1.13.2 at /usr/bin/ninja yalter@sandbox ~/s/c/tracy> ninja -C build ninja: Entering directory `build' [2/2] Linking target libtracy.so

The home folder contains the working directory, and is otherwise mostly empty:

yalter@sandbox ~/s/c/tracy> ls -l ~ total 0 drwx------ 4 1000 1000 80 Aug 9 20:20 source/

I can write into the home folder, but the write will go into a tmpfs, and will not affect the host system:

yalter@sandbox ~/s/c/tracy> touch ~/evil yalter@sandbox ~/s/c/tracy> ^D ┌ ((8c8d451a)) ~/s/c/tracy └─ cat ~/evil cat: /home/yalter/evil: No such file or directory

Only changes to the Tracy folder, where I ran the sandbox, persisted on the host, all with correct user ID and everything:

┌ ((8c8d451a)) ~/s/c/tracy └─ ls -l build/ total 28K drwxr-xr-x 1 yalter yalter 48 Aug 9 20:21 libtracy.so.p drwxr-xr-x 1 yalter yalter 496 Aug 9 20:21 meson-info drwxr-xr-x 1 yalter yalter 56 Aug 9 20:21 meson-logs drwxr-xr-x 1 yalter yalter 310 Aug 9 20:21 meson-private drwxr-xr-x 1 yalter yalter 40 Aug 9 20:21 meson-uninstalled -rw-r--r-- 1 yalter yalter 5,3K Aug 9 20:21 build.ninja -rw-r--r-- 1 yalter yalter 545 Aug 9 20:21 compile_commands.json -rwxr-xr-x 1 yalter yalter 14K Aug 9 20:21 libtracy.so The box script #

I use Bubblewrap to spawn the sandbox. This is an unprivileged sandboxing tool used by Flatpak (though, I hear there are plans to replace it with something else).

The script itself composes a long bwrap invocation. Let’s look at some of the parts.

#!/usr/bin/env bash set -euo pipefail # Export ALLOW_NET=0 to disable network access inside the sandbox. # # Keep in mind that if your X11/Xwayland doesn't check Xauth, # then network access lets the sandbox connect to your X11 # via an abstract Unix socket. This is quite dangerous. ALLOW_NET="${ALLOW_NET:-1}" # The current folder that we're binding read-write. REPO="$(readlink -f .)" BWRAP=( bwrap --die-with-parent # Unshare (isolate) a bunch of things inside the sandbox. --unshare-pid --unshare-uts --unshare-cgroup-try --unshare-user-try --cap-drop ALL # Create/mount important folders. --proc /proc --dev /dev --tmpfs /tmp --tmpfs /var --dir /run --dir /etc --hostname sandbox # Warning: this script shares all environment variables. # If on your system the environment can contain secrets, # you may want to clear them: # --clearenv # Bind the current folder read-write and chdir there. --bind "$REPO" "$REPO" --chdir "$REPO" ) # --- Read-only system binds --- SYS_RO_BINDS=( # Folders with binaries and libraries. /usr /bin /sbin /lib /lib64 # Random configuration files that programs tend to need. /etc/alternatives /etc/nsswitch.conf /etc/hosts /etc/localtime /etc/timezone /etc/pki /etc/ca-certificates /etc/ssl /etc/crypto-policies /etc/fonts # I fill these as I bump into problems, more or less. /etc/java /etc/texlive /var/lib/texmf /usr/lib/jvm /usr/share/java ) # Bind all of them read-only. for p in "${SYS_RO_BINDS[@]}"; do [[ -e "$p" ]] && BWRAP+=( --ro-bind "$p" "$p" ) done BWRAP+=( --ro-bind-try /etc/ld.so.cache /etc/ld.so.cache ) # resolv.conf is fun because it's a symlink into /run, # a folder which we do not want to expose. RESOLV_REAL="$(readlink -f /etc/resolv.conf 2>/dev/null || true)" if [[ -n "$RESOLV_REAL" && -f "$RESOLV_REAL" ]]; then BWRAP+=( --ro-bind "$RESOLV_REAL" /etc/resolv.conf ) fi # Unshare the network if needed. if [[ "$ALLOW_NET" -eq 0 ]]; then BWRAP+=( --unshare-net ) fi # Create a fresh home directory. # The username and the path is the same as on the host # so that everything keeps working. BWRAP+=( --setenv HOME "$HOME" --dir "$HOME" ) # --- Home read-only binds --- HOME_RO_BINDS=( .cargo/bin .cargo/config.toml .local/bin .local/lib/node_modules .rustup .fonts .local/share/fonts .local/share/nvim/site/parser .gitconfig .config/git .config/tmux .cache/ms-playwright .cache/corepack ) for rel in "${HOME_RO_BINDS[@]}"; do [[ -e "$HOME/$rel" ]] && BWRAP+=( --ro-bind "$HOME/$rel" "$HOME/$rel" ) done # --- Home overlays --- # The sandbox can write here, but the changes # will not affect the host filesystem. HOME_TMP_OVERLAYS=( .cache/fontconfig .cargo/registry .cargo/git .gradle .npm .cache/npm .local/share/pnpm/store .cache/yarn .cache/cpm .texlive2023 ) for rel in "${HOME_TMP_OVERLAYS[@]}"; do [[ -d "$HOME/$rel" ]] && BWRAP+=( --overlay-src "$HOME/$rel" --tmp-overlay "$HOME/$rel" ) done # Set up $PATH with the paths that we have inside this sandbox. BWRAP+=( --setenv PATH "$HOME/.cargo/bin:$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin" ) # Execute our big commandline and pass it # the rest of the arguments (the command to run). CMD=( "${@:-bash}" ) exec "${BWRAP[@]}" "${CMD[@]}"

Many lines, but most of them are just listing directories to mount.

If you want to run GUI apps in the sandbox, you’ll need to create an XDG_RUNTIME_DIR and mount a Wayland socket:

# Export PASS_WAYLAND=1 to enable Wayland access. # Warning: it is currently NOT SANDBOXED (e.g. with security-context protocol). # See https://niri-wm.github.io/niri/Security-Model.html#unsandboxed-clients # for an example of what that implies. PASS_WAYLAND="${PASS_WAYLAND:-0}" # Export PASS_DRI=1 to enable DRI (GPU) access for hardware acceleration. PASS_DRI="${PASS_DRI:-0}" # Export PASS_X11=1 to enable X11 (Xwayland) access. PASS_X11="${PASS_X11:-0}" if [[ "$PASS_DRI" -eq 1 && -d /dev/dri ]]; then BWRAP+=( --dev-bind /dev/dri /dev/dri ) fi # EGL complains without this. BWRAP+=( --ro-bind /sys /sys ) # Wayland: bind only the socket into a fresh runtime dir. XDG_RT="${XDG_RUNTIME_DIR:-}" WAYLAND_SOCK="${WAYLAND_DISPLAY:-wayland-0}" if [[ "$PASS_WAYLAND" -eq 1 && -n "$XDG_RT" && -S "$XDG_RT/$WAYLAND_SOCK" ]]; then BWRAP+=( --dir /run/user --dir /run/user/1000-sbox --bind "$XDG_RT/$WAYLAND_SOCK" "/run/user/1000-sbox/$WAYLAND_SOCK" --setenv XDG_RUNTIME_DIR /run/user/1000-sbox --setenv WAYLAND_DISPLAY "$WAYLAND_SOCK" ) else BWRAP+=( --unsetenv WAYLAND_DISPLAY ) fi # X11. DISPLAY_VAR="${DISPLAY:-}" if [[ "$PASS_X11" -eq 1 && -n "$DISPLAY_VAR" && -d /tmp/.X11-unix ]]; then BWRAP+=( --ro-bind /tmp/.X11-unix /tmp/.X11-unix --setenv DISPLAY "$DISPLAY_VAR" ) else # Make it harder for accidental X11: unset DISPLAY. BWRAP+=( --unsetenv DISPLAY ) fi

That’s about it for the script. If needed, it’s easy to mount more folders by adding them into one of the arrays. The script doesn’t require elevated privileges to run.

Just remember that the folder where you run it is mounted read-write with the sandbox. When I want to run a dangerous command without affecting the files in the repository I’m working on, I just make a temporary copy:

project > cd .. > git clone project project2 > cd project2 project2 > box fish project2@sandbox > ...some dangerous command... ... project2@sandbox > ^D project2 > cd .. > rm -rf project2

Another trick I recently did: I created a read-only GitHub personal access token, and automatically put it into $GH_TOKEN in the sandbox. This way, commands like gh pr list work in the sandbox without having any write access.

Conclusion #

This is very much not a polished tool, but rather a script I’ve been adding on to here and there for several months. I wanted to share it because I think it’s fairly generic (works on both Fedora and AerynOS at least), and avoids a number of pain points with other sandboxing approaches:

  • no extra setup required, just one command
  • no separate distro installation, uses the host system binaries and libraries directly. As a corollary, anything you build inside this sandbox will work on the host
  • no manual folder binding, passes through the current folder
  • paths and UID match the host, no broken file permissions
  • no sudo needed

One limitation is that I haven’t been able to make podman run inside this sandbox yet. I tried once briefly, but kept hitting weird errors. Maybe it needs some capabilities exposed; not sure.

This is also obviously not intended as a bulletproof sandbox for running fully untrusted code, in fact I wouldn’t be too surprised if I left some gaping holes by mistake (please let me know if I did).

Philipp Sauberzweig: Sovereign Tech Fellowship for GNOME Design & Community Management

Enj, 06/08/2026 - 3:28md

Hey, I’m Philipp. I’m a GNOME Design Team member and I have been contributing to GNOME design as a volunteer for several years. I’m excited to share with you that I have joined the Sovereign Tech Agency as a fellow for GNOME Design & Community Management. Check out the other fellows in the official announcement.

Introduction

I originally started contributing to GNOME to improve the software I use myself. However, what motivates me to stay involved long-term are my political values. Our modern lives, from communication and education to political discourse, are shaped by digital tools, and I believe that it’s essential for a free and democratic society to ensure free and independent access to these technologies. To achieve this goal, end-user devices based on free and open-source software are key, and the GNOME desktop and its app ecosystem offer a powerful alternative to proprietary platforms.

In recent years, I have had the privilege of joining the exceptionally skilled and motivated GNOME community as a volunteer, and have experienced how rewarding it is to contribute to a project with such a broad societal impact. At the same time, it’s been a challenge to find a balance between my job, my contributions to GNOME, and my personal life. I’ve contributed to GNOME in my free time, in the evenings, and during vacations. This two-year fellowship is a great honor and marks a significant change in my life. It is a unique opportunity for me to devote my skills and experience entirely to a project I strongly believe in.

Activities

During my two-year fellowship, I will support GNOME maintainers and developers with design feedback and reviews, create mockups, and coordinate efforts to standardize design patterns. My other activities focus on lasting improvements through two strategic initiatives: expanding the design community to increase capacity and enhancing our design tooling to reduce overhead and simplify onboarding. The following activities may change over the course of the two-year fellowship, as I will adapt them to the needs of the community.

Community growth

I know from my own experience that it is hard to get started with GNOME design. While code contributions are often contained within the boundaries of a single app, design activities spread across multiple projects and often lack a clear entry point or primary contact. Also, not all tasks are newcomer friendly and many require cross‑project knowledge or historical context. I want to make design work more discoverable, simplify onboarding with clear contribution paths and approachable tasks, and retain contributors long term by integrating them into the community.

To attract new contributors, I will increase the visibility of design work by writing regular blog posts, giving presentations, and running workshops at conferences and hackathons. New contribution opportunities for newcomers will be created with clear instructions for independent activities such as collecting state‑of‑the‑art examples, running accessibility and user tests, and creating mockups. Design reviews will be used as mentorship opportunities, pairing regular design contributors with experienced designers for peer review and knowledge sharing. I plan to improve our team governance with clear membership criteria and focus areas, and integrate sustained contributors into the team and its processes. Finally, I want to provide grant writing support to enable contributors to sustain their contributions long-term.

Tooling improvements

User interface mockups are an important tool to communicate with developers. Outdated mockup templates, incomplete documentation, and non‑specialized software create unnecessary overhead, especially for newcomers. Therefore, I will extend and update the mockup templates for our current tool, Inkscape, and evaluate the open‑source UX design tool Penpot for managing our design system. If it proves suitable, I will build a component library to simplify mockup creation and keep assets synced with our stylesheet.

What’s next

I want to blog about my fellowship activities and design work in general, so expect regular updates here. If you’re interested in contributing to GNOME design, check out the Design Team page on the Welcome to GNOME website, familiarize yourself with the Human Interface Guidelines, and join our Matrix channel. If you’re a GNOME developer feel free to reach out to me via Matrix and involve me in design reviews.

Hylke Bons: Icon for KawaiiFi

Enj, 06/08/2026 - 2:00pd
Week 27

This week's icon is for Zach Leytus's project:
KawaiiFi: "Wi-Fi scanner and analyzer"

Check out all weekly app icons created so far in the gallery and follow my icon creation adventures as they happen (including sketches) on the Fediverse.

Need icons?

I love designing icons and am happy to contribute them free of charge when your project is Free and Open Source. Funded by community sponsors (every little helps!).

Hylke Bons: Icon for Lockpicker

Mër, 05/08/2026 - 2:00pd
Week 26

This week's icon is for Sjoerd Stendahl's project:
Lockpicker: "Recover passwords from their hash"

Check out all weekly app icons created so far in the gallery and follow my icon creation adventures as they happen (including sketches) on the Fediverse.

Need icons?

I love designing icons and am happy to contribute them free of charge when your project is Free and Open Source. Funded by community sponsors (every little helps!).

Richard Hughes: NVIDIA is now supporting the LVFS

Mar, 04/08/2026 - 2:19md

I’m pleased to announce that NVIDIA is now supporting the LVFS as a premier sponsor.

The rollout of the NVIDIA DGX Spark firmware using fwupd is going very well indeed, with downloads continuing to increase every day.

This now takes us to 4 OEMs sponsoring LVFS, which means we’ve successfully reached the funding target we set for ourselves last year. More exciting announcements coming soon!

Felipe Borges: The Future of GNOME Boxes

Hën, 03/08/2026 - 1:28md

I have spent the last two years rebuilding GNOME Boxes from the ground up, driven by three main factors. I spoke extensively about this effort in my recent Linux App Summit, GUADEC 2025 and 2026 talks, but today I am excited to share the result for general testing.

First, shifting to a Flatpak-first (and only) model. As a solo developer, maintaining code paths for countless distributions isn’t sustainable. Since Boxes acts as a frontend for libvirt/qemu, its functionality relies heavily on the backend configuration. Flatpak lets me bundle the entire virtualization stack, giving me the control I need to fine-tune it for our specific use cases.

Second, migrating Boxes to GTK4 and Libadwaita. Beyond the obvious benefits (a modern UI, better responsiveness, and tighter desktop integration) this makes the codebase significantly easier to maintain. This transition required moving away from the GTK3-based SPICE display widget, which was too tightly coupled to older input and drawing methods. We’ve replaced it with Libmks, which has proven to be a solid alternative.

Lastly, modernizing the codebase to make it sustainable for new contributors. That meant adopting modern GNOME app design patterns and rethinking our underlying architecture.

I am now ready to share this work with a wider audience. However, please keep in mind that this is a Beta release meant for testing, not for production environments. If you plan to try it out, make sure to back up any important data in your virtual machines first.

If you want to test this new implementation of GNOME Boxes, you can set up the GNOME Nightly Flatpak Repository and install it with:

flatpak install org.gnome.Boxes.Devel

This new version already covers most of what the classic Boxes could do: creating virtual machines from ISO media and disk images (qcow2), configuring VM resources, sharing clipboard content, sending files to the guest, and more.

It can install Windows 11 without any manual workarounds. Boxes configures Secure Boot and a virtual TPM device automatically. Everything required to pass the Windows 11 hardware compatibility checks out of the box. This was the most requested feature for the classic version, so I am particularly glad it is fully functional in this rewrite.

As distributions shift toward image-based OSes, this Flatpak-only approach becomes even more valuable. Most other virtual machine managers rely on host services or privileged daemons that are difficult to configure on immutable systems. While hardware and host combinations vary, bundling the backend stack directly inside the Flatpak gives us a controlled baseline that we can actively support, configure, and refine over time.

Accessing VM contents used to be tricky due to Flatpak sandboxing. This version addresses that by introducing a VSOCK device to the box, allowing guests with systemd v256 or newer to be accessed directly over SSH. It also adds initial support for port forwarding, letting you reach services running inside the VM from your host.

Screenshot of a host terminal SSHing into the guest VM through VSOCK

All of this and more is detailed on our new website, nightly.gnomeboxes.org, where you can also learn how to help by testing and reporting issues.

Please keep in mind that I am working on this in my free time alongside maintaining GNOME Settings and my day-job responsibilities at Red Hat. I ask for your patience with issue responses, but I will do my best to address bugs and keep pushing feature development forward as time allows.

I love building GNOME Boxes, and I am constantly motivated by the positive feedback from our community. People appreciate Boxes because it lets them set up a VM quickly and get straight to work without needing deep knowledge of virtualization or operating system internals. That remains the core mission, and that is the user experience I want to continue building for.

A lot of this implementation will still change as I gather feedback and it matures. I have also drafted a series of follow-up blog posts to this one, which will describe and elaborate a bit more on the new features, explaining how to use them and how they have been implemented. Stay tuned!

Comments