Mount NFS share on host and create a mount point in a unprivileged container

Veles

New Member
Dec 15, 2022
9
1
3
So I have a trueNAS VM that handles my NFS. I also have an LXC-unprivileged container with Jellyfin etc. I want to be able to mount the NFS inside the container to use as media storage. NO w from what I have read mounting NFS shares in privileged containers is currently not possible. The solution is to mount it on the host and the create a mount point in the container.

Is there a predefined way of doing this? If I try to add the NFS via UI I have to select the type of files Proxmox will save on it (ISO, Backup, etc.), but I do not want that - I just want to use it as a general NFS share.
 
Last edited:
You should be able to mount nfs shares within a privileged lxc container as long as you have the appropriate nfs packages and tick options>features>nfs in the container interface

if you want to use a bind mount on a privileged container, you can use pct set xxx -mpY /mnt/on/host,mp=/mnt/in/container within the host shell. Where "xxx" is the container id number, and "Y" is your mountpoint number

If you want to use bind mounts on an unprivileged container see link
 
Sorry meant unprivileged (edited the title). I know how to create the bind mounts, as I used them to bind an HDD in the system directly. The best way to do the NFS setup on the host eludes me.
 
Last edited:
In this case my understanding is you would use pvesm in the host.
It would look something like "pvesm add nfs nameofnfs share --server xxx.xxx.xxx.xxx --export /share/on/truenas"

If you want it accessible on the GUI interface, I don't believe the gui currently has the ability to function as general upload storage
 
Last edited:
Is this persisted after reboots etc.?
I also see it defaults creating it as VM Disk content type - is there no way to mount an NFS share that does nothing for Proxmox in terms of storage?
 
Last edited:
It should persist. pvesm is the same command as what is happening when you add nfs storage in the gui. it is stored in /etc/pve/storage.cfg. With this said, you could just add nfs storage via the gui since in either case it wants some sort of content type to associate with in the datacenter(with cmdline it defaults out as vm disk). If you dislike having an additional folder for a content type created in the NAS then creating it via commandline should avoid that

I did make an account just to learn this and try to answer your question while reading the manual, let me know if it works for you or if I've totally misunderstood the question. Your scenario is basically the same as mine, using jellyfin and nfs storage(mine is synology, but same concept) so I took the opportunity to try to learn and share.
 
Last edited:
Thanks arita for the help, I managed to set it up as you suggested.
 
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!