User Tools

Site Tools


general:linux:systemd_nspawn_containers

This is an old revision of the document!


To allow reading folder from host

Add file with the machines name like so: /etc/systemd/nspawn/<name>.nspawn

[Files]
Bind=/home

[Exec]
ResolvConf=copy-host
#PrivateUsers=false

#Needed when a .nspawn file is used (since bullseye https://github.com/systemd/systemd/issues/12313)
Capability=CAP_NET_ADMIN

Create container with debootstrap

debootstrap --include=systemd,dbus bookworm /var/lib/machines/container_name

Then either use

systemd-nspawn -D /var/lib/machines/container_name

or

machinectl start container_name
machinectl shell container_name
general/linux/systemd_nspawn_containers.1718346222.txt.gz · Last modified: 2024/06/14 06:23 by sunkan

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