How to share a folder between containers
I want to share a directory from an OpenVZ container to another container, how I could do that? 1. do a symlink from /vz/private/109/common-stuff to /vz/private/108/common-stuff ? 2. bind mount /vz/private/109/common-stuff to /vz/root/108/common-stuff ? 3. Share the directory with samba from the container, mount on the host, then bind mount to /vz/root/108/common-stuff ?
Re: How to share a folder between containers
Easiest and best way to do this is to do like this : - create some folder on your host filesystem - bind this folder in your containers To do that, the best way is to create a <CTID>.mount in your /etc/vz/conf directory which will look like this : ============================================================ === #!/bin/bash source /etc/vz/vz.conf source ${VE_CONFFILE} mount -n --bind /common-stuff ${VE_ROOT}/common-stuff ============================================================ === Off course, /common-stuff must exist in your container but with this, /common-stuff will be automatically binded when you start your container. Regards,