Mounting an NFS Share in Proxmox LXC

NFS Share in Proxmox LXC!

Harish Thangadurai
5 min readJan 17, 2024

In the previous article, we delved into the step-by-step process of converting an Unprivileged LXC into a Privileged LXC in our Home Lab.

In this article, we will be looking at the steps to mount an NFS share from our TrueNAS instance in our Proxmox LXC.

Understanding NFS:

Network File System (NFS) provides a powerful and flexible solution for sharing files between different systems on a network. It is a distributed file system protocol that allows a user on a client computer to access files over a network as if they were on local storage. NFS transforms the conventional paradigm of file sharing, enabling devices to collaborate and share resources seamlessly. It provides a standardized method for accessing files across different systems.

Key Characteristics of NFS include:

  1. Centralized Storage
  2. Cross-Platform Compatibility
  3. Efficient Data Transfer
  4. Security Measures

Why NFS in Proxmox LXC:

Mounting an NFS share in a Proxmox LXC opens up new possibilities for storage management within our Home Lab. NFS facilitates seamless file sharing across devices, and Proxmox LXC allows us to containerize applications efficiently. Also in the further articles, we will be installing various services which will use this NFS share to store the files.

Steps to Mount the NFS Share:

  • First, we need to enable the NFS share from our TrueNAS instance. For that, we first need to log in to our TrueNAS instance.
  • Now we can click on the Shares option to enable our NFS share.
  • We can now click on the Add button near the NFS shares option to add an NFS share.
  • Now we can select the path to store our data and then click on the save button to enable the NFS share.
  • We now need to enable the NFS option in our Proxmox LXC to mount this NFS share. For that, we can log in to our Proxmox instance and head over to the LXC.
  • Here we can click on the Options tab.
  • We now can click on the Features option to enable the NFS functionality.
  • We can check the box next to NFS and save the changes. We now can start the LXC to mount the NFS share.
  • After the LXC is started, we can log in to our LXC using SSH or via Proxmox Console.
  • To mount an NFS share on a LXC first we need to install the NFS client packages. We can type in the below command to install the same.
sudo apt install nfs-common
  • Generally, we will want to mount the NFS share automatically when the system boots. The “/etc/fstab” file contains the list of entries that define what will be mounted when the system gets booted.
  • To mount the NFS share automatically during boot, we will be adding an entry in this file.
  • First, we need to create a directory. The NFS share will be mounted to this directory. We can use the below command to create the same.
sudo mkdir NFS
  • Now we need to open the “/etc/fstab” file. We can type in the below command to open the same.
sudo nano /etc/fstab
  • Now we can add the following line to the file to automatically mount the NFS share along with the directory where we will be mounting the same.
  • I have used the location of the NFS folder which we created just now in the below line.

Note: We need to use the IP address of the NFS share followed by the path we selected during the NFS share creation. It would differ for you as per your IP and your path.

  • We can now restart the LXC to automatically mount the NFS share. We can also type in the below command to mount immediately without any restarts.
sudo mount NFS

Note: ‘NFS’ in the above command is the name of the folder that we created previously and the same folder that we used in the ‘/etc/fstab’ file to mount the share.

  • We can see that our NFS share has been successfully mounted in our Proxmox LXC.
  • To unmount the NFS file system, we can remove the line that we added in the ‘/etc/fstab’ file or we can type in the below command to unmount.
sudo umount NFS

Note: ‘NFS’ is the name of the folder where the NFS share gets mounted

We have now successfully looked into the step-by-step process of mounting an NFS share in our Proxmox LXC. We also looked into the command to unmount the same. The above steps also work for mounting the NFS share on any Linux-based operating system.

We now will be able to store all our files remotely in our TrueNAS instance from our LXC using this NFS share. We will be using this functionality frequently in further articles.

In this article, we have explored the process of mounting and unmounting an NFS share in our Proxmox LXC for our Home Lab!

In the next article, we will be looking into another service that we will be deploying in our Home Lab. Stay tuned for more detailed instructions on expanding our Home Labbing capabilities.

Happy Homelabbing!!!

--

--

Harish Thangadurai

👨‍💻 Automation Engineer | 🌍Tech Explorer | 🧠 Lifelong Learner