0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

systemd-nspawnAdvent Calendar 2018

Day 5

Hyper-V + systemd-nspawnの開発環境を作る(4) ~ コンテナ起動設定 ~

Last updated at Posted at 2018-12-15

前回の続き

起動設定

起動設定をして、machinectlコマンド経由で起動してみます

curl -L https://git.io/fpNm1 > /etc/systemd/system/systemd-nspawn@.service

これだけです
あとはmachinectlコマンドで操作できます

# コンテナイメージ一覧
machinectl list-images
# 動作コンテナ一覧
machinectl list
# start
machinectl start ubuntu
# stop
machinectl stop ubuntu
# 再起動後も自動起動させる
machinectl enable ubuntu
# 自動起動の解除
machinectl disable ubuntu

試しにmachinectl enable ubuntuしてからホストを再起動してみます

systemctl reboot

再起動後 http://10.100.0.3/ にアクセスしてubuntu1の文字が見えたらOKです


続く

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?