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
One of the use cases from running toolbox on Fedora CoreOS is to debug the system (not development). When running as root I see an error:
[root@coreos ~]# toolbox
toolbox: /etc/subgid and /etc/subuid don't have entries for user root
See the podman(1), subgid(5), subuid(5) and usermod(8) manuals for more
information.
[root@coreos ~]# exit
logout
[core@coreos ~]$ sudo toolbox
toolbox: /etc/subgid and /etc/subuid don't have entries for user root
See the podman(1), subgid(5), subuid(5) and usermod(8) manuals for more
information.
[core@coreos ~]$
Considering we decided that we don't want to have two implementations and that we'll work together on toolbox I don't believe that's a helpful reminder.
Considering we decided that we don't want to have two implementations and that we'll work together on toolbox I don't believe that's a helpful reminder.
[root@coreos ~]# toolbox
toolbox: /etc/subgid and /etc/subuid don't have entries for user root
See the podman(1), subgid(5), subuid(5) and usermod(8) manuals for more
information.
[root@coreos ~]# exit
logout
[core@coreos ~]$ sudo toolbox
toolbox: /etc/subgid and /etc/subuid don't have entries for user root
See the podman(1), subgid(5), subuid(5) and usermod(8) manuals for more
information.
[core@coreos ~]$
Is this expected?
That's caused by an explicit sanity check in Toolbox to ensure that people have sane /etc/subuid and /etc/subgid files, which are crucial for rootless Podman. It's meant for users who tend to upgrade across major OS releases and might have created their local user account with an old version of shadow-utils that didn't update those files. An upfront human readable error is better than weird rootless Podman failures later in the process.
Clearly this check needs to be skipped when running as root. :)
I can imagine a few more things that might cause problems when running as root. eg., $XDG_RUNTIME_DIR might be unset, no user or session D-Bus to talk to the Flatpak session helper to monitor configuration files that need to be kept synchronized, and need to skip useradd in toolbox init-container.
Just found an old issue from Podman where they were solving this kind of problem: podman-container-tools/podman#427. Their solution was to create /run/containers instead of /run/user/UID/containers.
[root@coreos ~]# export XDG_RUNTIME_DIR=/opt/
[root@coreos ~]# toolbox -v enter
toolbox: running as real user ID 0
toolbox: resolved absolute path for /usr/bin/toolbox to /usr/bin/toolbox
toolbox: TOOLBOX_PATH is /usr/bin/toolbox
toolbox: Fedora generational core is f30
toolbox: base image is fedora-toolbox:30
toolbox: container is fedora-toolbox-30
toolbox: checking if container fedora-toolbox-30 exists
toolbox: container fedora-toolbox-30 not found
toolbox: found 0 containers
No toolbox containers found. Create now? [y/N] y
toolbox: Fedora generational core is f30
toolbox: base image is fedora-toolbox:30
toolbox: container is fedora-toolbox-30
toolbox: failed to read property Listen from sssd-kcm.socket
toolbox: parsing value of property Listen in sssd-kcm.socket
toolbox: checking if 'podman create' supports --ulimit host
/usr/bin/toolbox: line 758: man: command not found
toolbox: looking for image localhost/fedora-toolbox:30
toolbox: looking for image registry.fedoraproject.org/f30/fedora-toolbox:30
Image required to create toolbox container.
Download registry.fedoraproject.org/f30/fedora-toolbox:30 (500MB)? [y/N]: y
toolbox: pulling image registry.fedoraproject.org/f30/fedora-toolbox:30
Trying to pull registry.fedoraproject.org/f30/fedora-toolbox:30...
Getting image source signatures
Copying blob 5eb34e12d23e done
Copying blob b2b686c4a538 done
Copying config 06478f0b37 done
Writing manifest to image destination
Storing signatures
toolbox: base image fedora-toolbox:30 resolved to registry.fedoraproject.org/f30/fedora-toolbox:30
toolbox: checking if container fedora-toolbox-30 already exists
toolbox: checking if /usr is mounted read-only or read-write
toolbox: mount-point of /usr is /usr
toolbox: mount flags of /usr on the host are ro,relatime,seclabel,attr2,inode64,prjquota
toolbox: /root canonicalized to /var/roothome
toolbox: checking if /home is a symbolic link to /var/home
toolbox: /home is a symbolic link to /var/home
toolbox: calling org.freedesktop.Flatpak.SessionHelper.RequestSession
Error connecting: Cannot autolaunch D-Bus without X11 $DISPLAY
toolbox: failed to call org.freedesktop.Flatpak.SessionHelper.RequestSession
so we'd need to figure out how to launch dbus without X11 $DISPLAY variable
Activity
cgwalters commentedon Sep 20, 2019
This works with https://github.com/cgwalters/coretoolbox
dustymabe commentedon Sep 20, 2019
Considering we decided that we don't want to have two implementations and that we'll work together on
toolboxI don't believe that's a helpful reminder.cgwalters commentedon Sep 20, 2019
Where was that decided?
dustymabe commentedon Sep 20, 2019
Well it seems like we've discussed "toolbox" a lot. In coreos/fedora-coreos-tracker#38 and https://github.com/debarshiray/toolbox/issues/8 and coreos/fedora-coreos-tracker#90. @mike-nguyen and @yuqi-zhang have been working together with @debarshiray IIUC to align the efforts. We have not added it to our design document so I guess we are missing a formal agreement, but in the meeting a week ago I didn't hear anyone dissenting on including
toolboxonce the deps were aligned. Outside of the meeting you spoke up and we tried to address the concerns you had in the next meeting. I thought we had addressed those concerns.cgwalters commentedon Sep 20, 2019
I dissent until we have resolved the discussion in https://github.com/debarshiray/toolbox/issues/265
Log the real user ID into the debug output
Don't sanity check /etc/subgid and /etc/subuid when running as root
debarshiray commentedon Sep 23, 2019
That's caused by an explicit sanity check in Toolbox to ensure that people have sane
/etc/subuidand/etc/subgidfiles, which are crucial for rootless Podman. It's meant for users who tend to upgrade across major OS releases and might have created their local user account with an old version of shadow-utils that didn't update those files. An upfront human readable error is better than weird rootless Podman failures later in the process.Clearly this check needs to be skipped when running as root. :)
I can imagine a few more things that might cause problems when running as root. eg.,
$XDG_RUNTIME_DIRmight be unset, no user or session D-Bus to talk to the Flatpak session helper to monitor configuration files that need to be kept synchronized, and need to skipuseraddintoolbox init-container.debarshiray commentedon Sep 23, 2019
https://github.com/debarshiray/toolbox/pull/273 solves this specific issue, but we still need to work through the other differences between root and rootless scenarios.
dustymabe commentedon Sep 25, 2019
You were right! I now hit this:
because of
toolbox_runtime_directory="$XDG_RUNTIME_DIR"/toolboxmartymichal commentedon Sep 26, 2019
Just found an old issue from Podman where they were solving this kind of problem: podman-container-tools/podman#427. Their solution was to create /run/containers instead of /run/user/UID/containers.
dustymabe commentedon Oct 16, 2019
Workaround:
dustymabe commentedon Oct 16, 2019
Next issue:
so we'd need to figure out how to launch dbus without X11 $DISPLAY variable
22 remaining items
cmd/run: Fill out the remaining fields in the OSC 777 escape sequence
cmd/run: Pass the UID when notifying the terminal about the container
cmd/run: Fill out the remaining fields in the OSC 777 escape sequence
cmd/run: Pass the UID when notifying the terminal about the container
cmd/create: Set XDG_RUNTIME_DIR when creating the toolbox container
Don't rely on XDG_RUNTIME_DIR when running as root
cmd/create: Set XDG_RUNTIME_DIR when creating the toolbox container
Don't rely on XDG_RUNTIME_DIR when running as root
cmd/create: Use the host's user namespace when running as root
debarshiray commentedon Dec 18, 2020
I think this can be closed now. Any follow-up issues with
sudo toolboxcan be tracked in separate issues.playbooks: Drop deprecated flatpak-session-helper
playbooks: Drop deprecated flatpak-session-helper
playbooks: Drop deprecated flatpak-session-helper
cmd, test/system: Deprecate containers using o.fd.Flatpak.SessionHelper