NFS Server impossible to figure out

RobertusIT

Member
Jul 13, 2021
68
0
11
38
Hi,

I need to setup an LXC privileged container, that have 4 mounted folder, to share with another LXC container privileged.

I tried everything and doesn't works.
In the OTHER LXC, folder are empty.
I waste 2 days without any solution.
Please don't tell me to mount in the host, because I use a wireguard VPN inside the LXC CT that should be an NFS SERVER, so I don't want to mount nothing on the host.

LXC NFS SERVER CONFIG
Code:
root@AEROFARA:~# cat /etc/pve/lxc/115.conf
arch: amd64
cores: 12
features: fuse=1,mount=nfs;cifs,nesting=1
hostname: NFS
memory: 1024
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:42:98:30,ip=dhcp,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:vm-115-disk-0,size=4G
swap: 512
lxc.apparmor.profile: unconfined

etc/fstab of LXC NFS SERVER CONFIG
Code:
192.168.178.99:/   /mnt/TEMP1      nfs     auto,x-systemd.automount,nofail,noatime,nolock,tcp,actimeo=0,bg,retry=10,_netdev       0       0
192.168.178.199:/ /mnt/MAIALO2            nfs     auto,x-systemd.automount,nofail,noatime,nolock,tcp,actimeo=0,bg,retry=10,_netdev       0       0
192.168.178.99:/        /mnt/TEMP2    nfs     auto,x-systemd.automount,nofail,noatime,nolock,tcp,actimeo=0,bg,retry=10,_netdev       0       0

example of what folder mounted contain of LXC NFS SERVER CONFIG
Code:
root@NFS:~# ls -la /mnt/TEMP1
total 28
drwxrwxrwt 4 root root    80 Oct 17 10:43 .
drwxrwxrwx 6 root root  4096 Oct 19 11:10 ..
drwxrwxrwx 7 root root 12288 Oct 18 14:36 TEMP1
drwxrwxrwx 8 root root  4096 Oct 16 13:27 ex60

/etc/exports of LXC NFS SERVER CONFIG
Code:
/mnt/TEMP1 192.168.178.31(ro,sync,no_subtree_check,no_root_squash,fsid=0)
/mnt/TEMP2 192.168.178.31(ro,sync,no_subtree_check,no_root_squash,fsid=1)
/mnt/MAIALO2 192.168.178.31(ro,sync,no_subtree_check,no_root_squash,fsid=2)
/mnt/ex60 192.168.178.31(ro,sync,no_subtree_check,no_root_squash,fsid=3)





OTHER LXC
Code:
root@AEROFARA:~# cat /etc/pve/lxc/111.conf
arch: amd64
cores: 8
features: fuse=1,mount=nfs;cifs,nesting=1
hostname: PLEX
memory: 11264
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=C6:2B:3C:DE:11:4C,ip=dhcp,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:vm-111-disk-0,size=106G
startup: order=8
swap: 1024
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.cgroup2.devices.allow: c 212:* rwm
lxc.autodev: 1

/etc/fstab
Code:
192.168.178.164:/mnt/ex60     /mnt/GIANNI-ROBY-NAS/ex60    nfs     rw,noatime,nolock,tcp,actimeo=0,retry=10,nofail,_netdev    0    0
192.168.178.164:/mnt/TEMP1    /mnt/GIANNI-ROBY-NAS/TEMP1   nfs     rw,noatime,nolock,tcp,actimeo=0,retry=10,nofail,_netdev    0    0
192.168.178.164:/mnt/TEMP2    /mnt/GIANNI-ROBY-NAS/TEMP2   nfs     rw,noatime,nolock,tcp,actimeo=0,retry=10,nofail,_netdev    0    0
192.168.178.164:/mnt/MAIALO2  /mnt/GIANNI-ROBY-NAS/MAIALO2 nfs     rw,noatime,nolock,tcp,actimeo=0,retry=10,nofail,_netdev    0    0
 
My advice is to try it with two VM's. If you can make it work with two VM's then it has to be an LXC issue with app armor or something similar. Then try it with one VM and one LXC. Maybe one with the server on the VM, and maybe a second trial with the target on the VM and the server on the LXC.

By the way, why run all of this in containers? You really won't save all that much in system resources, TBH.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!