Issue mounting host directory in container

I’m trying to add a directory on my host to the container:

lxc.mount.entry = /media/adrian/250/graphics home/ubuntu/graphics_shared none bind,ro,create=dir

Unlike the various other directories, this one however errors out:

  lxc-start gbox 20171024182154.271 ERROR    lxc_utils - utils.c:safe_mount:1739 - Permission denied - Failed to mount /media/adrian/250/graphics onto /usr/lib/x86_64-linux-gnu/lxc/home/ubuntu/graphics_shared
  lxc-start gbox 20171024182154.271 ERROR    lxc_conf - conf.c:mount_entry:1854 - Permission denied - Failed to mount "/media/adrian/250/graphics" on "/usr/lib/x86_64-linux-gnu/lxc/home/ubuntu/graphics_shared"

I have no idea why the script thinks that /usr/lib/x86_64-linux-gnu/lxc/ is the root. As I said, the other mounts all seem to work fine and end up in the right place.

Any suggestions welcome!

That path is normal, it’s a temporary (invisible) mount point that LXC uses and it is in fact the root of your container at that point in time.

The error most likely comes from the source path. Either this is an unprivileged container, running from a user which doesn’t have access to the source path, or the source may be on fuse or ecryptfs, both of which would cause that kind of error due to the way they handle permissions internally.

I see. I think I can rule out the user permissions and don’t use encryption there, so it might be the “fuse” thing (wasn’t familiar with that until now). I copied the directory in question to my user’s home directory for now, which works.