general:linux:systemd_nspawn_containers
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| general:linux:systemd_nspawn_containers [2024/06/14 06:22] – sunkan | general:linux:systemd_nspawn_containers [2025/11/22 15:03] (current) – [Add security updates source] sunkan | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| ====== Create container with debootstrap ====== | ====== Create container with debootstrap ====== | ||
| < | < | ||
| - | debootstrap --include=systemd, | + | debootstrap --include=systemd, |
| </ | </ | ||
| Then either use | Then either use | ||
| - | > systemd-nspawn -D / | + | <code> |
| + | systemd-nspawn -D / | ||
| + | </ | ||
| or | or | ||
| - | > machinectl start container_name | + | <code> |
| + | 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.1718346165.txt.gz · Last modified: 2024/06/14 06:22 by sunkan