[lxc-users] unpriviledged container failing to get an IP in Ubuntu 16

Ivan Ogai lxc-users at ogai.name
Fri Sep 9 10:05:15 UTC 2016


Using a fresh installation of Ubuntu 16.

I created an unprivilaged container with:

    lxc-create -t download -n test -- --dist ubuntu --release xenial --arch amd64

Now, trying to stop it in the host with:

    lxc-stop -n test

or

    lxc-stop -n test --kill --nolock -o /tmp/log -l DEBUG

continues to have no effect, the command never finishes, and no log file is
created. The last lines from dmesg in the container are:

[ 6720.990573] INFO: task systemd:6146 blocked for more than 120 seconds.
[ 6720.990579]       Not tainted 4.4.0-36-generic #55-Ubuntu
[ 6720.990581] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 6720.990584] systemd         D ffff8803e6173b58     0  6146   6134 0x00000100
[ 6720.990590]  ffff8803e6173b58 ffff8803e606a940 ffff8804254b44c0 ffff8803e606a940
[ 6720.990594]  ffff8803e6174000 ffff88042b988888 ffff88042b988870 ffffffff00000000
[ 6720.990598]  fffffffe00000001 ffff8803e6173b70 ffffffff81829ec5 ffff8803e606a940
[ 6720.990601] Call Trace:
[ 6720.990611]  [<ffffffff81829ec5>] schedule+0x35/0x80
[ 6720.990615]  [<ffffffff8182cb12>] rwsem_down_write_failed+0x202/0x350
[ 6720.990620]  [<ffffffff81288ff0>] ? kernfs_sop_show_options+0x40/0x40
[ 6720.990625]  [<ffffffff813ff853>] call_rwsem_down_write_failed+0x13/0x20
[ 6720.990629]  [<ffffffff8182c34d>] ? down_write+0x2d/0x40
[ 6720.990632]  [<ffffffff8120fb80>] grab_super+0x30/0xa0
[ 6720.990635]  [<ffffffff81210112>] sget_userns+0x152/0x450
[ 6720.990638]  [<ffffffff81289070>] ? kernfs_sop_show_path+0x50/0x50
[ 6720.990642]  [<ffffffff812892de>] kernfs_mount_ns+0x7e/0x230
[ 6720.990646]  [<ffffffff8111858b>] cgroup_mount+0x2eb/0x7f0
[ 6720.990649]  [<ffffffff812111d8>] mount_fs+0x38/0x160
[ 6720.990653]  [<ffffffff8122d1d7>] vfs_kern_mount+0x67/0x110
[ 6720.990657]  [<ffffffff8122f9a9>] do_mount+0x269/0xde0
[ 6720.990660]  [<ffffffff8123084f>] SyS_mount+0x9f/0x100
[ 6720.990664]  [<ffffffff8182dfb2>] entry_SYSCALL_64_fastpath+0x16/0x71


Thanks for the suggestion to use LXD. Learning it together with zfs and
including them in provisioning code could take me some time though. A tutorial
for Ubuntu 16 + zfs + unprivilaged lxd like the havily mentioned "LXC 1.0: Blog
post series" by Stéphane Graber would be very helpful, heavily promote LXD
and likely reduce the traffic on simple questions on this list.


* Fajar A. Nugraha <list at fajar.net> [2016-09-09 11:34]:
> On Fri, Sep 9, 2016 at 4:04 PM, Ivan Ogai <lxc-users at ogai.name> wrote:
> 
> >
> > Update: the error mentioned below has disappeared (was it a hardware
> > failure?), but the container doesn't get an IP. Doing this in the
> > container fixes it:
> >
> >     dhclient eth0
> >
> > Is this the expected behaviour? With LXC 1 (Ubuntu 16 has LXC 2), the
> > containers were getting an IP.
> >
> >
> Some more details would be helpful. For example:
> - which template did you use?
> - what is the command line used to create the container
> - what addtional modifications, if any, that you've done to the container
> config
> 
> It's possible that one of the template is broken. If you use ubuntu
> template, try the download template.
> 
> FWIW, I highly suggest you try lxd instead. It should be simpler (in
> particular, if you want unpriv containers, which is the default), defaults
> to image-based deplyment (which is a HUGE speed improvement if you've been
> using "ubuntu" instead of "download" template in lxc), super-fast container
> creation (2nd+ container, if you use zfs or btrfs backend) thanks to
> clone-instead-of-copy.
> 
> -- 
> Fajar


More information about the lxc-users mailing list