[Lxc-users] need sudo to see running containers with lxc-list?

Serge Hallyn serge.hallyn at canonical.com
Wed May 16 15:22:50 UTC 2012


Quoting nathan w (nathan at nathanewilliams.com):
> any info on why this would be? not that this is too horrible to deal 
> with, but it is confusing to have lxc-list return empty results instead 
> of an informative message that "you may not see everything" or "need 
> more permissions". maybe i'm doing something wrong? i created these as 
> standard (sudo lxc-create -t xxxxx -n xxxxx). note that the stopped 
> containers show up without root privs (weird).
> 
> $ lxc-list
> RUNNING
> 
> STOPPED
> 
> $ sudo !!
> sudo lxc-list
> RUNNING
>    debian
>    local
> 
> STOPPED
> 
> $ sudo lxc-stop -n local
> $ lxc-list
> RUNNING
> 
> STOPPED
>    debian
>    local
> 
> thanks,
> 
> Nathan W

Usually when I've seen this sort of thing it has been because some
dir along the path of /sys/fs/cgroup/$subsys/lxc/container is not
world readable.  juju-lxc for instance sets its umask right now in a
way to cause this to happen.  Overriding umask just bc some things
don't use umask right, wouldn't be right, so fixing this in lxc is
not right.  But lxc-list/lxc-ls perhaps should explicitly warn about
this.

-serge




More information about the lxc-users mailing list