如何从lxc挂载文件夹 [英] how to mount a folder from lxc

查看:835
本文介绍了如何从lxc挂载文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有lxc,它有一个正在运行的应用程序. 要在自己的计算机(Ubuntu 13.10)上编辑此应用程序的代码,我想挂载目录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?

例如

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

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

安装在/mnt/lxc中

mounted in /mnt/lxc

推荐答案

如果您希望在每次启动lxc时自动在lxc中安装目录,则可以使用/var/lib/lxc/ubuntu_12_04/config文件中的lxc.mount.entry目录.带有类似的东西:

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

这会将/mnt/lxc安装在home/目录下的lxc根文件系统(也称为rootfs)内.

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

这篇关于如何从lxc挂载文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆