You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Don't expose the whole system to the container #1649
If something goes wrong in the container, it will affect the WHOLE host system.
Yes, only as far as the user that invoked toolbox(1) has access. As the website says: 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.
Exposing the whole host file system is necessary to bypass the immutability of OCI containers. Otherwise, updating Toolbx won't give access to new locations from the host to containers created by older Toolbx versions.
Yes, only as far as the user that invoked toolbox(1) has access. As the website says: 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.
ere's some context here: #183
Exposing the whole host file system is necessary to bypass the immutability of OCI containers. Otherwise, updating Toolbx won't give access to new locations from the host to containers created by older Toolbx versions.
By now I believe there are two separate universes:
in one universe, toolbx behaves just as its maintainers expierence it.
in the other universe, toolbx behaves how some of its outsider users experience it (<--- I live in this universe).
# on Debian 12 bookworm
# from the outside host:
toolbox --version
# toolbox version 0.1.2
# just freshly installed from sources
toolbox create --distro ubuntu --release 22.04
toolbox enter ubuntu-toolbox-22.04
#######
# now inside container:
echo "hello from inside toolbx container" >/tmp/from-inside-toolbx-container
echo "another hello from inside toolbx container" >/run/host/tmp/file-inside-container-run-host-tmp
#######
# from the outside host:
cat /tmp/from-inside-toolbx-container
# gives stdout output: "hello from inside toolbx container"
cat /run/host/tmp/file-inside-container-run-host-tmp
another hello from inside toolbx container
How come that the container's /tmp directory is shared-modifiable-and-identical to host's /tmp directory?
How come that the container's /run/host/tmp directory is shared-modifiable-and-identical to host's /tmp directory? This is not what I understand as "it is read-only".
Indeed the directories /tmp and invoking-user's $HOME directory are 1:1 bidirectionally identical, shared, and synchronized ("1:1-mapped") between host and the toolbx container.
are there any other directories that are 1:1-mapped? I cannot find any information about this in the toolbx documentation.
I expect GitHub issues like this issue popping up eternally as long as the toolbx documentation, website, and main README.md do not explicitly disambiguate what to expect and what not to expect with respect to filesystem isolation. And indeed, the current documentation gives onboarding users several chances for building up incorrect believes into toolbx's behavior/scope:
By now I believe there are two separate universes:
* in one universe, _toolbx_ behaves just as its maintainers expierence it.
* in the other universe, _toolbx_ behaves how some of its outsider users experience it (<--- I live in this universe).
# on Debian 12 bookworm
# from the outside host:
toolbox --version
# toolbox version 0.1.2
# just freshly installed from sources
toolbox create --distro ubuntu --release 22.04
toolbox enter ubuntu-toolbox-22.04
#######
# now inside container:
echo "hello from inside toolbx container" >/tmp/from-inside-toolbx-container
echo "another hello from inside toolbx container" >/run/host/tmp/file-inside-container-run-host-tmp
#######
# from the outside host:
cat /tmp/from-inside-toolbx-container
# gives stdout output: "hello from inside toolbx container"
cat /run/host/tmp/file-inside-container-run-host-tmp
another hello from inside toolbx container
YES, IT'S NOT READ-ONLY
that line of code I referenced explains it well, it's rslave, not ro
I expect GitHub issues like this issue popping up eternally as long as the toolbx documentation, website, and main README.md do not explicitly disambiguate what to expect and what not to expect with respect to filesystem isolation. And indeed, the current documentation gives onboarding users several chances for building up incorrect believes into toolbx's behavior/scope:
* "[_Toolbx supports a number of distributions, allowing you to run development environments totally separate from the host operating system._](https://containertoolbx.org/distros/)"
* "totally separate" would include a totally separate file system.
* "[_The development environment can be set up inside the container in the same way as on the host operating system. No longer will project environments clash with the host OS, nor will it be limited to a single OS version._](https://containertoolbx.org/use/#command-line-tools--libraries)"
* But: installing _gdb_ inside the container **will** have that _gdb_ use my host system user's `~/.config/gdb/gdbinit` configuration file.
* But: my host system's [_meson_ is installed at `~/.local/bin/meson`](https://mesonbuild.com/Getting-meson.html). It is therefore leaked into any toolbx container, albeit in a broken state.
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..
...
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.
The user ID and account details from the host is propagated into the Toolbx container, SELinux label separation is disabled, and the host file system can be accessed by the container at /run/host. The container has access to the host's Kerberos credentials cache if it's configured to use KCM caches.
...
The entry point of a Toolbx container customizes the container to fit the current user by ensuring that it has a user that matches the one on the host, and grants it sudo and root access.
Crucial configuration files, such as /etc/host.conf, /etc/hosts, /etc/localtime, /etc/resolv.conf and /etc/timezone, inside the container are kept synchronized with the host. The entry point also bind mounts various subsets of the host's file system hierarchy to their corresponding locations inside the container to provide seamless integration with the host. This includes /run/libvirt, /run/systemd/journal, /run/udev/data, /var/lib/libvirt, /var/lib/systemd/coredump, /var/log/journal and others.
We can certainly try to update the documentation to address concerns that users face, and it needs to be updated to keep up with Toolbx's code.
I expect GitHub issues like this issue popping up eternally as long as the toolbx documentation, website, and main README.md do not explicitly disambiguate what to expect and what not to expect with respect to filesystem isolation. And indeed, the current documentation gives onboarding users several chances for building up incorrect believes into toolbx's behavior/scope:
The phrase "host operating system" is used in this context to mean the host's /usr, which is a separate file system from the container's. We can try to make it more explicit in the documentation. Feel free to send pull requests for the website and the manual pages if you have any specific ideas.
But: installing gdb inside the container will have that gdb use my host system user's ~/.config/gdb/gdbinit configuration file.
Are you seeing incompatibilities between GDB versions and configuration files?
* "[_Toolbx supports a number of distributions, allowing you to run development environments totally separate from the host operating system._](https://containertoolbx.org/distros/)"
* "totally separate" would include a totally separate file system.
* "[_The development environment can be set up inside the container in the same way as on the host operating system. No longer will project environments clash with the host OS, nor will it be limited to a single OS version._](https://containertoolbx.org/use/#command-line-tools--libraries)"
* But: installing _gdb_ inside the container **will** have that _gdb_ use my host system user's `~/.config/gdb/gdbinit` configuration file.
* But: my host system's [_meson_ is installed at `~/.local/bin/meson`](https://mesonbuild.com/Getting-meson.html). It is therefore leaked into any toolbx container, albeit in a broken state.
Activity
dongdigua commentedon May 20, 2025
ok fine, many toolbox implementations use this practice
juhp commentedon May 21, 2025
It is read-only
debarshiray commentedon Jun 23, 2025
Yes. :P
Yes, only as far as the user that invoked
toolbox(1)has access. As the website says: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.
There's some context here: #183
Exposing the whole host file system is necessary to bypass the immutability of OCI containers. Otherwise, updating Toolbx won't give access to new locations from the host to containers created by older Toolbx versions.
dongdigua commentedon Jun 24, 2025
(seems my email didn't arrive)
oh, this makes sense
Abdull commentedon Jun 25, 2025
By now I believe there are two separate universes:
/tmpdirectory is shared-modifiable-and-identical to host's/tmpdirectory?/run/host/tmpdirectory is shared-modifiable-and-identical to host's/tmpdirectory? This is not what I understand as "it is read-only"./tmpand invoking-user's$HOMEdirectory are 1:1 bidirectionally identical, shared, and synchronized ("1:1-mapped") between host and the toolbx container.I expect GitHub issues like this issue popping up eternally as long as the toolbx documentation, website, and main
README.mddo not explicitly disambiguate what to expect and what not to expect with respect to filesystem isolation. And indeed, the current documentation gives onboarding users several chances for building up incorrect believes into toolbx's behavior/scope:~/.config/gdb/gdbinitconfiguration file.~/.local/bin/meson. It is therefore leaked into any toolbx container, albeit in a broken state.dongdigua commentedon Jun 25, 2025
YES, IT'S NOT READ-ONLY
that line of code I referenced explains it well, it's
rslave, notroI do agree that the documentation should be more explict
look what OpenSUSE/microos-toolbox says:
https://github.com/openSUSE/microos-toolbox/blob/b335d1b3bc1178673a41ee5d13fe7e31ee638982/toolbox.1.md?plain=1#L17
and their website
debarshiray commentedon Jun 26, 2025
There's no need to insult someone who was trying to help, after I added more context and insight into the situation.
I don't think there is an bullet point list of directories anywhere.
The documentation does broadly describe how a Toolbx container is configured:
The toolbox(1) manual page and online documentation says:
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..
...
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.
The toolbox-create(1) manual page further says:
The user ID and account details from the host is propagated into the Toolbx container, SELinux label separation is disabled, and the host file system can be accessed by the container at /run/host. The container has access to the host's Kerberos credentials cache if it's configured to use KCM caches.
...
The entry point of a Toolbx container customizes the container to fit the current user by ensuring that it has a user that matches the one on the host, and grants it sudo and root access.
Crucial configuration files, such as /etc/host.conf, /etc/hosts, /etc/localtime, /etc/resolv.conf and /etc/timezone, inside the container are kept synchronized with the host. The entry point also bind mounts various subsets of the host's file system hierarchy to their corresponding locations inside the container to provide seamless integration with the host. This includes /run/libvirt, /run/systemd/journal, /run/udev/data, /var/lib/libvirt, /var/lib/systemd/coredump, /var/log/journal and others.
We can certainly try to update the documentation to address concerns that users face, and it needs to be updated to keep up with Toolbx's code.
The phrase "host operating system" is used in this context to mean the host's
/usr, which is a separate file system from the container's. We can try to make it more explicit in the documentation. Feel free to send pull requests for the website and the manual pages if you have any specific ideas.Are you seeing incompatibilities between GDB versions and configuration files?
What is the exact breakage that you are seeing?
debarshiray commentedon Jun 26, 2025
toolbox-create(1):
... the host file system can be accessed by the container at /run/host.
Mention access to the host file system at /run/host
Clarify how Toolbx environments are separate from the host
Add a section on how the containers are configured
debarshiray commentedon Jul 28, 2025
This line got dropped when the text on the containertoolbx.org/distros page got reworded in containers/containertoolbx.org@0db2950 because it wasn't central to the topic of the page.
Clarified in containers/containertoolbx.org@81c1f77
debarshiray commentedon Jul 28, 2025
Added a section on how the containers are configured to prominently mention the most important parts outside the manual pages for the create and init-container commands: containers/containertoolbx.org@ad9af82
16 remaining items
doc/toolbox-create: Tweak
doc/toolbox-create: Tweak
doc/toolbox-create: Clarify that Toolbx isn't a security mechanism
README.md, doc/toolbox: Mention /run/host
doc/toolbox-create: Tweak the wording for consistency
doc/toolbox-create, doc/toolbox-init-container: Mention /etc/machine-id
doc/toolbox-create: Mention how to check for the label
doc/toolbox-create: Tweak the wording for consistency
doc/toolbox-create: Mention /run/.containerenv
doc/toolbox-create: Tweak
doc/toolbox-create: Tweak
doc/toolbox-create: Clarify that Toolbx isn't a security mechanism
README.md, doc/toolbox: Mention /run/host
doc/toolbox-create: Tweak the wording for consistency
doc/toolbox-create, doc/toolbox-init-container: Mention /etc/machine-id