Skip to content

[Error] containers created with --unshare-groups enters with the root user instead of my host user #2011

@Kamorst

Description

@Kamorst

Please, before opening a bug:

  • make sure you've read the documentation.
  • Ensure there isn't already an open issue about this.
  • Ensure there isn't already a closed/resolved issue about this.

Describe the bug
Instead of entering a container with my user, containers created with the option --unshare-groups enters with the root user.

To Reproduce
Run distrobox-ephemeral -H $(mktemp -d) -i fedora-toolbox --unshare-groups.

[psato@distrobox ~]$ distrobox-ephemeral -H $(mktemp -d) -i fedora-toolbox --unshare-groups 
Creating 'distrobox-vZJcsUHwk8' using image fedora-toolbox	 [ OK ]
Distrobox 'distrobox-vZJcsUHwk8' successfully created.
To enter, run:

distrobox enter distrobox-vZJcsUHwk8

Starting container...                   	 [ OK ]
Executing pre-init hooks...             	 [ OK ]
Installing basic packages...            	 [ OK ]
Setting up devpts mounts...             	 [ OK ]
Setting up read-only mounts...          	 [ OK ]
Setting up read-write mounts...         	 [ OK ]
Setting up host's sockets integration...	 [ OK ]
Integrating host's themes, icons, fonts...	 [ OK ]
Setting up distrobox profile...         	 [ OK ]
Setting up sudo...                      	 [ OK ]
Setting up kerberos integration...      	 [ OK ]
Setting up user's group list...         	 [ OK ]
Setting up existing user - shell...     	 [ OK ]
Setting up existing user - groups...    	 [ OK ]
Setting up user home...                 	 [ OK ]
Ensuring user's access...               	 [ OK ]
Setting up skel...                      	 [ OK ]
Executing init hooks...                 	 [ OK ]

Container Setup Complete!
📦[root@distrobox-vZJcsUHwk8 psato]$ id
uid=0(root) gid=0(root) groups=0(root)

Expected behavior
Enter the container with the same user as my host.

Logs
Run the commands with --verbose and post the log here as a file upload
Attach also the output of podman logs or docker logs, possibly with --latest flag

Desktop (please complete the following information):

  • Are you using podman, docker or lilipod?
    podman
  • Which version or podman, docker or lilipod?
    podman version 5.7.1
  • Which version of distrobox?
    latest from repo (3e49b78)
  • Which host distribution?
    fedora 43
  • How did you install distrobox?
    git clone and ./install

distrobox-log.txt
podman-log.txt

Additional context
Running su - psato inside the container works normally.

Revert commit 0424e15 makes distrobox enter work as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions