-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
/dev cannot be mounted when rootless podman-run started with -t option. #6772
Comments
Still happens with podman 2.0.0: 11:15 $ podman version
Version: 2.0.0
API Version: 1
Go Version: go1.14.3
Built: Thu Jan 1 10:00:00 1970
OS/Arch: linux/amd64 ✔ /usr/local/src/firecracker [issue-1973 L|✚ 1…1]
11:15 $ tools/devtool test -- --ignore integration_tests/performance
[Firecracker devtool] 2020-06-26 01:15:29 UTC
[Firecracker devtool] Starting test run ...
Error: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"open /dev/con
sole: permission denied\"": OCI runtime permission denied error
Error: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"open /dev/con
sole: permission denied\"": OCI runtime permission denied error |
Why do you need all of /dev mounted into the container? Do you need a specific device? The issue is /dev/console is ls -l /dev/console Which means that the inside of a non root process is not allowed to write to it. As a non root user if I do: $ echo hello > /dev/console So if I do this in the container I will get the same thing. Without the -t option podman and the oci (crun, crun) do not create /dev/console $ podman run fedora ls -l /dev/console If you use the -t option, they create the console $ podman run -t fedora ls -l /dev/console If you volume mount in /dev of /dev/console it is the unwritable one $ podman run -v /dev:/dev fedora ls -l /dev/console When podman attempts to create the /dev/console on top of a unwriteable object $ podman run -v /dev:/dev -t fedora ls -l /dev/console |
Thanks for that breakdown @rhatdan.
I'm still coming to grips with the build infrastructure, so can't offer more than "To be compatible with the parameters/options passed to Docker". From your description the first thing to try is removing the Standby... |
Updated For those following at home, we're still on Podman 2.0.0... Removing $ /usr/bin/podman run --user 1000:1000 --workdir /firecracker -i --rm --volume /dev:/dev --volume /usr/local/src/firecracker
:/firecracker:z --env OPT_LOCAL_IMAGES_PATH=/firecracker/build --env PYTHONDONTWRITEBYTECODE=1 fcuvm/dev:v16 cargo build --target-dir /firecracker/build/cargo_target --target x86_64-unknown-linux-musl
Error: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linu
x.go:378: setting rlimits for ready process caused \\\"error setting rlimit type 7: invalid argument\\\"\"": OCI runtime err
or Removing So interestingly, dropping all the cruft and just trying to run this image we get the "error setting rlimit type 7: invalid argument" error: $ /usr/bin/podman run --rm -it fcuvm/dev:v16 bash
Error: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linu
x.go:378: setting rlimits for ready process caused \\\"error setting rlimit type 7: invalid argument\\\"\"": OCI runtime err
or In turn the "error setting rlimit type 7: invalid argument" led to issue #5526 and this workaround (?) that gets us started: $ /usr/bin/podman run --ulimit nofile=1048576:1048576 --rm -it fcuvm/dev:v16 bash
root@e8ca9f3e8e17:/firecracker# Looking at the Dockerfile there does not seem anything too funky. So is
|
@rhatdan we believe we can now answer you question:
The dev sharing appears to allow the group ID to be 'found'. $ /usr/bin/podman run \
--userns=keep-id \
--user $(id -u):$(id -g) \
--workdir /firecracker --interactive --tty \
--ulimit nofile=1048576:1048576 \
--rm \
--volume /usr/local/src/firecracker:/firecracker:z \
--env OPT_LOCAL_IMAGES_PATH=/firecracker/build \
--env PYTHONDONTWRITEBYTECODE=1 fcuvm/dev:v16 bash
groups: cannot find name for group ID 1000
1000@82d566fd503c:~$ |
In case anyone else encounters this issue: We got a rootless and privilege-free run working by:
Because we are retro fitting Podman to a workflow (script) using Docker we introduced a I believe the instructions below will work with Docker (minus Otherwise it appears this issue is closed by: /usr/bin/podman run \
--userns=keep-id \
--user $(id -u):$(id -g) \
--workdir /firecracker \
--interactive \
--ulimit nofile=1048576:1048576 \
--rm \
--volume /usr/local/src/firecracker:/firecracker:z \
--env OPT_LOCAL_IMAGES_PATH=/firecracker/build \
--env PYTHONDONTWRITEBYTECODE=1 \
fcuvm/dev:v16 \
cargo build --target-dir /firecracker/build/cargo_target --target x86_64-unknown-linux-musl |
Great @bbros-dev I am glad you found a workaround. There are issues to be handled because of rootless support. |
/kind bug
Description
We are in the process of refactoring the Firecracker build scripts to use Podman (or Docker)....
Unfortunately, it looks like we've hit this prior reported issue in the container run code here, obviously with
podman
in place ofdocker
(wrapped):The OpenSuse repo is not yet updated to 2.0.0.
Any insight into whether 2.0.0 would fix this issue?Update: Issue still present with v2.0.0
One selling point to get the changed merged is the code path stays the same regardless of which OCI engine a user has installed for them.
Obviously we don't want to then have to justify introducing a bug workaround when trying to make Docker optional.
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
No error.
Additional information you deem important (e.g. issue happens only occasionally):
Reproducible
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.):
Physical
The text was updated successfully, but these errors were encountered: