Proxmox LXC enable nfs

Install NFS Client Utilities in the LXC Container

To interact with NFS shares, you need to install the nfs-utils package on the LXC container:

sudo dnf install nfs-utils -y

Enable and start the required services:

sudo systemctl enable nfs-server rpcbind
sudo systemctl start nfs-server rpcbind

//

Add the NFS Share to the Container’s Fstab

Edit the /etc/fstab file in the container to mount the NFS share automatically. Add the following line:

192.168.2.200:/mnt/MainPool /mnt/truenas nfs defaults 0 0

To apply changes:

sudo systemctl daemon-reload
//

By default, Proxmox might restrict certain operations for security reasons. To allow mounting, you need to modify the container’s configuration file in Proxmox:

  1. Navigate to the LXC configuration directory:
    cd /etc/pve/lxc
  2. Edit the container configuration file (e.g., 100.conf) and add:
    lxc.apparmor.profile: unconfined

This change will disable the AppArmor profile for the container, allowing it to perform tasks like mounting an NFS share.

Leave a Reply

Your email address will not be published. Required fields are marked *