toolbox icon indicating copy to clipboard operation
toolbox copied to clipboard

can't start ubuntu (useradd: UID is not unique)

Open 2-www opened this issue 1 year ago • 1 comments

$ toolbox create --distro ubuntu --release latest
Created container: ubuntu-toolbox-latest
Enter with: toolbox enter ubuntu-toolbox-latest
$ toolbox enter ubuntu-toolbox-latest
Error: failed to initialize container ubuntu-toolbox-latest
$ journalctl ...
...
ubuntu-toolbox-latest[66635]: level=debug msg="Adding user user with UID 1000:"
ubuntu-toolbox-latest[66635]: level=debug msg=useradd
ubuntu-toolbox-latest[66635]: level=debug msg=--groups
ubuntu-toolbox-latest[66635]: level=debug msg=sudo
ubuntu-toolbox-latest[66635]: level=debug msg=--home-dir
ubuntu-toolbox-latest[66635]: level=debug msg=/home/user
ubuntu-toolbox-latest[66635]: level=debug msg=--no-create-home
ubuntu-toolbox-latest[66635]: level=debug msg=--shell
ubuntu-toolbox-latest[66635]: level=debug msg=/bin/bash
ubuntu-toolbox-latest[66635]: level=debug msg=--uid
ubuntu-toolbox-latest[66635]: level=debug msg=1000
ubuntu-toolbox-latest[66635]: level=debug msg=user
ubuntu-toolbox-latest[66635]: useradd: UID 1000 is not unique
useradd[66677]: failed adding user 'user', exit code: 4
ubuntu-toolbox-latest[66635]: Error: failed to add user user with UID 1000: failed to invoke useradd(1)
...

Output of toolbox --version (v0.0.90+) toolbox version 0.0.99.3

Toolbx package info (rpm -q toolbox) i don't have rpm

Output of podman version

Client:       Podman Engine
Version:      4.9.3
API Version:  4.9.3
Go Version:   go1.21.6
Built:        Thu Jan  1 03:00:00 1970
OS/Arch:      linux/amd64

Podman package info (rpm -q podman) i don't have rpm

Info about your OS Debian testing

2-www avatar May 01 '24 15:05 2-www

Had the same issue with Ubuntu 23.04 and 23.10.

After poking around in the image, I noticed that there's already a user named ubuntu with UID 1000. So it seems to be a UID conflict between the host and the guest config.

pdfrod avatar Aug 28 '24 11:08 pdfrod