Open 10sr opened 7 years ago
パスワード設定
# restorecon -Rv centos0
# systemd-nspawn -D centos0
# passwd
# logout
https://unix.stackexchange.com/questions/308687/systemd-nspawn-os-container-is-unusable-because-i-cant-set-the-root-password https://wiki.archlinux.org/index.php/Systemd-nspawn
SELinux
# setenforce Permissive
/etc/sysconfig/selinux
を設定
ホストネットワーク
# yum install systemd-networkd systemd-resolved
# systemctl disable NetworkManager
# systemctl enable systemd-networkd systemd-resolved
machinectl 管理に移動
# mv /nspawn/centos0 /var/lib/machines
# systemctl enable machines.target
# systemctl enable systemd-nspawn@centos0.service
作成
https://masablog.pansymade.net/2017/02/09/systemd-nspawn-%E3%81%A7-centos-%E3%81%A8-debian-%E3%82%B3%E3%83%B3%E3%83%86%E3%83%8A%E3%82%92%E4%BD%9C%E3%82%8B/