Assuming we have a br0
already set up.
btrfs subv create /var/lib/machines/test
zypper --root /var/lib/machines/test addrepo https://download.opensuse.org/tumbleweed/repo/oss/ oss
zypper --root /var/lib/machines/test/ install -t pattern base
echo -e "[Network]\nBridge=br0\n" > /etc/systemd/nspawn/test.nspawn
machinectl start test
machinectl shell test
Connected to machine test. Press ^] three times within 1s to exit session.
test:~ # passwd
test:~ # systemctl enable --now NetworkManager
Created symlink /etc/systemd/system/network.service → /usr/lib/systemd/system/NetworkManager.service.
Created symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service → /usr/lib/systemd/system/NetworkManager.service.
Created symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service → /usr/lib/systemd/system/NetworkManager-dispatcher.service.
Created symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service → /usr/lib/systemd/system/NetworkManager-wait-online.service.
This should be enough for the container to get an address by DHCP.
Then we can login with machinectl login test
and install / configure
whatever we need.