This example mounts a read-only Media share to the Promox hosts and bind mounts the volume to an LXC container running a Plex Media Server.
- Open a shell on the Proxmox node
- In the /root create a file called cifs_credentials.
- Inside the file place the username and password for the share in the following format:
username=USERNAME
password=PASSWORD
- Make the credential file only accessible to the owner (root):
chown 600 /root/cifs_credentials
- Add a new entry to
/etc/fstab
to mount the share on boot. Omit thero
option if you wish to the node to have write permissions to the share.
//SERVER_HOST/Media /mnt/Media cifs ro,vers=3.0,credentials=/root/cifs_credentials,iocharset=utf8,nofail 0 0
- Bind mount the CIFS share to the container running Plex:
# In the container configuration file: /etc/pve/lxc/CONTAINER_ID.conf
lxc.mount.entry: /mnt/Media mnt/Media none ro,bind,optional,create=dir 0 0
The Media share will now be available within the Plex container with read-only access. If write access is required you will need to remove the ro
option from the mount.entry command and add the appropriate idmap
configuration to have the Plex user in the container map to a user with access to the share on the host system.