How To Setup NFS Shared Storage In Proxmox

May 17, 2022 · 2 mins read
How To Setup NFS Shared Storage In Proxmox

In the video below, we show you how to set up shared storage in Proxmox using NFS

Shared storage is extremely useful for hypervisors, especially if you have a cluster of them because it improves redundancy and makes VM migrations much quicker

We use TrueNAS as an example, although other NFS servers can be used

We show how to create a user account in TrueNAS, because Proxmox will try and connect as the root user, how to create a Dataset and then create an NFS share

Then we cover how to connect Proxmox to the NFS share

Steps Taken

  1. Create a user account
    On the NFS server create a user account for Proxmox
    Proxmox will connect as root and doesn’t provide an option to change this
    But in NFS you can map the root account to an account with less rights

  2. Create a Dataset Folder
    To keep data separate and more secure, on the NFS server create a folder to be shared although in the case of TrueNAS a Dataset is better

  3. File Permissions
    When connecting to an NFS share, file permissions can override the access provided by NFS
    Change the file permissions and ownership if necessary to allow access for the user account we created

  4. Create an NFS Share
    Share the folder out using NFS
    Because Proxmox will connect as root, remap the root account and group to the user and group we created
    Ideally the root passwords would be different anyway
    This reduces the chance of elevated access through the NFS share
    However, anybody will have access if they login in as root, so use an isolated storage network
    You can limit access to certain computers using a firewall, or if performance is of greater concern, we’ll just restrict computer access on the file server itself

  5. Connect Proxmox to NFS
    Create a new NFS storage on Proxmox
    Point it to the server and NFS share
    TIP: Use the server’s IP address to avoid being locked out during a cold boot up when the DNS server is likely unavailable
    Select the content that will be stored here and limit access to certain nodes if necessary
    Change the preallocation setting if needed, although the default option to only preallocate space for Metadata is usually fine
    Change the NFS version if you like, although chances are, you can restrict this on the NFS server anyway and it will apply to all incoming NFS connections

Sharing is caring!