Launch a NFS server on Proxmox

Method 1: NFS server on LXC container

Create a priviledged LXC container with:

mount=nfs,nesting=1
apt update
apt install nfs-kernel-server

sudo mkdir -p /shared_folder
sudo chown nobody:nogroup /shared_folder
sudo chmod 777 /shared_folder

` /etc/exports

/shared_folder 192.168.1.0/24(rw,sync,no_subtree_check)

sudo exportfs -a
sudo systemctl restart nfs-kernel-server

sudo ufw allow from 192.168.100/24 to any port nfs

cat /etc/dfs/sharetab

NFS client in a priviledged LXC container

sudo apt install nfs-common
sudo mkdir -p /mnt/shared_folder_on_nfs

sudo mount -t nfs 192.168.1.2:/shared_folder /mnt/shared_folder_on_nfs

Hey. is it possible to have a nfs client inside an unprivileged lxc container ?
put shortly - this is not possible (NFS has no support for user namespaces (yet)).

Method 2: Share ZFS dataset via NFS on Proxmox

apt install nfs-kernel-server


zfs create dpool/nfs_shared_folder
zfs set sharenfs=on dpool/nfs_shared_folder
sudo chown nobody:nogroup /dpool/nfs_shared_folder
sudo chmod 666 /dpool/nfs_shared_folder

sudo mkdir -p /mnt/shared_folder_on_nfs
sudo mount -t nfs proxmox.local:/dpool/nfs_shared_folder /mnt/shared_folder_on_nfs

/etc/fstab:
proxmox.local:/dpool/nfs_shared_folder  /mnt/shared_folder_on_nfs  nfs  auto  0  0

# On nfs server:
rpcinfo -p | grep nfs
zfs get sharenfs dpool/nfs_shared_folder

# On nfs client:
rpcinfo -p 192.168.1.2
rpcinfo -T tcp 192.168.1.2 nfs
rpcinfo -T udp 192.168.1.2 nfs
showmount -e proxmox.local

References: