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

Allow running image with privileged option #1827

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xuhuashan
Copy link

Some applications running in containers require additional permissions to run, such as accessing the host's hardware devices. The most convenient way is to run in privileged mode.
This mode is disabled by default. Users can choose to enable it by checking the Privileged option when running an image.

image

Copy link
Member

@jelly jelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if privileged was supported for a rootless container and it seems to work.

When I create a privileged container now there is no indication in the UI that it is privileged.

Some tests need to be added to ensure this keeps working in the future, I am happy to assist here.

@jelly
Copy link
Member

jelly commented Aug 20, 2024

Checked podman desktop for inspiration, this doesn't show if a container is privileged or not.

@xuhuashan
Copy link
Author

I was wondering if privileged was supported for a rootless container and it seems to work.

In most cases, rootless containers cannot access files in the /dev directory, even when running privileged. Some device files can be accessed via supplementary group memberships (e.g. the video group). This requires adding the "keep-groups" flag to the "groups" parameter, and possibly mapping the groups with idmappings. But this flag seems to be supported only when running with "crun".

However, the privileged option adds all capabilities to the container, which makes commands like ping work right away. It also disables Seccomp, SELinux, and Apparmor confinement.

Full support for rootless container access to devices seems to complicate things, or privileged should be disabled for rootless containers first.

When I create a privileged container now there is no indication in the UI that it is privileged.

I really hadn't considered that. it should be indicated in the right position.

Some tests need to be added to ensure this keeps working in the future, I am happy to assist here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants