I want to share a directory from an OpenVZ container to another container, how I could do that?
- do a symlink from /vz/private/109/common-stuff to /vz/private/108/common-stuff ?
- bind mount /vz/private/109/common-stuff to /vz/root/108/common-stuff ?
- Share the directory with samba from the container, mount on the host, then bind mount to /vz/root/108/common-stuff ?
OpenVZ is great at letting you share directories without the need for Samba or NFS overhead.
To see how it works do a bind mount to root (not private) when the container is running:
To make the share persistent over container reboots:
chmod +x /etc/vz/conf/108.mount
Script A
Reference: http://wiki.openvz.org/Bind_mounts
the page give by Aleksandr Levchuk give the following script
(http://wiki.openvz.org/Bind_mounts)
so it's different from the mount --bind in his solution. I've tested the above script, and it works perfecly.
from what I've seen, "SIMFS is like a separate drive space set aside for virtual containers. It's set up for machine use, and prevents one containers virtual server from crashing any of the others."
So it should be better for security reason (plus the fact that it's in the official openvz documentation). However It could be interesting to assess the performance cost of this isolation.