Open Nativu5 opened 1 year ago
Given this information, it's my understanding that an NFS with Xattr support, coupled with fuse-overlayfs, should enable Podman to work correctly on NFS. However, despite these conditions being met in my case, I'm still facing permission issues.
Any help would be greatly appreciated.
@giuseppe PTAL
https://github.com/containers/storage/pull/1739 should solve the problem you have seen.
There are also some other upstream fixes in fuse-overlayfs that you might need
containers/storage#1739 should solve the problem you have seen.
There are also some other upstream fixes in fuse-overlayfs that you might need
Thanks for the suggestion. I will give it a try and let you know the results.
@giuseppe I have installed the bleeding-edge version of Podman (according to https://podman.io/docs/installation#installing-bleeding-edge-versions-of-podman) and I built the master branch of fuse-overlayfs. But these permissions issues persist.
Here is my test environment info:
store:
configFile: /home/nfsuser/.config/containers/storage.conf
containerStore:
number: 1
paused: 0
running: 0
stopped: 1
graphDriverName: overlay
graphOptions:
overlay.force_mask: "0700"
overlay.mount_program:
Executable: /usr/bin/fuse-overlayfs-dev
Package: Unknown
Version: |-
fusermount3 version: 3.10.2
fuse-overlayfs: version 1.13-dev
FUSE library version 3.14.0
using FUSE kernel interface version 7.31
overlay.mountopt: nodev,metacopy=on
graphRoot: /home/nfsuser/.local/share/containers/storage
graphRootAllocated: 37748736000
graphRootUsed: 6029312000
graphStatus:
Backing Filesystem: nfs
Native Overlay Diff: "false"
Supports d_type: "true"
Supports shifting: "true"
Supports volatile: "true"
Using metacopy: "false"
imageCopyTmpDir: /var/tmp
imageStore:
number: 1
runRoot: /tmp/containers-user-1001/containers
transientStore: false
volumePath: /home/nfsuser/.local/share/containers/storage/volumes
version:
APIVersion: 4.8.0-dev-e622045af
Built: 1698879181
BuiltTime: Thu Nov 2 06:53:01 2023
GitCommit: ""
GoVersion: go1.19.13
Os: linux
OsArch: linux/amd64
Version: 4.8.0-dev-e622045af
you'd need to build it from source and vendor the last c/storage version
you'd need to build it from source and vendor the last c/storage version
I have built the Podman from source, and provided it with latest containers/storage in go.mod (github.com/containers/storage v1.50.3-0.20231101112703-6e72f11598fb
).
However, these problems are still reproducible.
store:
configFile: /home/nfsuser/.config/containers/storage.conf
containerStore:
number: 1
paused: 0
running: 0
stopped: 1
graphDriverName: overlay
graphOptions:
overlay.force_mask: "0700"
overlay.mount_program:
Executable: /usr/bin/fuse-overlayfs-dev
Package: Unknown
Version: |-
fusermount3 version: 3.10.2
fuse-overlayfs: version 1.13-dev
FUSE library version 3.14.0
using FUSE kernel interface version 7.31
overlay.mountopt: nodev,metacopy=on
graphRoot: /home/nfsuser/.local/share/containers/storage
graphRootAllocated: 37748736000
graphRootUsed: 8726249472
graphStatus:
Backing Filesystem: nfs
Native Overlay Diff: "false"
Supports d_type: "true"
Supports shifting: "true"
Supports volatile: "true"
Using metacopy: "false"
imageCopyTmpDir: /var/tmp
imageStore:
number: 1
runRoot: /tmp/containers-user-1001/containers
transientStore: false
volumePath: /home/nfsuser/.local/share/containers/storage/volumes
version:
APIVersion: 4.8.0-dev
Built: 1698925657
BuiltTime: Thu Nov 2 19:47:37 2023
GitCommit: 3ef2f139623ce213cd88117799c87ade4cc093a5
GoVersion: go1.20.6
Os: linux
OsArch: linux/amd64
Version: 4.8.0-dev
Can you try force_mask=755?
NFS doesn't honor CAP_DAC_OVERRIDE in a user namespace and that might cause the problem you are seeing
Can you try force_mask=755?
NFS doesn't honor CAP_DAC_OVERRIDE in a user namespace and that might cause the problem you are seeing
I have set force_mask
to 0755 but the issues are not resolved.
The good news is, now I can add a new user in the container and switch to it. But the permission of that user's home directory is still broken.
root@nfs-kernel:/# useradd -m test
root@nfs-kernel:/# ls -l /home/
total 0
drwxr-x---. 2 root root 93 Nov 2 14:37 test
root@nfs-kernel:/# su - test
su: warning: cannot change directory to /home/test: Permission denied
$ whoami
test
Meanwhile, the apt/dpkg is still unusable. When I tried to install openssh-client
using apt, errors seemed to jump out after these:
Setting up openssh-client (1:8.9p1-3ubuntu0.4) ...
chmod: changing permissions of '/usr/bin/ssh-agent': Value too large for defined data type
dpkg: error processing package openssh-client (--configure):
installed openssh-client package post-installation script subprocess returned error exit status 1
I believe I'm having this issue too.
A friendly reminder that this issue had no activity for 30 days.
+1
Issue Description
I am experiencing a few issues while running a rootless container using the command:
The errors seemed to be related with permission settings on NFS.
Steps to reproduce the issue
Apt/dpkg: When I try to install or update software within the container using apt/dpkg, I encounter errors.
User creation/access: In the container, creating a new user with
useradd -m userinct
and then attempting to switch to it usingsu - userinct
, results in a "permission denied" error message. For some reason, the owner of the/home/userinct
directory is being set as root incorrectly. Even after attempting to correct the owner withchown userinct:userinct -R /home/userinct
, I still receive errors.Describe the results you received
As mentioned above.
Describe the results you expected
I have tested rootless containers in a non-NFS environment and there was no problem. I am asking if there is a way to get these containers work properly on NFS?
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Environment:
NFS Details:
Additional information
Some of my investigation:
I am aware that the NFS was not supported back in 2019 (https://www.redhat.com/sysadmin/rootless-podman-nfs).
But I notice that there are some progresses (https://www.redhat.com/sysadmin/podman-rootless-overlay), which mentioned that Podman could utilized fuse-overlayfs and xattr on NFS to solve permission issues on NFS.
And another RedHat blog said that "Podman can now store data on any NFS server which supports extended attributes (xattrs)". (https://www.redhat.com/en/blog/rhel-9-delivers-latest-container-technologies-development-and-production#rhel9-nfs-container-storage)