Skip to content

vm driver: sandbox entrypoint fails with Permission denied (EACCES) although the image file is executable (v0.1.10) #6175

Backlog

Description

@xman892

Summary

On OpenShell v0.1.10 with the vm (libkrun/KVM) driver, a sandbox created from an OCI image whose entrypoint is an executable shell script reaches Ready but the entrypoint cannot be executed: the workload fails with Permission denied (os error 13). The same image runs unchanged under Docker, and the same gateway runs a stock image without problem.

Environment

  • OpenShell 0.1.10, Debian/Ubuntu package, gateway as a systemd user service, compute_driver = "vm".
  • Host: Ubuntu 24.04 x86_64 on GCP n2-standard-4 with nested virtualisation; /dev/kvm present (crw-rw---- root:kvm), operator in the kvm group.
  • Gateway config (effective):
[openshell]
version = 2

[openshell.gateway]
compute_driver = "vm"

[openshell.drivers.vm]
default_image = "ghcr.io/mobileaffairsltd/dm-agentic-plane-instance@sha256:b1757ec2…"
vcpus = 2
mem_mib = 1536
enable_bind_mounts = true
allow_driver_config = true
  • The image is built with COPY --chmod=0755 forwarder.py entrypoint.sh webapp_secrets.py /opt/ and ENTRYPOINT ["/opt/entrypoint.sh"], so /opt/entrypoint.sh is executable inside the image.

Steps to reproduce

  1. openshell sandbox create --name probe --detach --from <that digest>
    → sandbox reaches Ready, then provisioning fails with:
process error: boundary process leaf: start process supervisor
  spawn delegated workload process
    failed to spawn sandbox entrypoint process '/opt/entrypoint.sh'
    Permission denied (os error 13)
  1. Same image, but asking the sandbox to keep the shell alive and capturing the entrypoint's own error:
openshell sandbox create --name probe2 --detach \
  --from <that digest> -- \
  /bin/sh -c "/opt/entrypoint.sh > /tmp/entry.log 2>&1 & sleep 3600"

The sandbox reaches Ready and openshell sandbox exec probe2 -- /bin/sh -c 'head /tmp/entry.log' prints:

/bin/sh: 1: /opt/entrypoint.sh: Permission denied
  1. Control on the same gateway and host:
openshell sandbox create --name ok --detach \
  --from nvcr.io/nvidia/base/ubuntu:24.04 -- sleep 3600

→ Ready, openshell sandbox exec works, /bin/sh and the rest of the image behave normally.

What we ruled out

  • Not the gateway's kvm access: with the group fix the microVM boots, the supervisor network comes up (NET:LISTEN :3128) and the sandbox becomes Ready.
  • Not allow_driver_config: it is true; without it the create fails earlier, with a different message.
  • Not the image's mode bits: they are set by COPY --chmod=0755, and docker run executes the same file as PID 1.
  • Not the registry path specifically: we also tried a docker export rootfs tar (--from /path/rootfs.tar.gz), and the tar route fails the same way. A main-branch-style /bin/sh -c '... & sleep' wrapper is the only way to keep such a sandbox alive.

Expected

An executable file in the image should be executable in the microVM: sandbox create should start the image's ENTRYPOINT, and an explicit -- /path/script should spawn.

Actual

EACCES on spawn, from both the image ENTRYPOINT path and an explicit command, while the sandbox still reports Ready.

Question / ask

Is the rootfs prepared for the vm driver expected to preserve file mode bits from the OCI layers (and from a staged rootfs tar)? If yes, this looks like a defect in rootfs materialisation or in how the supervisor mounts it — possibly noexec on the mount or modes normalised during extraction. If a workaround exists (a config key, or a documented way to supply an entrypoint as an interpreter command), we would take it: we are trying to run an agent runtime as a non-root user inside the microVM, and this is the only thing blocking a production pilot.

Happy to provide the image digest, the full gateway journal, and re-run any diagnostic you want on the host.

Activity

  1. added
    state:triage-needed
    on Dec 2, 2026
  2. xman892 commented on Dec 2, 2026

    @xman892
    Author

    Follow-up evidence from the host, which narrows this to filesystem confinement rather than file modes.

    Inside a sandbox created from the image (-- /bin/sh -c 'sleep 3600'), the workload runs as uid=1000(hermes) gid=1000(hermes), and the files are world-readable and world-executable:

    -rwxr-xr-x 1001:1002 3925  /opt/entrypoint.sh
    -rwxr-xr-x 1001:1002 14110 /opt/forwarder.py
    

    Yet reading them is denied:

    head -c 40 /opt/forwarder.py   ->  Permission denied
    head -c 60 /opt/entrypoint.sh  ->  Permission denied
    

    ls on /opt works, and the mode string reports o+rx, so DAC alone does not explain it. Combined with the fact that executing the same file also returns EACCES, this looks like an LSM or a filesystem allowlist applied to the workload process (Landlock/AppArmor/seccomp-style) that does not include /opt — or an ownership mismatch: the image files are extracted as 1001:1002 while the process runs as 1000.

    Is /opt expected to be readable by the sandbox user? If the supervisor applies a path allowlist, which paths does it cover, and is there a supported way to declare additional read-only paths (for example the documented enable_bind_mounts virtiofs mount, which we have enabled but have not exercised yet)? If the extraction owner is the issue, is running the image's own USER supported?

    Reproducer unchanged: openshell sandbox create --name ep --detach --from <digest> -- /bin/sh -c 'sleep 3600' then openshell sandbox exec ep -- /bin/sh -c 'ls -l /opt; head -c 40 /opt/forwarder.py'.

  3. xman892 commented on Dec 2, 2026

    @xman892
    Author

    Correcting my earlier LSM theory — the evidence now points at UID/GID remapping during rootfs staging, and I can show it against Docker as ground truth on the same image.

    Docker, same image, same host (docker run --rm --entrypoint /bin/sh <image> -c 'id; stat -c "%u:%g %A %n" …'):

    uid=1000(hermes) gid=1000(hermes) groups=1000(hermes)
    0:0       -rwxr-xr-x /opt/entrypoint.sh
    0:0       -rwxr-xr-x /opt/forwarder.py
    1000:1000 drwx------ /home/hermes
    

    In the microVM, same image, same files:

    uid=1000(hermes) gid=1000(hermes) groups=1000(hermes)
    1001:1002 -rwxr-xr-x /opt/entrypoint.sh
    1001:1002 -rwxr-xr-x /opt/forwarder.py
    1001:1002 drwx------ /home/hermes
    

    Every path is shifted to 1001:1002 while the workload still runs as 1000. Consequences:

    • /home/hermes is 0700 and now owned by 1001, so the workload cannot enter it: cannot create /home/hermes/t.sh: Permission denied.
    • /opt/entrypoint.sh keeps o+rx but is still refused on read and exec, which is the part I cannot explain by DAC alone — unless the shift also affects the overlay's upper/lower layers.

    Questions:

    1. Is a +1 uid / +2 gid shift during staging intentional (rootless/uid-mapping for libkrun)?
    2. If intentional, what is the supported way for an image to declare its runtime uid so the rootfs and the USER agree — should we build the image expecting the shifted ids?
    3. If unintentional, this looks like the root cause of both the EACCES on /opt and the unusable home directory.

    Reproducer is two commands: docker run --rm --entrypoint /bin/sh <image> -c 'stat -c "%u:%g %n" /opt/entrypoint.sh /home/hermes' versus openshell sandbox exec <sandbox> -- /bin/sh -c 'stat -c "%u:%g %n" /opt/entrypoint.sh /home/hermes' on v0.1.10 with the vm driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:triage-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions