Unable to use NFS share within LXC container

balter

Member
Sep 12, 2019
12
0
21
18
I have managed to set Proxox 6.0-4 up in a virtualbox vm and have created an Ubuntu 18.04 container with which I will run Plex media server. I have also managed to get Proxmox to see my Synology NFS share (see screenshot) but I have spent 2 days attempting to attach the NFS share to the container and so far have been unsuccessful. I have set up NFS permissions on the synology to accept IP addresses from the proxmox host and the container.


mount -t 192.XXX.X.XXX:/nfs/share /container/directory

returns 'unknown file type'

mount -t nfs /home/media

returns 'mount.nfs: access denied by server while mounting.........'

All commands have been run as root. How do I complete the connection between the NFS share and the Plex container?
 

Attachments

  • nfs.png
    nfs.png
    60.8 KB · Views: 148
  • pve.png
    pve.png
    83.7 KB · Views: 143
  • datacentre.png
    datacentre.png
    70.9 KB · Views: 139
Hello, I 'm using Proxmox 5.4-13. I've tried many times to use NFS mouting inside an unprivileged container by modifying /etc/pve/lxc/CTID.conf with a new profile for apparmor : like here, or here (or a lot of other forum thread). But I couldn't get it work. I still have the message :

mount.nfs: Operation not permitted

You can find below my ct_id.conf (inside /etc/pve/lxc/):
arch: amd64 cores: 1 hostname: SRV-SCRIPT0 memory: 512 net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=8E:E8:7D:88:F3:03,ip=dhcp,type=veth ostype: debian rootfs: local-lvm:vm-105-disk-0,size=8G swap: 512 unprivileged: 1 lxc.apparmor.profile: lxc-container-default-with-nfs
The lxc-default-with-nfs file (inside /etc/apparmor.d/lxc/) :
Do not load this file. Rather, load /etc/apparmor.d/lxc-containers, which # will source all profiles under /etc/apparmor.d/lxc profile lxc-container-default-with-nfs flags=(attach_disconnected,mediate_deleted) { #include <abstractions/lxc/container-base> # the container may never be allowed to mount devpts. If it does, it # will remount the host's devpts. We could allow it to do it with # the newinstance option (but, right now, we don't). deny mount fstype=devpts, mount fstype=cgroup -> /sys/fs/cgroup/**, mount fstype=cgroup2 -> /sys/fs/cgroup/**, mount fstype=nfs*, mount fstype=rpc_pipefs, }
I know the problem doesn't come from the NFS fileshare (because I can access it from other servers and I disable it and the message changed : mount.nfs: access denied by server while mounting NFS_IP:/fileshare

The command I type is :
mount NFS_IP:/fileshare /mnt/mounting_point/

I've followed the forum thread and tutorials and restarted the CT and the host, but I can't get it to work. I've look in /var/log/messages to see if any error pops up, but nothing except boot login and shut down of the container.
I also tried rpcdebug-m nfsd all on the hypervisor but I didn't get any message.

According to you previous message, the use of privileged containers seems mandatory (I would like to know if it really is because it seems to be possible here, or here (but it was a year ago)). The other possibility would be to mount the NFS share on the hypervisor and then do a bind mount, but I want to be sure it's not possible.

Thanks for your help,
Axel.
 
I am having the same problems ....exact same error...

Yet, I can successfully mount all of the 6 physical linux machines here at home (which includes both ProxMox hosts) to a newly created NFS share on a FreeNAS box...but trying the same from any Linux VM gets a permission error ... there must be some firewall interfering ... was driving me nuts, until I started having success with the physical devices
 
Hi, same problem. Any solutions ?
I have 3 PVE and I want to share folders between LXC or VM but I don't found solutions with NFS
 
Hi, same problem. Any solutions ?
I have 3 PVE and I want to share folders between LXC or VM but I don't found solutions with NFS

I had the same problem and it was driving me nuts. What worked for me is the solution highlighted here: here.
And I had to make the container privileged too.

Hope this help you.
 
...maybe I was lucky, but I have managed to mount in the LCX container an NFS share exposed on the Host. It even went quite easily, even if I am on my first experiments on this.

I only have one question: as long as my NFS share did NOT have the parameter
no_root_squash
I kept getting the error
requested NFS version or transport protocol is not supported

Is this parameter mandatory for performing this specific technique?
 
Last edited:

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!