Shared Folders in LXC

mynamehere

New Member
Jun 10, 2018
2
0
1
45
Hey,
I don't know if I don't get it right or if I do something wrong.

Since everybody (almost) here prefers LXC over Docker I wanted to test that and created 2 Ubuntu LXCs. My main VM is running OMV4 (mostly as fileserver) and I wanted to use the containers for running different programms.
How do I share a folder between the LXC and the VM? I created a LVM type storage on the host. When I mount it in OMV it will be used 100% in the host, so I cannot use mount points in the LXC (no free space).

I shared 3 folders via NFS and that seems to work but I read mount points are the better way.

Does it work the way I want it to or am I on the wrong path? (If so I just use docker inside OMV again and it should work :) )

Thanks
 
Hi,
How do I share a folder between the LXC and the VM?
You have to use a network protocol like nfs or smb.

When you only use LXC Container you can use bind mounts, but you can not use an LVM lv as shared media.
The only possibility would be to mount the lv on the host and mount it in the LXC as bind mount.