Proxmox LXC Mounts
Adding NFS Bind Mounts to Proxmox LXC Containers
Prerequisites
- NFS share is accessible from the Proxmox host
- LXC container is stopped before editing its config
Part 1 — Mount the NFS Share on the Proxmox Host
Create the mount point directory:
mkdir -p /mnt/<mount-name>
Test the NFS mount manually before adding to fstab:
mount -t nfs <nfs-server-ip>:<export-path> /mnt/<mount-name>
If successful, unmount it:
umount /mnt/<mount-name>
Add the entry to /etc/fstab:
nano /etc/fstab
Add the following line:
<nfs-server-ip>:<export-path> /mnt/<mount-name> nfs rw,hard,noresvport,_netdev,x-systemd.automount 0 0
Reload and mount:
systemctl daemon-reload
mount -a
Verify:
df -h | grep <mount-name>
ls /mnt/<mount-name>
Part 2 — Add the Bind Mount to an LXC Container
Stop the container:
pct stop <vmid>
Check the existing config for current mount point numbers:
cat /etc/pve/lxc/<vmid>.conf
Look for any existing mp0, mp1, etc. lines and use the next available number.
Edit the container config:
nano /etc/pve/lxc/<vmid>.conf
Add the following line at the bottom (adjusting the mp number as needed):
mp0: /mnt/<mount-name>,mp=/mnt/<internal-path>
Start the container and verify:
pct start <vmid>
pct exec <vmid> -- ls /mnt/<internal-path>
Notes
/mnt/<mount-name>is the path on the Proxmox host/mnt/<internal-path>is where it will appear inside the container — these can be the same or different- For unprivileged containers, the NFS export on the server side should have
no_root_squashenabled, or the share set to Public, to avoid permission issues inside the container - The
mpnumber must be unique within each container's config — if a container already hasmp0andmp1, the next entry should bemp2
Output of /etc/fstab:
root@ms01:~# cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/pve/root / ext4 errors=remount-ro 0 1
UUID=8785-C25F /boot/efi vfat defaults 0 1
/dev/pve/swap none swap sw 0 0
proc /proc proc defaults 0 0
# Synology Media
192.168.2.22:/volume1/Media /mnt/syn-media nfs rw,hard,noresvport,_netdev,x-systemd.automount 0 0
# Unraid Media
192.168.2.6:/mnt/user/Media /mnt/un-media nfs rw,hard,noresvport,_netdev,x-systemd.automount 0 0