My host/conatiner networking are both managed by systemd-netwrokd. I have a bridge Br0 on host and vb-MyContainer for the conatiner. Both have a fix local IP.
I boot container at host boot this way: ------------------------------------------ $ cat /etc/systemd/system/systemd-nspawn@.service ................. ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-bridge=br0 --machine= ------------------------------------------ Unfortunately, systemd-nspawn@poppy fails sometimes at boot : ---------------------------------------------------------------------------- $ systemctl status systemd-nspawn@poppy ● systemd-nspawn@poppy.service - Container poppy Loaded: loaded (/etc/systemd/system/systemd-nspawn@.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2015-05-01 19:34:56 CEST; 50s ago Docs: man:systemd-nspawn(1) Process: 544 ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --net work-bridge=br0 --machine=%I (code=exited, status=1/FAILURE) Main PID: 544 (code=exited, status=1/FAILURE) May 01 19:34:55 hortensia systemd[1]: Starting Container poppy... May 01 19:34:55 hortensia systemd-nspawn[544]: Failed to resolve interface br0: No such device May 01 19:34:56 hortensia systemd[1]: systemd-nspawn@poppy.service: main process exited, code=exite...LURE May 01 19:34:56 hortensia systemd[1]: Failed to start Container poppy. May 01 19:34:56 hortensia systemd[1]: Unit systemd-nspawn@poppy.service entered failed state. May 01 19:34:56 hortensia systemd[1]: systemd-nspawn@poppy.service failed. Hint: Some lines were ellipsized, use -l to show in full. -------------------------------------------------------------------------- Obviously the reason is networkd has not been activated. I solved this issue this way: $ cat /etc/systemd/system/network.target -------------------------------------------------- [Unit] Description=Network Documentation=man:systemd.special(7) Documentation=http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget After=network-pre.target RefuseManualStart=yes [Install] WantedBy=machines.target ---------------------------------------------- # systemctl enable machines.target I added machines.target in Before section options in systemd-netwrokd.service $ cat /etc/systemd/system/systemd-netwrokd.service -------------------------------------- ............. Before=network.target multi-user.target shutdown.target machines.target .................. ----------------------------------------- My issue is now solved. I just wonder if my setting is a good practice. Thank you for advice google.com/+arnaudgabourygabx _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel