[SOLVED] access VM (NAS) storage from LXC

Jan 20, 2017
21
2
3
58
Louisiana
Hey everyone, need some help in trying to figure this out as I have been banging my head on my keyboard for a week now trying to resolve my issue.

The app I am running is a simple light weight program that preforms a single function with no user interactions and I have it configured to run as a service so it always starts upon boot of the server. To save on and perform better resource management, I have the app running in an LXC. The app needs to save data somewhere, so I'd like to have it be able to access the NAS I have running in another VM on my PXE server.

Since both my app and the NAS are running on Linux OSes, I figured the best method to connect my app to the NAS VM would be via NFS. I have been searching on this forum and on the interwebs, have read about mount points, bind mount points and all kinds of other write ups on NFS only to not find a solution that works, or at least that my n00b understanding can figure out.

So this is where I am looking for input on either how to make NFS work (preferred) in this setup or recommendations on another method for my app to save data on my NAS.

NOTE: the app can only save to a path, there are no options for connecting to network services. Therefore I am assuming my solution is limited to the use of MOUNT.

My setup:
1) single Proxmox server
** PVE01, IP10.10.10.100

2) Debian8 VM with NAS software installed (OpenMediaVault)
** ID120, IP10.10.10.120
** passthrough four 4TB disks to ID120
** setup RAID of those disks in ID120 via the NAS software
** configured NFS share via NAS software
** NAS software uses NFSv4

3) Debian8 LXC with an application running as a service
** ID130, IP10.10.10.130
** need to access NAS (ID120) for storage
** installed nfs-common

I have tried to configure a bind mount for LXC (ID130):
* on ID120 (NAS/NFS Server)
** created NFS share via software named nfsshare
** /etc/export = /export/nfsshare 10.10.10.0/24(fsid=1,rw,no_root_squash,no_subtree_check,insecure)

* on PXE01
** /etc/pve/lxc/130.conf = mp0: 10.10.10.120:/nfsshare, mp=/mnt/nfsshare

* on ID130 (LXC/NFS client)
** created folder /mnt/nfsshare
** /etc/fstab = 10.10.10.120:/nfsshare /mnt/nfsshare nfs rw,async,hard,nodev,nosuid,intr 0 0

and I keep getting mount.nfs: access denied by server while mounting 10.10.10.120:/nfsshare
* I have tried with /export/ included and removed in the various files and get same result

Thanx for reading this looong post, and any help is much appreciated.
 
Last edited:
Hello, before i read your post... are you sure? IPv4 max 10.10.10.255.
o_O LOL You got me, what was I thinking when I wrote that ;)

I was just syncing ID&IP numbers for illustration and to make easy to follow, those are not my real IPs obviously, I'll correct my original post.

Thanx for pointing it out :cool:
 
Last edited:
Reading back over my post, let me add;

I have also read the NFS restrictions that Proxmox has implemented, and understand why they don't want to allow an NFS connection back to the main PXE volume, but I am not trying to map there, I am trying to get to a VM instead.

I also read where apparmor can be shutdown, but I do want to keep security in place and not make my system more vulnerable than it needs to be.

Thank again for your input.
 

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!