User Tools

Site Tools


general:linux:systemd_nspawn_containers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
general:linux:systemd_nspawn_containers [2021/08/16 13:28] – created sunkangeneral:linux:systemd_nspawn_containers [2024/10/22 10:47] (current) sunkan
Line 13: Line 13:
 #Needed when a .nspawn file is used (since bullseye https://github.com/systemd/systemd/issues/12313) #Needed when a .nspawn file is used (since bullseye https://github.com/systemd/systemd/issues/12313)
 Capability=CAP_NET_ADMIN Capability=CAP_NET_ADMIN
 +</code>
 +
 +====== Create container with debootstrap ======
 +<code>
 +debootstrap --include=systemd,dbus,systemd-container bookworm /var/lib/machines/container_name
 +</code>
 +
 +Then either use
 +<code>
 +systemd-nspawn -D /var/lib/machines/container_name
 +</code>
 +or
 +<code>
 +machinectl start container_name
 +machinectl shell container_name
 +</code>
 +
 +If started using machinectl, then enable and start systemd-networkd in the container to get the networking up and running.
 +<code>
 +systemctl --now enable systemd-networkd
 +</code>
 +
 +====== Add security updates source ======
 +Example for bookworm, also add contrib etc. if you need them.
 +<code>
 +deb http://security.debian.org/ bookworm-security main
 </code> </code>
  
general/linux/systemd_nspawn_containers.1629120505.txt.gz · Last modified: 2021/08/16 13:28 by sunkan

Donate Powered by PHP Valid HTML5 Valid CSS Run on Debian Driven by DokuWiki