Quadlet with permissions to access GPIO on a Pi? #21401
-
How can i run a Quadlet in a way that it can access the GPIO pins on a Raspbery Pi? This without sudo fails:
wheras running with sudo works:
so now with a Quadlet:
So how do i get the "podman container create" to give the container permissions to access /dev/gpiomen? Thanks for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 15 replies
-
Does this work in rootful containers? Is this an SELinux issue? |
Beta Was this translation helpful? Give feedback.
-
@rhatdan - i'm quite new to podman, can you tell me how to try "rootful containers"? |
Beta Was this translation helpful? Give feedback.
-
Also chatting about this in Discord: https://discord.com/channels/852634929845239818/852634929845239824/1201823834848624640
versus running with sudo:
What does that mean - nobody nogroup??? |
Beta Was this translation helpful? Give feedback.
-
Suggestion from Discord was trying |
Beta Was this translation helpful? Give feedback.
-
Great, thanks everyone for the help. |
Beta Was this translation helpful? Give feedback.
-
Trying this again now on a new Pi with a new install of Podman and it doesn't work anymore. Now its using Podman 4.9.3 instead of 4.9.0
It works fine running with sudo:
Any ideas?
|
Beta Was this translation helpful? Give feedback.
-
Docker is still running in rootful mode, I would bet. If it is listening on /var/run/docker.sock and writable by the docker group, and your user is in the docker group, you are running rootful containers. |
Beta Was this translation helpful? Give feedback.
-
Also keep-groups is only supported by crun not runc. |
Beta Was this translation helpful? Give feedback.
-
that does seem to be the case. wouldn't it be a bit more user friendly to get some error or warning if you try to use keep-groups with runc? |
Beta Was this translation helpful? Give feedback.
Suggestion from Discord was trying
--group-add
and that fixes it:podman run --device /dev/gpiomem --group-add=keep-groups docker.io/antelder/rpiblink