<div dir="ltr"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">short answer, yes, `machinectl login` is only suppported for systemd-init , and `machinectl shell` `systemd-run` will try to talk to the container via dbus, so i dont think you are force to have systemd runing inside the container (i may be wrong) but you do need to have dbus (and its easy to just have systemd). if you dont need it, you can always use nsenter to access a namespace on your machine</span><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-decoration-style:initial;text-decoration-color:initial">```</div><div style="text-decoration-style:initial;text-decoration-color:initial"><div>nsenter -t <pid> --all /bin/bash</div><div>```</div><div><br></div><div>where <pid> <span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">is the process that is runing on your container</span></div><div><br></div><div><div><div dir="ltr" class="gmail-m_-3124337886915570306gmail_signature"><div dir="ltr">Alvaro Leiva</div></div></div></div></div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br>Alvaro Leiva<br></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jun 23, 2018 at 7:38 AM Nikolaus Rath <<a href="mailto:nikolaus@rath.org">nikolaus@rath.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On Sat, 23 Jun 2018, at 15:31, Vito Caputo wrote:<br>
> On Sat, Jun 23, 2018 at 03:09:04PM +0100, Nikolaus Rath wrote:<br>
> > How would I go about starting an additional shell in an existing<br>
> > container? I am starting the container with:<br>
> ><br>
> > $ systemd-nspawn -M foo --as-pid2 --register=no<br>
> ><br>
> > "foo" is a raw image retrieved with machinectl. If I simply execute the<br>
> > above command again, I am getting a "Disk image<br>
> > /var/lib/machines/foo.raw is currently busy." error.<br>
> ><br>
> > I've looked into the systemd-nspawn manpage, but couldn't find anything<br>
> > appropriate.<br>
> ><br>
> > What am I missing?<br>
> ><br>
> Take a look at the machinectl man page, the "shell" and "login"<br>
> subcommands in particular.<br>
<br>
`man systemd-nspawn` says that when not running an init system in the container,<br>
I should specify `--register=no`. But without that, `machinectl` doesn't do<br>
anything. Does this mean I need to run an init system to support multiple<br>
shells?<br>
<br>
Best,<br>
-Nikolaus<br>
<br>
--<br>
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F<br>
<br>
»Time flies like an arrow, fruit flies like a Banana.«<br>
<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</blockquote></div>