Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to mount a folder from lxc

Tags:

mount

ubuntu

lxc

I have the lxc, it has a running application. To edit the code of this application on own computer(Ubuntu 13.10), I want to mount a directory lxc. How can this be done?

for example

/var/lib/lxc/ubuntu_12_04/rootfs/home/

mounted in /mnt/lxc

like image 986
Greg Eremeev Avatar asked Oct 21 '22 11:10

Greg Eremeev


1 Answers

If you want to mount automatically a directory inside the lxc each time you start the lxc you can use the lxc.mount.entry directory inside /var/lib/lxc/ubuntu_12_04/config file. With Something like:

lxc.mount.entry = /mnt/lxc home/ none bind 0 0

This will mount /mnt/lxc inside the lxc root filesystem aka rootfs at home/ directory.

like image 100
amirouche Avatar answered Oct 23 '22 02:10

amirouche