How to setup NFS

batou069

New Member
May 27, 2022
5
1
3
Hi

My current Proxmox setup is pretty simple. My tower has 1 sdd drive (sda) where proxmox is installed, and a 2nd hdd (sdb) that has as NTFS partition and already existing data.
I added sdb2 as a 'directory' in Proxmox to host ISOs & CT templates under /mnt/Files
I also put there every VMs & CTs storage.
When creating a CT I add
Code:
mp0: /mnt/Files/data,mp=/data
and for docker I add
Code:
mp1: /mnt/Files/docker,mp=/var/lib/docker/

I'd like to share /mnt/Files/Media/Music as an NFS Folder so that I can listen to Music from my Laptop when WFH, alternatively /mnt/Files/NFS and create a soft(or hard?) link to /mnt/Files/Media/Music .

I obviously don't want to host the NFS drive from my Proxmox host directly and I don't own a NAS which would make life easier.
The options I think I have are:

Creating a CT and hosting a NFS server from docker
From my research this looks not like a great idea for several reasons:
- Docker from a CT is not recommended, even though I do it and it works fine for my needs
- In order to get NFS working from Docker I'd need to create a privileged CT

Creating a VM and hosting a NFS server from there directly, or with Docker
The only issue I have here that I didn't understand how to mount /mnt/Files to a VM.
The only option I found searching online was to mount a NFS Folder to a VM, but I don't have an NFS Server or Folder, I want to create one :)

Another options I thought of abstractly which may work (but not sure) is:
1. Creating a new ext3 partition with the free space I have in sdb
2. mounting to host, moving my files, unmount it again
3. passing it through or mounting it to some VM with either some NAS OS (TrueNAS, OMV,...) or just some linux
4. sharing the media folder via NFS

What do you think my options are?
Thanks!
 
If I understood correctly, just setup the NFS server on the Proxmox host itself instead of in a VM/CT.

Alternatively, instead of passing through a partition from sdb, simply add a second disk to the VM big enough to fit all your data and move it from /mnt/Files/Media/Music to the second disk inside the VM. Then setup NFS in the VM and share that second disk (or any subdirectory inside it).
 
If I understood correctly, just setup the NFS server on the Proxmox host itself instead of in a VM/CT.
Is hosting NFS on Proxmox advisable?
...simply add a second disk to the VM big enough to fit all your data and move it from /mnt/Files/Media/Music to the second disk inside the VM.
Do you mean a virtual disk or a new separate physical disc?
And how would I move files from the host to a virtual disc or a physical disc thats passed through to an VM? I thought that once passed through it's not accessible anymore from the host?
 
Last edited:
No reason not to install NFS on the host and it's the simplest solution

Otherwise, just spin up a container (don't need docker), use a mountpoint (share only needs read access) and install nfs
 
Do you mean a virtual disk or a new separate physical disc?
And how would I move files from the host to a virtual disc or a physical disc thats passed through to an VM? I thought that once passed through it's not accessible anymore from the host?
A virtual disk. Use something like sftp or FTP to copy files from the /mnt/Files/Media/Music on Proxmox to the VM.

Adding services on the Proxmox host may not be desirable, as you will be exposing a service in the host which might have a security flaw and might be an attack vector to your host, but sometimes is the only option for some given requirements ;)

I would just spin a VM, get NFS in it and copy the data I want to serve.