VeeWeeでVagrantのBase Boxをつくる(Debian 6.0.6)

http://vagrantbox.esでもいいんですが、勉強がてらつくってみた。
(あと、DropBoxでホストされているBoxとかは得体のしれない物感が、ちょっと)

VeeWeeをインストール

$ gem install veewee --no-ri --no-rdoc
$ rbenv rehash

テンプレート一覧を表示

$ ls "$(dirname $(gem which veewee))/../templates"

テンプレートからdefinitionを書き出す

$ veewee vbox define "mysqueeze64" "Debian-6.0.6-amd64-netboot"

ISOファイルをJAISTから取得する

$ diff -C5 definitions/mysqueeze64/definition.rb{.original,}
*** definitions/mysqueeze64/definition.rb.original  2013-01-18 20:46:54.000000000 +0900
--- definitions/mysqueeze64/definition.rb   2013-01-18 20:48:53.000000000 +0900
***************
*** 2,12 ****
    :cpu_count => '1',
    :memory_size=> '256',
    :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
    :os_type_id => 'Debian_64',
    :iso_file => "debian-6.0.6-amd64-netinst.iso",
!   :iso_src => "http://cdimage.debian.org/debian-cd/6.0.6/amd64/iso-cd/debian-6.0.6-amd64-netinst.iso",
    :iso_md5 => "00585d63f8a560a73540bd718263319a",
    :iso_download_timeout => "1000",
    :boot_wait => "10", :boot_cmd_sequence => [
      '<Esc>',
      'install ',
--- 2,12 ----
    :cpu_count => '1',
    :memory_size=> '256',
    :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
    :os_type_id => 'Debian_64',
    :iso_file => "debian-6.0.6-amd64-netinst.iso",
!   :iso_src => "http://ftp.jaist.ac.jp/pub/Linux/debian-cd/6.0.6/amd64/iso-cd/debian-6.0.6-amd64-netinst.iso",
    :iso_md5 => "00585d63f8a560a73540bd718263319a",
    :iso_download_timeout => "1000",
    :boot_wait => "10", :boot_cmd_sequence => [
      '<Esc>',
      'install ',

VirtualBoxイメージを作成

VirtualBoxが立ち上がり、自動的にインストールが進む

$ veewee vbox build mysqueeze64

Vagrant用のboxファイルにエクスポート

$ vagrant basebox export 'mysqueeze64'
[mysqueeze64] Error: We executed a shell command and the exit status was not 0
[mysqueeze64] - Command :vagrant package --base 'mysqueeze64' --output 'mysqueeze64.box'.
[mysqueeze64] - Exitcode :1.
[mysqueeze64] - Output   :
/Users/ryota/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find archive-tar-minitar (= 0.5.2) amongst [CFPropertyList-2.0.17, ...

とエラーが出たので、

$ gem install archive-tar-minitar --no-ri --no-rdoc

して、再度

$ vagrant basebox export 'mysqueeze64'