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

Unable to run ./run_sdk_container -t with rootless Docker #1393

Open
george-angel opened this issue Mar 15, 2024 · 2 comments
Open

Unable to run ./run_sdk_container -t with rootless Docker #1393

george-angel opened this issue Mar 15, 2024 · 2 comments
Labels
kind/bug Something isn't working

Comments

@george-angel
Copy link

george-angel commented Mar 15, 2024

Description

Attempting to run $ ./run_sdk_container -t, results in the following error:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /dev/console: permission denied: unknown

My guess is this is because Docker is running in rootless mode.

Impact

Not able to start Flatcar SDK.

Environment and steps to reproduce

  1. Running Arch Linux, with following Docker setup: https://wiki.archlinux.org/title/docker#Rootless_Docker_daemon
  2. Checkout https://github.com/flatcar/scripts and try to run $ ./run_sdk_container -t
  3. Error:
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /dev/console: permission denied: unknown

Expected behavior

No error :)

I'm guessing its to do with this mount: https://github.com/flatcar/scripts/blob/flatcar-3874/run_sdk_container#L140 . containers/podman#6772 (comment) feels like a relevant explanation, although the project is different.

@jepio
Copy link
Member

jepio commented Mar 15, 2024

We use loopback mounts from the sdk, which requires access to /dev/loop-control but also access to /dev/loopX devices as they are created by udev in the host. So unfortunately this requires access to hosts /dev and I don't think it'll work rootless.

I would be happy if someone proved me wrong.

@t-lo
Copy link
Member

t-lo commented Apr 25, 2024

Unfortunately @jepio is correct; for the same reason using podman requires sudo (which we wrap in the run_sdk_container scripts). Loopback mounts are required by build_image and image_to_vm.sh to build base OS and vendor images. That said, we're entirely open to modernising that part of our build logic by e.g. using a rootless image builder like mkosi. So if someone would want to take on this endeavour we'd be very open to it, and supportive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: 📝 Needs Triage
Development

No branches or pull requests

3 participants