Skip to content
Discussion options

You must be logged in to vote

I think you need to map the host user to the user in the container (UID=1000, GID=1000) with --uidmap.

Using --gidmap does not seem to be necessary in this case, but I add it to make the solution below a bit more general.

uid=1000
gid=1000
subuidSize=$(( $(podman info --format "{{ range .Host.IDMappings.UIDMap }}+{{.Size }}{{end }}" ) - 1 ))
subgidSize=$(( $(podman info --format "{{ range .Host.IDMappings.GIDMap }}+{{.Size }}{{end }}" ) - 1 ))
podman run \
         --rm \
         -e DISPLAY \
         --net=host \
         -v ~/.Xauthority:/home/user/.Xauthority:z \
         --uidmap $uid:0:1 \
         --uidmap 0:1:$uid \
         --uidmap $(($uid+1)):$(($uid+1)):$(($subuidSize-$uid)) \…

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
6 replies
@hkjn
Comment options

@rhatdan
Comment options

@edsantiago
Comment options

@hkjn
Comment options

@debarshiray
Comment options

Comment options

You must be logged in to vote
1 reply
@hkjn
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@hkjn
Comment options

@eriksjolund
Comment options

Answer selected by hkjn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
kind/bug Categorizes issue or PR as related to a bug.
5 participants
Converted from issue

This discussion was converted from issue #13036 on January 27, 2022 13:52.