[Lxc-users] lxc-list fails silently when not run as root?

Dan Kegel dank at kegel.com
Tue Mar 5 18:25:46 UTC 2013


short story:

I'm on Ubuntu 12.04, using the default lxc, 0.7.5-3ubuntu67
lxc-list seems like a nice command, but doesn't work when not run as
root... worse, it doesn't tell you it doesn't work, it just silently
doesn't show running containers.

Is this a known issue?

long story:


lxc-ls shows my containers, and then also shows my running ones:

$ lxc-ls
testbot01-ubu1004		       testbot01-ubu1004-temp-nobuild-unique
testbot01-ubu1204-temp-g-speak-unique
testbot01-ubu1004-temp-g-speak-unique  testbot01-ubu1204		
testbot01-ubu1204-temp-nobuild-unique
testbot01-ubu1004-temp-g-speak-unique
testbot01-ubu1004-temp-nobuild-unique
testbot01-ubu1204-temp-g-speak-unique
testbot01-ubu1204-temp-nobuild-unique

But lxc-list doesn't show my running ones:
$ lxc-list
RUNNING

FROZEN

STOPPED
  testbot01-ubu1004
  testbot01-ubu1204

Running $ sh -x /usr/bin/lcx-list shows the problem:

$ lxc-info -n testbot01-ubu1004-temp-g-speak-unique
lxc-info: failed to get state for
'testbot01-ubu1004-temp-g-speak-unique': Permission denied

And running as root works:
$ sudo lxc-list
RUNNING
  testbot01-ubu1004-temp-g-speak-unique
  testbot01-ubu1004-temp-nobuild-unique
  testbot01-ubu1204-temp-g-speak-unique
  testbot01-ubu1204-temp-nobuild-unique

FROZEN

STOPPED
  testbot01-ubu1004
  testbot01-ubu1204




More information about the lxc-users mailing list