The standard, most secure best practice in Proxmox is a two-step process: Mount the SMB share on the Proxmox Host itself, and then pass that directory into the container using a Bind Mount.
Mount the SMB Share on the Proxmox Host
We need to get the network drive attached to your main Proxmox node.
Install required utilities
apt update
apt install cifs-utils -y
Create a directory on the Proxmox host where the share will live.
mkdir -p /mnt/pve_smb
Create a hidden file to store your username and password so they aren’t written in plain text in your configuration files.
nano /root/.smbcreds
- Add your credentials to the file
username=your_smb_username
password=your_smb_password
domain=your_domain_or_workgroup (optional)
Secure the file so only the root user can read it
chmod 600 /root/.smbcreds
Add the share to /etc/fstab. This ensures the SMB share mounts automatically when the Proxmox host reboots.
nano /etc/fstab
Add the following line to the bottom
Note on Permissions: By default, Proxmox uses unprivileged containers. These containers offset user IDs by 100000 for security. To ensure the root user inside your container has read/write access to this share, we force the mount on the host to be owned by UID/GID 100000.
//<SERVER_IP>/<SHARE_NAME> /mnt/pve_smb cifs credentials=/root/.smbcreds,uid=100000,gid=100000,file_mode=0775,dir_mode=0775,iocharset=utf8 0 0
Mount the drive
mount -a
Verify it’s mounted by checking the contents: ls -la /mnt/pve_smb
Bind Mount the Directory to the LXC
Now that the host can see the files and ownership is mapped to 100000, you can pass it through to the container.
Add the bind mount You can do this using the pct command. You will need your container ID (e.g., 104). Run this on the Proxmox host:
pct set 104 -mp0 /mnt/pve_smb,mp=/mnt/container_smb
104: Replace with your LXC’s ID.
-mp0: This is “mount point 0”. If you already have an mp0 in your config, use -mp1, -mp2, etc.
/mnt/pve_smb: The directory on the Proxmox host.
mp=/mnt/container_smb: The path where you want the files to appear inside the container.
Restart your LXC to apply the configuration
pct reboot 104
Verify Inside the Container
Open the console for your LXC container in the Proxmox Web UI (or SSH into it). Check if the directory exists and has the correct contents:
ls -la /mnt/container_smb
Create a test file to ensure you have write permissions:
touch /mnt/container_smb/test.txt
If the file creates successfully, your unprivileged LXC is now seamlessly reading and writing to your network SMB share.