[lxc-users] Problem starting trusty container on 16.04

Fajar A. Nugraha list at fajar.net
Tue May 31 03:51:46 UTC 2016


On Tue, May 31, 2016 at 8:31 AM, Mike Bernson <mike at mlb.org> wrote:

> I have create a 16.04 container on 16.04 as unprivileged container and it
> works.
>
> I then tried to create 14.04 container on 16.04 as unprivileged container
> and it does not get
> to the login prompt.
>
> If create 14.04 container privileged and start it that works.
>
>


> I have done everything as root.
>
>


> root at mike-desktop:/var/lib/lxc/lxc-1404# cat /etc/subuid
> mike:100000:65536
> root:2000000:2000001
> root at mike-desktop:/var/lib/lxc/lxc-1404# cat /etc/subgid
> mike:100000:65536
> root:2000000:2000001
>
>
>  lxc-create -n lxc-1404 -t download -- -d ubuntu -r trusty -a amd64
>  lxc-start -n lxc-1404
>  lxc-attach -n lxc-1404
>
>
Do you do this as root too?
Since you say "unprivileged", either:
- you run it as user (not root), or
- you customize it (e.g. shift uids manually)



> config file:
>
>

> # Container specific configuration
> lxc.id_map = u 0 3100000 65536
> lxc.id_map = g 0 3100000 65536
>

That is different from the lines in your /etc/sub[ug]id

It CAN work (since you have such large uid range allocated to root), but
you need to make sure your rootfs use the same uids.



> root at lxc-1404:/# ps -ax
>   PID TTY      STAT   TIME COMMAND
>     1 ?        Ss     0:00 /sbin/init
>    38 ?        S      0:00 @sbin/plymouthd --mode=boot --attach-to-session
>    45 ?        Ss     0:00 plymouth-upstart-bridge
>    49 ?        S      0:00 mountall --daemon
>   628 ?        S      0:00 upstart-socket-bridge --daemon
>  1493 pts/6    Ss     0:00 /bin/bash
>  1504 pts/6    R+     0:00 ps -ax
>
>

IIRC similar thing occured to me a while ago. Wrong uids in rootfs. Try
- ls -la /var/lib/lxc/lxc-1404/rootfs (on the host)
- ls -la / (inside the container)

If you need to shift uids manually, use fuidshift from lxd-tools package

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160531/ef79c990/attachment.html>


More information about the lxc-users mailing list