trying LXC for the first time best way to access remote file systems is?

mervincm

New Member
Sep 5, 2023
5
0
1
I am wondering the best approach to provide access to my remote file systems. I run into permissions issues regardless so I would like to confirm the approach to share access to files located on my trueNAS scale server. I have the file structure already setup and in use already by TrueNas scale apps.
/mnt/hddpool/data is the root folder for everything and is shared via NFS as (as "data") via CIFS. Since these are all Linux systems, my plan is to have apps in LXC use NFS.

I believe I can either directly mount each LXC to the NFS share directly, or I could mount the NFS share to the promoxmox datacenter, then use a mountpoint? to make it available in the lxc apps. neither seems to work.

If I go Datacenter-Storage-add NFS, then the NFS share shows up in Export correctly, but when I add I get a create storage failed: mkdir /mnt/vpe/TNdata/images: Permission denied at /usr/share/perl5/PVE/Storage/Plugin.pm line 1389 (500)

If I go directly to the NFS mount featured lxc, from its console install nfs-common, create a mount point folder, add the line to fstab IP:/mnt/hddpool/data /mnt/tdarr nfs defaults 0 0
then mount w mount -a I see no errors, but if I try to see the mounted share with ls -l /mnt/tdarr I see not file structure, just a permissions error.
 
Thanks for the reply. Is it correct to assume you are suggesting I do this on the PVE host, not the NAS?
 
I checked my PVE and I had /mnt/pve folder so I assume that is what you were talking about. chmod 777 /mnt/pve didn't have any impact on my ability to map NFS. I tried it recursively with chmode -R 777 /mnt/pve, but that just returned errors for the subfolders within. Operation not permitted and permission denied. it didn't like me using sudo in front of it to elevate the command either, as bash doesn't seen to support sudo.
 
If I go directly to the NFS mount featured lxc, from its console install nfs-common, create a mount point folder, add the line to fstab IP:/mnt/hddpool/data /mnt/tdarr nfs defaults 0 0
then mount w mount -a I see no errors, but if I try to see the mounted share with ls -l /mnt/tdarr I see not file structure, just a permissions error.
The default unprivileged LXCs can't mount NFS or SMB shares. That only works when creating a less secure privileged LXC and only after enabling the NFS/CIFS feature.

Is it correct to assume you are suggesting I do this on the PVE host, not the NAS?
You datastore on the NAS needs rights so UID 0 and UID 100000 can read and write to it.
 
The default unprivileged LXCs can't mount NFS or SMB shares. That only works when creating a less secure privileged LXC and only after enabling the NFS/CIFS feature.


You datastore on the NAS needs rights so UID 0 and UID 100000 can read and write to it.
I did indeed create a privileged lxc and enabled the NFS feature. I did NOT make any changes to my trueNAS scale NFS share to allow those UID any additional permissions. I suppose that is my next step. Thank you.
 
Indeed it was permissions on the TrueNas Scale NFS share. I created a new data set with wide-open permissions, and I was able to add it to my LXC as indicated above. I will tweak it to minimize permissions, but this proved where the issue was. Thanks again.

The default unprivileged LXCs can't mount NFS or SMB shares. That only works when creating a less secure privileged LXC and only after enabling the NFS/CIFS feature.


You datastore on the NAS needs rights so UID 0 and UID 100000 can read and write to it.
 

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!