0

How can I mount the NFS share mynfsserver.example.com:/path/to/share when running rootless Podman?

I'm running the latest released Podman as of today (8 January 2022).

$ podman --version
podman version 3.4.4
$

Linux kernel version is 5.15.12.

$ uname -r
5.15.12-200.fc35.x86_64
$
Erik Sjölund
  • 10,690
  • 7
  • 46
  • 74

2 Answers2

1

Update 2022-05-31

I'm not sure this answer is correct. I also asked a question about this in the discussion forum in the Podman Github repo.


Old answer

Support for rootless mounting of an NFS share is now supported in Podman if you are running the very latest development branches of Podman and the Linux kernel.

To mount an NFS share when running rootless Podman:

podman volume create --opt type=nfs --opt o=async --opt device=mynfsserver.example.com:/path/to/share

Unfortunately it will take a bit of time before support lands in the official packages. (Podman 3.4.4 and Linux 5.15.12 does not have support)

References:

Podman chat channel messages 6 January 2022:

Rootless mounting of NFS just got merged into upstream kernel

podman volume create --opt type=nfs --opt o=async --opt device=mynfsserver:/path/to/share 21:49 neat that it works rootless now

Erik Sjölund
  • 10,690
  • 7
  • 46
  • 74
  • Can you copy the content at those links please? If you don't have matrix set up, it's really diffiicult to access the content. – dr-jan Jun 01 '22 at 13:00
  • I added some text from the chat. Unfortunately, I haven't got it to work myself, although I haven't tried much. – Erik Sjölund Jun 02 '22 at 09:18
0

This does not answer your question directly. I can mount an NFS directory that's already mounted on the host file system with

podman run --runtime=/usr/bin/crun --group-add=keep-groups --volume=/storage/nfs/outside_dir:/in_container_dir --storage-driver overlay --storage-opt "overlay.mount_program=/usr/bin/fuse-overlayfs" --userns=keep-id -it registry.access.redhat.com/ubi8/ubi
Cavalcade
  • 157
  • 1
  • 8