containers / containers/toolbox

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

Open
#1,483 1 comment 4 reactions 0 assignees View on GitHub
1. Bug
Dominant language
Go
Stars
3.5k
Forks
262
Avg merge
3d 1h
Merged PRs (30d)
1

Description

```
$ 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

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `toolbox create --distro ubuntu --release latest` and `toolbox enter`, then inspect the `journalctl` output and the container's existing users. Confirm why UID 1000 is already present and define the fix by verifying that Ubuntu containers initialize and can be entered successfully without the `useradd` collision.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.