Changes

no edit summary
#Log into your Container as root
##Create the a mount point directory##*''with <pre>mkdir /mnt/extfolder''</pre>
##Log out of the container and stop the container
#Log into your Host Machine as root
##if necessary, create a credentials file with the username and password for your network share. Then secure the file.##*''<pre>nano /root/.credentials/my-credentials''</pre>###add the following lines##*''<pre>username=theusername''&##*''10;password=thepassword''#&#*''10;workgroup=theworkgroup''</pre>###Exit nano and save your changes##*by hitting '''Ctrl-X''##*' and then '''Y'''##*''run <pre>chmod 600''/root/.credentials/my-credentials</pre>##create the target mount folder##*''by running <pre>mkdir /mnt/netfolder''</pre>##Add a line to your fstab file to mount the network share##*''by running <pre>nano /etc/fstab''###add </pre> and adding the following line##*''to the bottom <pre>//net/path/to/netfolder /mnt/netfolder cifs user,credentials=/root/.credentials/my-credentials,iocharset=utf8,noperm 0 0''</pre>##Bind the host directory to the container directory in the container config#*''by running <pre>nano /etc/pve/nodes/hostname/lxc/mycontainer.conf''##add </pre> and adding the follow following line after '''memory''' and before '''net0''#*''<pre>mp0: /mnt/netfolder,mp=/mnt/extfolder''</pre>#Restart the client and the network share should be accessible at '''/mnt/extfolder'''
[[Category: Linux]]