-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to attach to unprivileged podman containers? #172
Comments
I think the issue is that cntr is running the podman cli as root, so it does not find your container running as unprivileged user. For now you can get the pid of your container using |
It already exists. So, I did some digging with strace (just an excerpt):
I don't know much about how this works internally, so I can't really tell why |
Not sure if it tries to setup a bogus mountpoint for bind mount and creates the directory for it. Have to re-read the source code again. |
Suppose you start an unprivileged podman container like this:
Now, running
sudo cntr attach $(podman ps | tail -n1 | awk '{ print $1 }')
fails with the following error:This is because running
podman inspect
as root doesn't give you information about a container started as another user. Obviously, runningcntr
withoutsudo
won't work because the user has insufficient permissions.Another thing I tried is to obtain the PID of the process in the container and run
cntr attach
against it:Is it even possible nowadays to achieve that? If yes, how?
Currently using cntr 1.5.1 from NixOS 22.11.
The text was updated successfully, but these errors were encountered: