Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

... (this will be moved into a separate article)

Warning

Crap... I got this working late one night and don't remember the steps now.... below steps are not quite correct... will have to reverse engineer what I got working...

 

In this example, we want to mount a shared directory from the host system to be accessible to one or more containers,

Panel
host directory = /opt/lxc/shared/lxc/my-container
container my-container confluence-share-data
the container, the directory = /opt/mount-host

...

Code Block
languagebash
cd /opt
sudo mkdir mount-host
sudo chown serveradmin:staff # make accessible to the serveradmin user and thestaff allgroup
staff
sudo shutdown -h now # shutdown the container

From the host modify the config files. In this example it is /var/lib/lxc/my-container/config and add the following line,

Code Block
languagebash
lxc.mount.entry = /opt/lxc/shared/lxc/my-container /opt/mount-hostbghost none bind.rw 0.0 

Not sure if the order matters, but I usually place under the lxc.mount entry. The bind.rw is a reference to read and write which you may adjust accordingly for example bind.ro would be read only.

...