-
Notifications
You must be signed in to change notification settings - Fork 171
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
fatal: Missing /dev/kvm on Debian testing with rootless podman #2501
Comments
Is
|
Looks like others don't have permission to
I suspect this is the cause as Fedora gives others rw- permission to |
Confirming that the following allows cosa to run on Debian:
Why are group permissions and outright device ownership insufficient for podman to be able to map in the kvm device? Is this an upstream podman issue? Would like some thoughts on this since it is puzzling to me that neither ownership nor group permissions worked. |
When running rootless container with podman, the root user inside the container will be mapped to the current user outside the container and non-root users inside will be mapped according to I don't remember the details about why Debian changed the mode on |
Is that statement accurate when doing Once I was able to get this working, I noticed some odd behavior when invoking cosa (via bash alias with podman as I documented in my initial post). Specifically, I was prompted to enter a sudo password for the 'builder' user in the container by whatever was attempting to run inside cosa. I do not understand this, and it certainly was not mentioned in any of the documentation I had read before attempting to use cosa. In the end I ended up adding a |
Oh, true, I had forgotten about that. I will have to take another look then. |
@travier any progress on this? I have a workaround but it is still puzzling to me why it didn't work when everything seemed to agree as far as permissions/users went. Any pointers for additional root causing? |
Update: the following function works on Silverblue 34.2021.1027.1 without any issue. No prompting for a sudo password when coreos-assembler runs or any need to tweak permissions to There's a slight difference in tested podman versions (3.3.1 on Debian) but I can't believe that would cause this issue. Definition:
Output from
|
Hello everyone, sorry to answer to this old issue but I kind of found a solution being rootless : Verify that your user can use KVM acceleration : $ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used Verify that your user is in the id -nG $USER | grep kvm Then modify the command to run the cosa container by adding a volume bound to the podman run --rm -ti --security-opt label=disable --privileged \
--uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap 1001:1001:64536 \
-v ${PWD}:/srv/ --device /dev/kvm --device /dev/fuse \
--tmpfs /tmp -v /var/tmp:/var/tmp --name cosa \
-v /dev/kvm:/dev/kvm \
${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \
${COREOS_ASSEMBLER_GIT:+-v $COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \
${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \
${COREOS_ASSEMBLER_CONTAINER:-$COREOS_ASSEMBLER_CONTAINER_LATEST} shell This way you might be able to run Can everyone tell me if this works and if it is the proper way to do it ? |
From
Can you give |
Yes I tried the option [coreos-assembler]$ id
uid=1000(builder) gid=1000(builder) groups=1000(builder),65534(nobody) I think it is kind of related to everyone's podman usage or environment, and not to coreos-assembler directly, as mentioned in this issue from podman : containers/podman#10166 I checked my CRI with $ podman info | yq eval '.host.ociRuntime' -
name: crun
package: 'crun: /usr/bin/crun'
path: /usr/bin/crun
version: |-
crun version UNKNOWN
commit: ea1fe3938eefa14eb707f1d22adff4db670645d6
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YA so |
Podman on Ubuntu/Debian has no maintainer, so the only version available is an older podman 3.4.2. It turns out there's a bug in podman 3.4.2 with how The solution is that when using the affected versions of podman, you need to use I personally just created my |
Thanks for the debug. I'd recommend using newer podman release via the packages listed in https://podman.io/getting-started/installation. Will close this issue as there is not much to fix on our side here. |
Bug Report
Environment
What operating system is being used to run coreos-assembler? Debian testing
What operating system is being assembled? Fedora CoreOS
Is coreos-assembler running in Podman or Docker? Podman 3.3.1
If Podman, is coreos-assembler running privileged or unprivileged? rootless; privileged
Expected Behavior
cosa should work with rootless podman when
/dev/kvm/
is present on the host since it is advertised to do so.Actual Behavior
cosa reports that
/dev/kvm
is missing because it doesn't get mounted into the container. This appears to be due to a permissions issue when podman mounts a device into a container:However, adding
--group-add keep-groups
does not resolve this issue and cosa continues to complain that/dev/kvm
is missing inside the container (because it is).Reproduction Steps
/dev/kvm
is present on the booted Debian testing system.--group-add keep-groups
per podman docs:cosa build
cc: @storrgie @jkl92
The text was updated successfully, but these errors were encountered: