Tool for interactive command line environments on Linux
Go to file
Debarshi Ray 5ed2442214 Give access to the CA certificates from the host
This uses the same approach taken by Flatpak [1] to ensure that the
certificates from certificate authorities (or CAs) that are available
inside a Toolbx container are kept synchronized with the host operating
system.  Any program that uses PKCS #11 to access CA certificates should
see the same ones both inside the container and on the host.

During every 'enter' and 'run' command, toolbox(1) ensures that an
instance of 'p11-kit server' is running on the host listening on a local
file system socket that's accessible to both the container and the host.
If an instance is already running, then a second one is not created.
The location of the socket is injected into the container through the
P11_KIT_SERVER_ADDRESS environment variable.

Just like Flatpak, the singleton 'p11-kit server' process is not
terminated when the last 'enter' or 'run' command exits.

The Toolbx container's entry point configures it to use the
p11-kit-client.so PKCS #11 module instead of the usual p11-kit-trust.so
module.  This talks to the 'p11-kit server' instance running on the host
over the socket instead of reading the CA certificates that are present
inside the container.

However, unlike Flatpak, this doesn't use D-Bus to set up the
communication between the container and the host, because when invoked
as 'sudo toolbox ...' there's no user or session D-Bus instance
available for the root user.

This set-up is skipped if 'p11-kit server' can't be run on the host, or
if the /etc/pkcs11/modules directory for configuring PKCS #11 modules or
p11-kit-client.so are missing inside the container.  None of these are
considered hard dependencies to accommodate size-constrained OSes like
Fedora CoreOS that might not have 'p11-kit server', and existing Toolbx
containers and old images that might not have p11-kit-client.so.

The UBI-based toolbox images haven't yet been updated to contain
p11-kit-client.so.  Until that happens, containers created from them
won't have access to the CA certificates from the host.

The CI needs to be run without 'p11-kit server' because the lingering
singleton process causes Bats to hang when tearing down the suite of
system tests [2].  To terminate the 'p11-kit server' instance run by the
system tests, it needs to be distinguishable from the instance run by
'normal' use of Toolbx by the user.  One way to do this is to isolate
the host operating system's XDG_RUNTIME_DIR from the system tests.
Unfortunately, this is easier said than done [3].  So, this workaround
has to suffice until the problem is solved.

On the Ubuntu 22.04 CI nodes, it's not possible to remove the p11-kit
package that provides 'p11-kit server', because it leads to:
  $ sudo dpkg --purge p11-kit
  dpkg: dependency problems prevent removal of p11-kit:
   adoptium-ca-certificates depends on p11-kit.

Therefore, as a workaround only the /usr/libexec/p11-kit/p11-kit-server
binary that provides the 'server' command is removed.  The rest of the
p11-kit package is left untouched.

[1] Flatpak commit 66b2ff40f7caf3a7
    https://github.com/flatpak/flatpak/commit/66b2ff40f7caf3a7
    https://github.com/flatpak/flatpak/pull/1757
    https://github.com/p11-glue/p11-kit/issues/68

[2] https://bats-core.readthedocs.io/en/stable/writing-tests.html

[3] https://github.com/containers/toolbox/pull/1652

https://github.com/containers/toolbox/issues/626
2025-06-02 15:58:46 +02:00
.github Give access to the CA certificates from the host 2025-06-02 15:58:46 +02:00
data build: Replace join_paths with the / operator 2022-10-21 17:24:03 +02:00
doc doc/toolbox: Clarify that Toolbx isn't a security mechanism 2024-09-26 21:19:26 +02:00
images .github/workflows, images/ubuntu: Add image definition for Ubuntu 25.04 2025-05-29 23:22:43 +02:00
playbooks Give access to the CA certificates from the host 2025-06-02 15:58:46 +02:00
profile.d profile.d: Add whitespace padding to the PS1 2024-09-29 13:25:31 +02:00
src Give access to the CA certificates from the host 2025-06-02 15:58:46 +02:00
test test/system: Optimize the environment variable tests 2025-05-12 23:26:00 +02:00
.codespellexcludefile cmd/run, pkg/podman: Make podman.InspectContainer() return a Container 2024-05-16 20:07:01 +02:00
.gitignore test/system: Track bats libs as submodules & install them better 2021-07-22 10:23:53 +02:00
.gitmodules test/system: Track bats libs as submodules & install them better 2021-07-22 10:23:53 +02:00
.mailmap .mailmap: Canonicalize my email 2022-08-01 18:37:43 +02:00
.zuul.yaml .zuul: Drop testing on Fedora 40 2025-05-29 23:44:56 +02:00
CODE-OF-CONDUCT.md Drop one "o" and rename the project as "Toolbx" 2024-02-06 18:24:26 +01:00
CONTRIBUTING.md Drop one "o" and rename the project as "Toolbx" 2024-02-06 18:24:26 +01:00
COPYING Rename LICENSE as COPYING 2018-10-19 18:24:23 +02:00
GOALS.md Drop one "o" and rename the project as "Toolbx" 2024-02-06 18:24:26 +01:00
NEWS NEWS: Fix regression annotations 2024-11-01 10:37:30 +01:00
NEWS.old Prepare 0.1.1 2024-10-31 19:24:31 +01:00
README.md README.md, images/fedora/f39: Tweak 2024-09-26 19:33:52 +02:00
SECURITY.md Drop one "o" and rename the project as "Toolbx" 2024-02-06 18:24:26 +01:00
gen-docs-list Update copyright notices 2024-02-29 23:31:51 +01:00
meson.build Give access to the CA certificates from the host 2025-06-02 15:58:46 +02:00
meson_options.txt build: Do not use use auto dependencies for shell completion scripts 2024-01-25 01:18:28 +01:00
meson_post_install.py Update copyright notices 2024-02-29 23:31:51 +01:00
toolbox Silence SC2317 2023-01-12 14:41:53 +01:00

README.md

README

Toolbx is a tool for Linux, which allows the use of interactive command line environments for software development and troubleshooting the host operating system, without having to install software on the host. It is built on top of Podman and other standard container technologies from OCI.

Toolbx environments have seamless access to the user's home directory, the Wayland and X11 sockets, networking (including Avahi), removable devices (like USB sticks), systemd journal, SSH agent, D-Bus, ulimits, /dev and the udev database, etc..

This is particularly useful on OSTree based operating systems like Fedora CoreOS and Silverblue. The intention of these systems is to discourage installation of software on the host, and instead install software as (or in) containers — they mostly don't even have package managers like DNF or YUM. This makes it difficult to set up a development environment or troubleshoot the operating system in the usual way.

Toolbx solves this problem by providing a fully mutable container within which one can install their favourite development and troubleshooting tools, editors and SDKs. For example, it's possible to do yum install ansible without affecting the base operating system.

However, this tool doesn't require using an OSTree based system. It works equally well on Fedora Workstation and Server, and that's a useful way to incrementally adopt containerization.

The Toolbx environment is based on an OCI image. On Fedora this is the fedora-toolbox image. This image is used to create a Toolbx container that offers the interactive command line environment.

Note that Toolbx makes no promise about security beyond what's already available in the usual command line environment on the host that everybody is familiar with.

Installation & Use

See our guides on installing & getting started with Toolbx and Linux distro support.

Star History Chart

Zuul Daily Pipeline

Arch Linux package Fedora package Ubuntu package