[lxc-users] Something changed between 1.1.2 and 1.1.4 for unprivileged containers?

Dirk Geschke dirk at lug-erding.de
Fri Oct 16 06:16:44 UTC 2015


Hi Fajar,

> > not lxd, it's plain lxc from linuxcontainers.org and compiled the
> > same way as 1.1.2. To start I use as part of init-script, started
> > by root:
> >
> >     /usr/local/bin/cgm create all ${CONTAINER}
> >     /usr/local/bin/cgm chown all ${CONTAINER} `id -u $user` `id -g $user`
> >     su - $user -c /usr/local/sbin/${CONTAINER}
> >
> > where the last line starts a shell script with the uid of the
> > unprivileged user. Here all I do is:
> >
> >    /usr/local/bin/cgm movepid all ${CONTAINER} $$
> >    lxc-start -n ${CONTAINER} -d
> >
> > So I move the user shell to the cgroups and start the container.
> > That works fine with 1.1.2, but not with 1.1.4...
> 
> su (and sudo) by default does not assign a new tty. So your user ends
> up with a tty owned by root, thus the tty-related errors.

yes and this works with 1.1.2. However, I tried it with sudo and
now the tty belongs to the user starting the container. But it 
still does not work:

  lxc-start 1444975546.122 ERROR    lxc_utils - utils.c:open_without_symlink:1575 - No such file or directory - Error examining fuse in /usr/local/lib/lxc/rootfs/sys/fs/fuse/connections
  lxc-start 1444975546.122 ERROR    lxc_utils - utils.c:open_without_symlink:1575 - No such file or directory - Error examining fuse in /usr/local/lib/lxc/rootfs/sys/fs/fuse/connections
  lxc-start 1444975546.123 ERROR    lxc_utils - utils.c:open_without_symlink:1575 - No such device or address - Error examining tty in /usr/local/lib/lxc/rootfs/dev/tty
  lxc-start 1444975546.123 ERROR    lxc_conf - conf.c:mount_entry:1731 - No such device or address - failed to mount '/dev/tty' on '/usr/local/lib/lxc/rootfs/dev/tty'

I'm a little bit irritated, shouldn't it be something like

  /home/${USER}/.local/share/lxc/${CONTAINER}/rootfs

for an unprivileged user?

Best regards

Dirk
-- 
+----------------------------------------------------------------------+
| Dr. Dirk Geschke       / Plankensteinweg 61    / 85435 Erding        |
| Telefon: 08122-559448  / Mobil: 0176-96906350 / Fax: 08122-9818106   |
| dirk at geschke-online.de / dirk at lug-erding.de  / kontakt at lug-erding.de |
+----------------------------------------------------------------------+


More information about the lxc-users mailing list