1

I've been using the following to share a folder from my LCX host into a container:

lxc config device add containerxyz directoryname disk source=/storage/containerxyz path=/mnt/storage/

This works perfectly fine, I can have the container read and write files to the /storage/containerxyz path in the host, however I see online some people suggesting do to this instead:

lxc.mount.entry = /storage/containerxyz /var/lib/lxc/containerxyz/rootfs/mnt/storage/ none bind 0 0

Whats the practical difference between those two ways to having host directory available to the container and drawbacks of each one?

TCB13
  • 1,166
  • 1
  • 14
  • 34

1 Answers1

3

Some clarifications first: Both LXC and LXD are tools to manage Linux containers. LXC is low level, LXD is a newer, more polished containers manager.

So, lxc config is LXD's way to configure a Linux container, while lxc.mount.entry = inside container's config file is LXC's lower level way to achieve the same thing.

Apparently you use LXD, so stick with it, there's nothing wrong.

Krackout
  • 1,575
  • 7
  • 20