LoginSignup
3
8

More than 5 years have passed since last update.

lxdコンテナにホストのフォルダをマウント

Last updated at Posted at 2016-04-24

フォルダ構成

  • /var/lib/lxd/containers/コンテナ名/rootfs/{bin,boot,dev,etc,..}/

例:コンテナ名がubuntuの場合

  • /var/lib/lxd/containers/ubuntu/rootfs/

ホストのフォルダをマウント(lxcコマンド)

mkdir /media/ubuntu
chmod 777 /media/ubuntu
マウント
lxc config device add ubuntu vagrant disk \
  source=/media/ubuntu \
  path=/vagrant
  • コンテナは動作したままマウントできる。
確認
$ lxc config device show ubuntu
vagrant:
  path: /media/ubuntu
  source: /vagrant
  type: disk
root:
  path: /
  type: disk
削除
lxc config device remove ubuntu vagrant disk
3
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
8