[lxc-users] Failing to create unprivileged container due to wrong /run/user/XXX/lock directory
Serge Hallyn
serge.hallyn at ubuntu.com
Mon Jan 5 16:15:54 UTC 2015
Quoting Ranjib Dey (dey.ranjib at gmail.com):
> I was able to resolve the lock issue, today. It seems like the environment
> variable XDG_RUNTIME_DIR holds the value of that directory per-user. while
Oh, nm my last response :)
> using sudo it didn't change the directory, and still set to the login user.
> I found the correct directory using `ls -alh /run/user/*` (the one thats
> owned by the lxc user), and then manually setting the XDG_RUNTIME_DIR to
> that path. Afterwards lxc-create works.
> But now im getting a different error due to dbus, it looks like cgmanager
> call to create cgroup is failing
>
>
> lxc-start 1420309721.946 ERROR lxc_cgmanager - call to
> cgmanager_create_sync failed: invalid request
> lxc-start 1420309721.946 ERROR lxc_cgmanager - Failed to create
> hugetlb:testx
> lxc-start 1420309721.946 ERROR lxc_cgmanager - Error creating cgroup
> hugetlb:testx
>
> I have tried the cgm commands, as a different user since the user which
> needs to run lxc dont have sudo access. Following are the output
> -- ranjib at agent01:~ $ sudo cgm create all go
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> int32 1
>
> -- ranjib at agent01:~ $ sudo cgm chown all go 111 117
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
> method return sender=(null sender) -> dest=(null destination) reply_serial=1
Once you've done this it's easier to just do cgm movepid as
the 'go' user from the shell, i.e.
cgm movepid all go $$
> -- ranjib at agent01:~ $ sudo cgm movepid all go 18764
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
>
>
> Clearly the last one is failing, but im not sure why. I have installed
> libpam-systemd and reboot the server, without any effect. Also i dont know
> if the previous two cgm calls were successful, but their exit code was 0.
>
>
> any help?
Edit /etc/default/cgmanager and set 'cgmanager_opts="--debug"' there. Try
again, and then look at /var/log/upstart/cgmanager.log for info on what
happened.
More information about the lxc-users
mailing list