[systemd-devel] Systemd-nspawn -- Canot add interface to container

James Lott james at lottspot.com
Thu Sep 25 16:25:02 PDT 2014



Hi Zbyszek,

Thanks for all your help! This is a new concept to me though, as I have never tried to refer to a process inside of a container from outside of the container before (I did not realize this was possible). Since specifying PID 1 would obviously be referring to the host system's init process, would you be willing to give me an example that might help me understand how I can specify an in-container PID from the host system? Thanks again for taking the time to help me grasp all of this :)

> On Sep 25, 2014, at 2:10 PM, Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl> wrote:
> 
>> On Thu, Sep 25, 2014 at 10:40:42AM -0700, James Lott wrote:
>> Hi Mantas,
>> 
>> Thanks for the clarification. The first thing I tried actually was using the PID 
>> of the systemd-nspawn instance, like so
>> 
>> [root at host01 lanvpn]# ps aux | grep -v grep | grep systemd-nspawn 
>> root       143  0.0  0.3   2884   728 ?        Ss   08:42   0:00 
>> /usr/bin/systemd-nspawn --network-bridge=switch1 -bD /home/proxy -M 0
>> root      4564  0.7  0.6   2884  1124 pts/3    S+   10:38   0:00 systemd-
>> nspawn --private-network
>> [root at host01 lanvpn]# iw phy phy0 set netns 4564
> 
> systemd-nspawn is *outside* of the container. You should use the child of
> systemd-nspawn, i.e. the init process, instead.
> 
> Zbyszek


More information about the systemd-devel mailing list