Created
June 22, 2016 15:17
-
-
Save lmiphay/ce47eede69e097cb067afc8aaf15220b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# top mount point | |
/shared /shared none bind,unbindable,shared 0 0 | |
# virtual machines | |
/lxc/c1 /shared/c1 none bind 0 0 | |
/lxc/c2 /shared/c2 none bind 0 0 | |
/lxc/c3 /shared/c3 none bind 0 0 | |
/home /shared/home none bind 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is based on: https://s3hh.wordpress.com/2011/09/22/sharing-mounts-with-a-container/ | |
This is for a trusted environment only. | |
The lxc rootfs for each container is located under: /shared/c? | |
Setup: | |
1. mkdir /shared /shared/c{1,2,3} | |
2. add entries to /etc/fstab (see file excerpt) | |
3. start the lxc's | |
4. run remount-shared.sh on the host if the mount points are missing inside the lxc's | |
Step 4 appears to be required because the lxc umounts the directories during startup (possibly related to pivot root) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment