<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">I am having the same issue.<br>
<br>
After an<br>
<blockquote><i>sudo su - lxc</i><br>
</blockquote>
I try using<br>
<blockquote><i>lxc-create</i><br>
</blockquote>
. I get<br>
<blockquote><i>lxc-create: Permission denied - failed to create
directory '/run/user/1000/lock/'</i><i><br>
</i></blockquote>
which is the uid of the "logged in" user. I am writing up
instructions to host a how-to on my blog and can not find any
clues as to a solution.<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div class="moz-signature"><br>
<hr style="height: 1px;"><br>
</div>
On 12/27/2014 10:54 PM, Ranjib Dey wrote:<br>
</div>
<blockquote
cite="mid:CAJaqg6_g8AYx5jnaS1YRwu+2ZX_na4Qan3PTrwmd-yyyszEwcg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>Hi list,</div>
<div>Im trying to create an unprivileged container on ubuntu
14.04 with lxc 1.0.6. The user(named `go`) which will
create containers is a CI agent (GoCD, its like jenkins).
After installing the CI software, i am manually adding
subuid and subgid using the usermod -a -g file. I have also
created the appropriate /etc/lxc/lxc-usernet and othet
configurations. When i try to create a container from the
download template it fails. The first error shows that it
tries to create a lock directory in a folder owned by wrong
user. Note, my login user is different, and im using `sudo
su - go` to become the user. I tried doing the cgm trick as
well (cgm create all .., cgm chown all ..), without much
luck. </div>
<div><br>
</div>
<div><br>
</div>
<div>go@host01:~$ lxc-create -o test.log -l debug -n test -t
download -- -d ubuntu -a amd64 -r trusty</div>
<div><br>
</div>
<div>lxc-create: Permission denied - failed to create
directory '/run/user/1001/lock/'</div>
<div>WARN: could not reopen tty: Permission denied</div>
<div>WARN: could not reopen tty: Permission denied</div>
<div>WARN: could not reopen tty: Permission denied</div>
<div>lxc-create: Error opening
/tmp/111/lxc//var/go/.local/share/lxc/test</div>
<div>lxc-create: failed to save starting configuration for
test</div>
<div>lxc-create: Error creating container test</div>
<div><br>
</div>
</div>
<div><br>
</div>
<div>Following is the content of the test.log</div>
<div><br>
</div>
<div>
<div>lxc-create 1419737316.440 ERROR lxc_utils - Permission
denied - failed to create directory '/run/user/1001/lock/'</div>
<div>lxc-create 1419737316.440 WARN lxc_log - lxc_log_init
called with log already initialized</div>
<div>lxc-create 1419737316.440 INFO lxc_confile - read uid
map: type u nsid 0 hostid 3311264 range 65537</div>
<div>lxc-create 1419737316.440 INFO lxc_confile - read uid
map: type g nsid 0 hostid 3311264 range 65537</div>
<div>lxc-create 1419737316.562 ERROR lxc_lock - Error
opening /tmp/111/lxc//var/go/.local/share/lxc/test</div>
<div>lxc-create 1419737316.563 ERROR lxc_container - failed
to save starting configuration for test</div>
<div>lxc-create 1419737316.563 ERROR lxc_create_ui - Error
creating container test</div>
<div>lxc-create 1419737772.411 ERROR lxc_utils - Permission
denied - failed to create directory '/run/user/1001/lock/'</div>
<div>lxc-create 1419737772.411 WARN lxc_log - lxc_log_init
called with log already initialized</div>
<div>lxc-create 1419737772.412 INFO lxc_confile - read uid
map: type u nsid 0 hostid 3311264 range 65537</div>
<div>lxc-create 1419737772.412 INFO lxc_confile - read uid
map: type g nsid 0 hostid 3311264 range 65537</div>
<div>lxc-create 1419737772.544 ERROR lxc_lock - Error
opening /tmp/111/lxc//var/go/.local/share/lxc/test</div>
<div>lxc-create 1419737772.544 ERROR lxc_container - failed
to save starting configuration for test</div>
<div>lxc-create 1419737772.545 ERROR lxc_create_ui - Error
creating container test</div>
</div>
<div><br>
</div>
<div>
<div>go@host01:~$ ls -alh /run/user/</div>
<div>total 0</div>
<div>drwxr-xr-x 6 root root 120 Dec 28 03:02 .</div>
<div>drwxr-xr-x 28 root root 940 Dec 28 03:02 ..</div>
<div>drwx------ 2 ranjib ranjib 40 Dec 28 02:58 1001</div>
<div>drwx------ 2 newrelic newrelic 40 Dec 28 02:57 109</div>
<div>drwx------ 2 go go 40 Dec 28 02:57 111</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
lxc-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>
<a class="moz-txt-link-freetext" href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a></pre>
</blockquote>
<br>
</body>
</html>