[systemd-devel] Enter in systemd-nspawn as specific user

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu Oct 2 04:37:22 PDT 2014


On Thu, Oct 02, 2014 at 12:48:31PM +0200, Miroslav Suchy wrote:
> On 10/02/2014 11:49 AM, Lennart Poettering wrote:
> > There's nspawn's --user= switch which relies on glibc's "getent"
> > binary to be available in the container, which it will use to resolve
> > the username in the container's context and then change to it.
> 
> Perfect!
> 
> However if I do:
> # /usr/bin/systemd-nspawn -D ./
>   # /usr/sbin/useradd  -m  foobar
>   Ctrl+D
> # /usr/bin/systemd-nspawn -D ./ --user foobar
> Spawning namespace container on /tmp/test (console is /dev/pts/15).
> Init process in the container running as PID 16099.
> mkdir_safe_label() failed: File exists
> Container failed with error code 1.
This seems to by systemd-208. A lot of changes have gone into nspawn since
then. You probably should try with the latest nspawn, get things working,
and work back from there.

Zbyszek


More information about the systemd-devel mailing list