As with every Vagrant provider, the Vagrant VirtualBox provider has a custom box format that affects how base boxes are made. Prior to reading this, you should read the general guide to creating base boxes. Actually, it would probably be most useful to keep this open in a separate tab as you may be referencing it frequently while creating a base box. That page contains important information about
There are a special category of boxes known as "base boxes." These boxes contain the bare minimum required for Vagrant to function, are generally not made by repackaging an existing Vagrant environment (hence the "base" in the "base box"). For example, the Ubuntu boxes provided by the Vagrant project (such as "bionic64") are base boxes. They were created from a minimal Ubuntu install from an ISO,
PackerBuild and manage images as code
VagrantのBox作成 を手動ではなくて自動で作りたいと思って調べると Packer という Vagrant の作者によって作られている仮想マシンのイメージを作成するツールがありました。他にも jedi4ever/veewee · GitHub というツールも有名みたいですが、Packer の方が汎用性が高そうだったので使ってみた内容をまとめます。 Packerのインストール 公式サイトからパッケージを Downloads するか、Homebrew を使用してインストールします。 $ brew tap home-brew/binary $ brew install packer $ packer version Packer v0.7.5 Install Packer - Packer by HashiCorp Packerのコマンド packer buildコマンドのオプションは
VagrantのBoxを作成してみました。 Windows8.1なのでHyper-Vでやろうかと思いましたが、少し試してみたところ上手くいかなかったのでおとなしくVirtualBoxを使っています。 https://docs.vagrantup.com/v2/boxes/base.html https://docs.vagrantup.com/v2/virtualbox/boxes.html 仮想マシンの作成 VirtualBoxでマシンを新規に作成します。 ディスク ディスクの種類はVDIでもVMDKでも良いようです。VDIで作成しても、Boxにした際に VMDKに変換されたので最初からVMDKが良いかも。 サイズ可変で最大サイズで作る、とありますが最大サイズがよくわからないので可変サイズで128GBくらいで。 メモリ デフォルトを大きくしすぎないように、ということなので512MBで。
ちょっとずつ試してる。環境は以下。 MacOS X 10.8 VirtualBox 4.3.2 Vagrant 1.3.5 Packer v0.4.0 packer でCentOS6.5のイメージを作る まず、packerを使ってCentOS 6.5のイメージを作るところから。テンプレートはgithubにあげてます。 $ git clone https://github.com/kazeburo/my_packer.git $ cd my_packer $ packer build centos6.5.json テンプレートは https://github.com/hnakamur/my-packer-template-files を参考にさせて頂きました。 このあとの作業が楽になるようにCentOS 6.5をインストールしたあとに、yum groupinstall "Developmen
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く