Skip to content

runtime: KataHostSharedDir should be created under /run/user/<uid>/ in rootless VMM mode #11526

@StevenFryto

Description

@StevenFryto

Description of problem

When running Kata Containers in rootless VMM mode, the runtime incorrectly creates the katahostshareddir under the global path /run/kata-containers/shared/sandboxes/ , instead of under the user-specific runtime directory /run/user/<uid>/kata-containers/shared/sandboxes/ .
I reproduced the issue using the following configuration and command to start a rootless VM:

➜  crictl_pods_rootless cat sandbox.yaml                                  
metadata:
  attempt: 1
  name: test-pod-rootless
  namespace: default
  uid: hdishd83djaidwnduwk28bcsb
log_directory: /tmp
linux:
  namespaces:
    options: {}
➜  crictl_pods_rootless sudo crictl runp --runtime=kata sandbox.yaml
49d2f3d5aac6de56fac78def7ba95511470ca31c7ef88e48e2bd9410467e46db

After this, I observed that the runtime created the shared directory at:

root@kata-szt-vm:/run/user/1011/run# ls
vc
root@kata-szt-vm:/run/user/1011/run# cd /run/kata-containers/
root@kata-szt-vm:/run/kata-containers# ls
shared

Expected result

In rootless VMM mode, all runtime-specific files (like the shared directory used for 9pfs or virtiofs) should reside under the user's runtime directory:

/run/user/<uid>/kata-containers/shared/sandboxes/<sandbox-id>/

Actual result

The directory is created globally, as if in rootful mode:

/run/kata-containers/shared/sandboxes/<sandbox-id>/

Further information

Kata Containers survey

Please consider taking the survey to help us help you: https://openinfrafoundation.formstack.com/forms/kata_containers_user_survey

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behaviourneeds-reviewNeeds to be assessed by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions