[lxc-users] Mounting samba/cifs for unprivileged containers

Bostjan Skufca bostjan at a2o.si
Mon Sep 1 20:49:24 UTC 2014


I am using LXC quite successfully and most of my containers are
already ported to unprivileged mode of operation (started from root,
but uidmapped).

One thing that is getting in the way are CIFS mounts.

If I mount it either via pre-start hook or via lxc.mount.entry config
variable, when container is started (container runs ubuntu) it asks
for mount password. Funny thing is, initially this samba mount is
mounted with guest and read-only mount options.

I think two things are going on here:
- when lxc sets up environment for container to run in, only "ro"
mount option is passed in, "guest" is not
- container (ubuntu) does a remount of existing share, and seeing no
"guest" mount flag it goes on and asks for password.

Does anyone have a clue how to work around this? Or will I have to
shift to using NFS?

(I tried to mount it somewhere on host and then mount --bind it into
container, same result. Credentials file: same result.)

Tnx for hints,


More information about the lxc-users mailing list