general:linux:systemd_nspawn_containers
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| general:linux:systemd_nspawn_containers [2021/08/16 13:28] – created sunkan | general:linux:systemd_nspawn_containers [2025/11/22 15:03] (current) – [Add security updates source] sunkan | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| #Needed when a .nspawn file is used (since bullseye https:// | #Needed when a .nspawn file is used (since bullseye https:// | ||
| Capability=CAP_NET_ADMIN | Capability=CAP_NET_ADMIN | ||
| + | </ | ||
| + | |||
| + | ====== Create container with debootstrap ====== | ||
| + | < | ||
| + | debootstrap --include=systemd, | ||
| + | </ | ||
| + | |||
| + | Then either use | ||
| + | < | ||
| + | systemd-nspawn -D / | ||
| + | </ | ||
| + | or | ||
| + | < | ||
| + | machinectl start container_name | ||
| + | machinectl shell container_name | ||
| + | </ | ||
| + | |||
| + | If started using machinectl, then enable and start systemd-networkd in the container to get the networking up and running. | ||
| + | < | ||
| + | systemctl --now enable systemd-networkd | ||
| + | </ | ||
| + | |||
| + | ====== Add security updates source ====== | ||
| + | Example for trixie, also add contrib etc. if you need them. | ||
| + | < | ||
| + | deb http:// | ||
| </ | </ | ||
general/linux/systemd_nspawn_containers.1629120505.txt.gz · Last modified: 2021/08/16 13:28 by sunkan