Physical host file system and source build
1. Ensure Container is shutdown
2. Edit config file
$ sudo vi /var/lib/lxc/myHDP2/config
:::
# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
# Container specific configuration
lxc.rootfs = /var/lib/lxc/myHDP2/rootfs
lxc.rootfs.backend = dir
lxc.mount = /var/lib/lxc/myHDP2/fstab (Added it)
lxc.utsname = myHDP2
lxc.arch = amd64
:::
3. Edit fstab file
$ sudo cat /var/lib/lxc/myHDP2/fstab
/opt /var/lib/lxc/myHDP2/rootfs/opt none bind 0 0
4. Container power on
5. Check file system
Refer: Ubuntu 和 LXC Container 互相存取檔案
Read more: http://www.arthurtoday.com/2015/03/ubuntu-exchanges-data-with-containers.html#ixzz50XjXu0wFhttp://www.arthurtoday.com/2015/03/ubuntu-exchanges-data-with-containers.html
沒有留言:
張貼留言