Skip to content
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

can not make checkpoint of container start by non root user #8421

Closed
darkgirl opened this issue Nov 20, 2020 · 12 comments
Closed

can not make checkpoint of container start by non root user #8421

darkgirl opened this issue Nov 20, 2020 · 12 comments
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@darkgirl
Copy link

darkgirl commented Nov 20, 2020

hi,
one of the reason i chose podman is i do not need to use podman by root user.
today, when i try to use podman container checkpoint to test podman contaner restore,
but i got these message:
Error: checkpointing a container requires root
when use root permission, I got these message:
Error: no container with name or ID b281916d9b79 found: no such container
And I found when i start a container by non root user, I can find it from ' podman container ls -a '.

so, how to make checkpoin of a container start by non root user?

and my podman version is 'podman version 1.6.4'

Thanks for your time.

@rhatdan
Copy link
Member

rhatdan commented Nov 20, 2020

Sorry but checkpoint and restore are still currently require privileged operations.
@adrianreber Is there any chance this will ever not require privs? Or do we need a sudo based solution?

@mheon
Copy link
Member

mheon commented Nov 20, 2020

I have heard a lot about the new checkpoint/restore capability in new kernels, but I have not verified if it allows CRIU as rootless.

@mheon
Copy link
Member

mheon commented Nov 20, 2020

(I suspect is does not because we're only getting a namespaced version of the capability in the rootless user namespace but would be happy to be proven wrong)

@mheon
Copy link
Member

mheon commented Nov 20, 2020

This would also all be academic if you're on RHEL/CentOS 7 or 8 as I don't believe there's any chance of the new capability being backported there. Assuming this functionality were to become available, it would only be on extremely new kernels.

@adrianreber
Copy link
Collaborator

Sorry but checkpoint and restore are still currently require privileged operations.
@adrianreber Is there any chance this will ever not require privs? Or do we need a sudo based solution?

I was able to add CAP_CHECKPOINT_RESTORE to the kernel with version 5.9. This is the first step to enable non-root checkpoint restore. Now that the necessary kernel interfaces are accessible with CAP_CHECKPOINT_RESTORE instead of CAP_SYS_ADMIN it is possible to change CRIU to work with those capabilities. The CRIU part is currently open at checkpoint-restore/criu#1155 (unfortunately the progress has stalled). With the changes from that PR and a 5.9 kernel it is possible to checkpoint/restore as non-root.

So there is chance that we might get checkpoint/restore in rootless mode, but it will not happen for a long time.

I would say to close this for now as not fixable within a reasonable amount of time.

@rhatdan
Copy link
Member

rhatdan commented Nov 20, 2020

@adrianreber Is CAP_CHECKPOINT_RESTORE going to be a User Namespaced capability or will users still need a full CAP_CHECKPOINT_RESTORE caps via filecap program?

@rhatdan rhatdan closed this as completed Nov 20, 2020
@saeidscorp
Copy link

I will be happy using sudo for the occasions of checkpointing and live migrations. But, as sudo changes the UID, podman runs the commands under the root account, which of course doesn't have the rootless containers in it.

Is there a way to have the checkpoint/restore functionality for rootless environments using sudo or something? I'm aware that non-root criu and its support are in the works but for the time being, a workaround would suit many use-cases.

@adrianreber
Copy link
Collaborator

Is there a way to have the checkpoint/restore functionality for rootless environments using sudo or something? I'm aware that non-root criu and its support are in the works but for the time being, a workaround would suit many use-cases.

No. There is currently no easy way to checkpoint and restore rootless containers.

@arlyon
Copy link

arlyon commented Oct 24, 2022

Apologies for reviving a dead thread, but it is not clear to me why this issue was closed. Is it because it is 'impossible' or because podman does not intend to support it?

@adrianreber
Copy link
Collaborator

Apologies for reviving a dead thread, but it is not clear to me why this issue was closed. Is it because it is 'impossible' or because podman does not intend to support it?

It depends on CRIU having support for checkpointing as non-root (checkpoint-restore/criu#1930) and then runc/crun need to support it. So it is a long way until Podman can theoretically support it.

@arlyon
Copy link

arlyon commented Oct 29, 2022

Thanks for clarifying :) Have a nice weekend.

@nickurak
Copy link

FWIW, checkpoint-restore/criu#1930 was merged a few months ago.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

7 participants