Skip to content

Distrobox Container Fails with OCI permission denied via Flatpak App (Feature Request: Add Path Validation & GUI Error Recovery) #109

@srkrishnan2012-sys

Description

@srkrishnan2012-sys

Describe the bug
When creating a Distrobox container using DistroShelf, setting a custom home directory using the file picker causes the container initialization to fail.

The Flatpak document portal exposes a sandboxed virtual path (/run/user/1000/doc/...) instead of the true host path. The container runtime (crun) cannot stat this virtual directory, throwing an OCI permission denied error and crashing the startup sequence.

Steps to reproduce

  1. Create a Distrobox container named test1 with standard settings (Base image: ubuntu:22.04, init enabled, default home directory). This works perfectly.

  2. Create a second container named test2 with the exact same configuration, but toggle Custom Home Directory on.

  3. Use the GUI file picker to select a folder inside the host's Documents directory.

  4. The GUI maps the text path to something like /run/user/1000/doc/329d4b19/test2.

  5. Attempt to start the test2 container.

Actual behavior / Logs
The container fails immediately with the following background log:

Error: unable to start container "89587a348a9818085889627442c68e126380967b13efbede55eefefa565d492c": crun: cannot stat /proc/self/fd/149: Permission denied: OCI permission denied

Proposed Enhancement: Expected Behavior for DistroShelf
To handle this smoothly, DistroShelf should actively check for these path restrictions and provide a native GUI error step rather than failing silently or printing raw runtime logs.

  1. Internal Application Logic (The Check)
  • Pre-flight Path Check: When the user clicks "Create" or "Start", DistroShelf should inspect the string in the home directory field. If the path begins with /run/user/, it should flag it immediately as a virtual portal path.
  • Runtime Fallback Check: If the string check is bypassed, DistroShelf should listen to stderr from the container runtime. If it catches strings containing crun: cannot stat or OCI permission denied, it should intercept the crash window.
  1. Proposed GUI Window Layout
    When an invalid sandboxed path or an OCI permission failure is caught, DistroShelf should display an informative modal popup window:
Image

Screenshots

  • Container Config Setup:
Image
  • Raw Error Crash:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions