26
26

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 3 years have passed since last update.

vagrant パッケージ化

Last updated at Posted at 2016-02-07

vagrantのインスタンスを作成して、初期設定をするのが面倒なので初期設定終わった後の状態をパッケージ化してみました。

パッケージ化

引数とかいろいろあるけどよくわからないので、vagrant package のみで。

# Vagrantfile のあるディレクトリに移動
$ vagrant package
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Exporting VM...
==> default: Compressing package to: /Users/hogehoge/vagrant/hogehoge/package.box
$ ls
Vagrantfile	package.box

package.box というファイルができました

box に登録

$ vagrant box add {box名} package.box

確認

$ vagrant box list
centos6.4             (virtualbox, 0)
ubuntu-14.04          (virtualbox, 0)
{box名}               (virtualbox, 0)

ちなみに box の削除

$ vagrant box remove {box名}

でも ~/.vagrant.d/boxes/ディレクトリにはのこっているので、こちらも消します。

$ rm -rf ~/.vagrant.d/boxes/{box名}
26
26
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
26
26

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?