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
Running fedora-toolbox 0.0.2-1.fc29, when I'm in the toolbox, I am root.
When I'm working, I'm mostly working as a simple user, and I'd like to enter the toolbox as my own user and not have to use su after entering the toolbox. Also, I had to manually set up my own user in /etc/passwd inside the toolbox on first use.
Additionally, it would be nice if I could run specific commands after toolbox enter. For example, being able to run toolbox enter su $USER would help my use case (I could just create an alias then)
Running fedora-toolbox 0.0.2-1.fc29, when I'm in the toolbox, I am root.
Oh, really? That's surprising. We definitely try to retain the same user inside the container as on the host. Grep for $USER and $UID inside the fedora-toolbox script. Also, see commit cfcf4eb
Do you have any fancy or non-standard set-up? For example, are you logging via LDAP or Kerberos, as opposed to having a simple local user?
Additionally, it would be nice if I could run specific commands after
toolbox enter
Yes, this does sound like a good thing to have. I wonder if run would be a better name for the command in that case. It could also just be an alias for enter.
Oh, really? That's surprising. We definitely try to retain the same user inside the container as on the host. Grep for $USER and $UID inside the fedora-toolbox script. Also, see commit cfcf4eb
Uid mapping works as intended:
uid 0 inside the container corresponds to uid 100000 outside
uid 1000 inside the container corresponds to uid 1000 outside
grepping gives:
$ egrep 'USER|UID' /usr/bin/fedora-toolbox
--uid $UID \
$USER \
echo "$0: failed to create user $USER with UID $UID"
if ! $prefix_sudo buildah run $working_container_name -- passwd -d $USER >/dev/null 2>&42; then
echo "$0: failed to remove password for user $USER"
if ! $prefix_sudo buildah config --user $USER $working_container_name >/dev/null 2>&42; then
echo "$0: failed to configure the default user as $USER"
max_minus_uid=$((max_uid_count-UID))
uid_plus_one=$((UID+1))
--uidmap $UID:0:1 \
--uidmap 0:1:$UID \
[ "$toolbox_container" = "" ] && toolbox_container="fedora-toolbox-$USER:$release"
toolbox_image="fedora-toolbox-$USER:$release"
echo "$0: failed to remove password for user $USER"
Do you have any fancy or non-standard set-up? For example, are you logging via LDAP or Kerberos, as opposed to having a simple local user?
Nope, laptop running fedora silverblue with a single user uid 1000
Possibly, creating the toolbox image the first time did not happen correctly, I remember that I had difficulties with it. I had to manually create the user inside the toolbox and perhaps configure sudo too. I think I used the following command to create the toolbox
fedora-toolbox create --image fedora
Not specifying --image did not work for some reason.
The problem I had (when not specifying --image) is:
$ fedora-toolbox --verbose --container test create
error looking up container "test": no container with name or ID test found: no such container
Trying to pull docker.io/fedora-toolbox-mildred:29...Failed
Trying to pull registry.fedoraproject.org/fedora-toolbox-mildred:29...Failed
Trying to pull quay.io/fedora-toolbox-mildred:29...Failed
Trying to pull registry.access.redhat.com/fedora-toolbox-mildred:29...Failed
Trying to pull registry.centos.org/fedora-toolbox-mildred:29...Failed
unable to pull fedora-toolbox-mildred:29: 5 errors occurred:
* Error determining manifest MIME type for docker://fedora-toolbox-mildred:29: Error reading manifest 29 in docker.io/library/fedora-toolbox-mildred: errors:
denied: requested access to the resource is denied
unauthorized: authentication required
* Error determining manifest MIME type for docker://registry.fedoraproject.org/fedora-toolbox-mildred:29: Error reading manifest 29 in registry.fedoraproject.org/fedora-toolbox-mildred: manifest unknown: manifest unknown
* Error determining manifest MIME type for docker://quay.io/fedora-toolbox-mildred:29: Error reading manifest 29 in quay.io/fedora-toolbox-mildred: error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n<title>404 Not Found</title>\n<h1>Not Found</h1>\n<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>\n"
* Error determining manifest MIME type for docker://registry.access.redhat.com/fedora-toolbox-mildred:29: Error reading manifest 29 in registry.access.redhat.com/fedora-toolbox-mildred: unknown: Not Found
* Error determining manifest MIME type for docker://registry.centos.org/fedora-toolbox-mildred:29: Error reading manifest 29 in registry.centos.org/fedora-toolbox-mildred: manifest unknown: manifest unknown
/home/mildred/.local/bin/fedora-toolbox: failed to create container test
That being said, it should be possible to enter the toolbox as simple user for containers created from other images than fedora-toolbox.
* uid 0 inside the container corresponds to uid 100000 outside
* uid 1000 inside the container corresponds to uid 1000 outside
You can build a fedora-toolbox image for yourself locally using one of the Dockerfiles in the images sub-directory. If you do that, does this work as expected:
host $ fedora-toolbox create
host $ fedora-toolbox enter
toolbox $
That being said, it should be possible to enter the toolbox as simple user for containers
created from other images than fedora-toolbox.
The problem is that the base fedora image has some missing pieces (eg., the passwd RPM) that the fedora-toolbox script expects to be present when setting up the toolbox for the user.
If one uses a heavily customized image, then it becomes a bit of an adventure. :/
Thank you, I was hit by #37 (comment), I removed ~/.config/containers/libpod.conf, ~/.config/containers/mounts.conf and ~/.local/share/containers and fedora-toolbox create now works.
However, I looked at the Dockerfile of fedora-toolbox, and I don't understand what makes it possible for it to automatically log-in to my user instead of root, and why my image based on fedora (where I manually added the user 1000) was unable to do so.
However, I looked at the Dockerfile of fedora-toolbox, and I don't understand what
makes it possible for it to automatically log-in to my user instead of root, and why my
image based on fedora (where I manually added the user 1000) was unable to do so.
Could it be that passwd was missing from your image?
At first, yes, I remember installing it manually. And that's probably the reason. I was looking for reasons inside the enter() function but the problem was in create().
So, when fedora-toolbox creates a toolbox, it sets the default user (similar to USER 1000 in a Dockerfile), but it does it after having created the user, and for that, passwd needs to be available within the base image you choose.
Activity
debarshiray commentedon Jan 11, 2019
Oh, really? That's surprising. We definitely try to retain the same user inside the container as on the host. Grep for
$USERand$UIDinside thefedora-toolboxscript. Also, see commit cfcf4ebDo you have any fancy or non-standard set-up? For example, are you logging via LDAP or Kerberos, as opposed to having a simple local user?
debarshiray commentedon Jan 11, 2019
Yes, this does sound like a good thing to have. I wonder if
runwould be a better name for the command in that case. It could also just be an alias forenter.mildred commentedon Feb 1, 2019
Uid mapping works as intended:
grepping gives:
Nope, laptop running fedora silverblue with a single user uid 1000
Possibly, creating the toolbox image the first time did not happen correctly, I remember that I had difficulties with it. I had to manually create the user inside the toolbox and perhaps configure sudo too. I think I used the following command to create the toolbox
Not specifying
--imagedid not work for some reason.mildred commentedon Feb 1, 2019
The problem I had (when not specifying
--image) is:That being said, it should be possible to enter the toolbox as simple user for containers created from other images than
fedora-toolbox.debarshiray commentedon Feb 1, 2019
You can build a
fedora-toolboximage for yourself locally using one of the Dockerfiles in theimagessub-directory. If you do that, does this work as expected:Just so I understand this correctly. :)
debarshiray commentedon Feb 1, 2019
You might be hitting either #37 or #42
The problem is that the base
fedoraimage has some missing pieces (eg., the passwd RPM) that thefedora-toolboxscript expects to be present when setting up the toolbox for the user.If one uses a heavily customized image, then it becomes a bit of an adventure. :/
mildred commentedon Feb 1, 2019
Thank you, I was hit by #37 (comment), I removed
~/.config/containers/libpod.conf,~/.config/containers/mounts.confand~/.local/share/containersand fedora-toolbox create now works.However, I looked at the Dockerfile of fedora-toolbox, and I don't understand what makes it possible for it to automatically log-in to my user instead of root, and why my image based on fedora (where I manually added the user 1000) was unable to do so.
debarshiray commentedon Feb 1, 2019
Could it be that
passwdwas missing from your image?mildred commentedon Feb 1, 2019
At first, yes, I remember installing it manually. And that's probably the reason. I was looking for reasons inside the
enter()function but the problem was increate().So, when fedora-toolbox creates a toolbox, it sets the default user (similar to
USER 1000in a Dockerfile), but it does it after having created the user, and for that,passwdneeds to be available within the base image you choose.