1
1

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-nspawnのexportとimportアレコレ

Last updated at Posted at 2017-12-18

systemd-nspawn Advent Calendar 2017 19日目の記事です。

圧縮形式を指定できる

# gzでexport
machinectl export-tar ubuntu0 ubuntu.tar.gz
# xzでexport
machinectl export-tar ubuntu0 ubuntu.tar.xz
# bzip2でexport
machinectl export-tar ubuntu0 ubuntu.tar.bz2

importはこの逆でmachinectl import-tar ubuntu.tar.bz2

進捗確認

machinectl list-transfers
# キャンセル
machinectl  cancel-transfers id

ダウンロードしてインポート

# sha256検証とGPG検証もやる
machinectl pull-tar https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-root.tar.xz
# sha256の検証だけ
machinectl pull-tar --verify=signature https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-root.tar.xz
# 検証しない
machinectl pull-tar --verify=no https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-root.tar.xz

検証ファイルはこんな感じに同じ階層にSHA256SUMSとSHA256SUMS.gpgが置いてあればOK

ちなみに公開鍵は/lib/systemd/import-pubring.gpgあたりにあります。
Debian9の環境ではこれが入っていました

pub   rsa4096 2014-07-09 [SCE]
      B467FA46E2CE5FAC349910C2D8D1FA8CA29CB19C
uid           Fedora Secondary (22) <fedora@fedoraproject.org>
sub   elg4096 2014-07-09 [E]
pub   rsa4096 2014-07-09 [SCE]
      C527EA07A9349B589C35E1BF11ADC0948E1431D5
uid           Fedora (22) <fedora@fedoraproject.org>
pub   rsa4096 2013-11-14 [SCE]
      9996E55FA5D418C86CEFF750636DEA19A0A7BADB
uid           Fedora Secondary (21) <fedora@fedoraproject.org>
sub   elg4096 2013-11-14 [E]
pub   rsa4096 2013-11-14 [SCE]
      6596B8FBABDA5227A9C5B59E89AD4E8795A43F54
uid           Fedora (21) <fedora@fedoraproject.org>
pub   rsa4096 2009-09-15 [SC]
      D2EB44626FDDC30B513D5BB71A5D6C4C7DB87C81
uid           UEC Image Automatic Signing Key <cdimage@ubuntu.com>
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?