Veeweeを使ってVagrant用の仮想マシンを作成する

2013年11月18日 20時27分

201311182027VVEW00.png

はじめに

Packerを使ってVagrant用の仮想マシンを作成するでは、仮想化支援ツールのPackerを使ったVagrant用の仮想マシンの作成方法について、解説しました。今回は、同様の仮想化支援ツールであるVeeweeを使ったVagrant用の仮想マシンの作成方法について解説します。

Veeweeとは

Veeweeは、jedi4everさんが開発する仮想化支援ツールです。
それぞれの比較は、下記のとおりです。

ツールメリットデメリット
Packer
  1. Windowsネイティブアプリのため、高速に動作する。
  2. Vagrant用のBox出力に対応しているため、コマンド一発でVagrant用の仮想マシンを作成できる。
  1. 仮想マシン作成ファイル(JSON形式)を作る必要があるが、公式サイトにもテンプレートなどが無い
Veewee
  1. テンプレートが予め用意されているため、仮想マシンを簡単に作成できる。
  1. rubyプログラムのため、Packerに較べて動作が遅い
  2. PackerのようにVagrant用Boxの出力までは行えないため、VirtualBoxに登録された仮想マシンを手動でVagrant用の仮想マシンに変換する必要がある。

前提条件

作業の前提条件は、下記のとおりです。

ソフトウエアバージョン
OSWindows 7 Ultimate 32bit
CygwinSetup Version 2.831
VirtualBox4.2.18 r88780
Vagrant1.2.7
rbenv2.1.0-preview1

Veeweeのインストール

インストールに必要なposix-spawnをビルドし、Veeweeをgemパッケージでインストールします。

  1. posix-spawnのダウンロード

    $ mkdir -p ~/work && cd ~/work
    $ git clone https://github.com/rtomayko/posix-spawn.git posix-spawn && cd posix-spawn
    
    Cloning into 'posix-spawn'...
    remote: Counting objects: 926, done.
    remote: Compressing objects: 100% (562/562), done.
    remote: Total 926 (delta 387), reused 744 (delta 303)
    Receiving objects: 100% (926/926), 172.28 KiB | 167 KiB/s, done.
    Resolving deltas: 100% (387/387), done.
    
    201311182027VVEW01.png
  2. posix-spawnのビルド

    $ gem build posix-spawn.gemspec
    
    WARNING:  licenses is empty
      Successfully built RubyGem
      Name: posix-spawn
      Version: 0.3.7
      File: posix-spawn-0.3.7.gem
    
    201311182027VVEW02.png
  3. posix-spawnのインストール

    $ gem i --local posix-spawn-0.3.7.gem --no-ri --no-rdoc
    
    DL is deprecated, please use Fiddle
    Building native extensions.  This could take a while...
    Successfully installed posix-spawn-0.3.7
    1 gem installed
    
    201311182027VVEW03.png
  4. Veeweeのインストール

    $ gem i veewee --no-ri --no-rdoc
    
    DL is deprecated, please use Fiddle
    Fetching: net-ssh-2.7.0.gem (100%)
    Successfully installed net-ssh-2.7.0
    Fetching: Platform-0.4.0.gem (100%)
    Successfully installed Platform-0.4.0
    Fetching: open4-1.3.0.gem (100%)
    Successfully installed open4-1.3.0
    Fetching: popen4-0.1.2.gem (100%)
    Successfully installed popen4-0.1.2
    Fetching: thor-0.18.1.gem (100%)
    Successfully installed thor-0.18.1
    Fetching: highline-1.6.20.gem (100%)
    Successfully installed highline-1.6.20
    Fetching: progressbar-0.21.0.gem (100%)
    Successfully installed progressbar-0.21.0
    Fetching: i18n-0.6.5.gem (100%)
    Successfully installed i18n-0.6.5
    Fetching: ansi-1.3.0.gem (100%)
    Successfully installed ansi-1.3.0
    Fetching: ruby-vnc-1.0.1.gem (100%)
    Successfully installed ruby-vnc-1.0.1
    Fetching: builder-3.2.2.gem (100%)
    Successfully installed builder-3.2.2
    Fetching: excon-0.28.0.gem (100%)
    Successfully installed excon-0.28.0
    Fetching: formatador-0.2.4.gem (100%)
    Successfully installed formatador-0.2.4
    Fetching: multi_json-1.8.2.gem (100%)
    Successfully installed multi_json-1.8.2
    Fetching: mime-types-1.25.gem (100%)
    Successfully installed mime-types-1.25
    Fetching: net-scp-1.1.2.gem (100%)
    Successfully installed net-scp-1.1.2
    Fetching: mini_portile-0.5.2.gem (100%)
    Successfully installed mini_portile-0.5.2
    Fetching: nokogiri-1.6.0.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed nokogiri-1.6.0
    Fetching: ruby-hmac-0.4.0.gem (100%)
    Successfully installed ruby-hmac-0.4.0
    Fetching: fog-1.18.0.gem (100%)
    Successfully installed fog-1.18.0
    Fetching: ffi-1.9.3.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed ffi-1.9.3
    Fetching: childprocess-0.3.9.gem (100%)
    Successfully installed childprocess-0.3.9
    Fetching: diff-lcs-1.2.5.gem (100%)
    Successfully installed diff-lcs-1.2.5
    Fetching: grit-2.5.0.gem (100%)
    Successfully installed grit-2.5.0
    Fetching: libxml-ruby-2.7.0.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed libxml-ruby-2.7.0
    Fetching: CFPropertyList-2.0.17.gem (100%)
    Successfully installed CFPropertyList-2.0.17
    Fetching: fission-0.4.0.gem (100%)
    Successfully installed fission-0.4.0
    Fetching: os-0.9.6.gem (100%)
    Successfully installed os-0.9.6
    Fetching: veewee-0.3.12.gem (100%)
    Successfully installed veewee-0.3.12
    29 gems installed
    
    201311182027VVEW04.png
    201311182027VVEW05.png
    201311182027VVEW06.png

仮想マシンの作成

Veeweeのインストールが終了しましたので、仮想マシンを作成します。

  1. 定義済みテンプレートの表示

    定義済みのBoxテンプレートを表示します。

    $ mkdir -p ~/mybox/veewee && cd ~/mybox/veewee
    $ veewee vbox templates
    
    The following templates are available:
    veewee vbox define '<box_name>' 'CentOS-4.8-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.5-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.5-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.6-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.6-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.6-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.6-x86_64-netboot-packages' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.7-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.7-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.8-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.8-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.8-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.8-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.8-x86_64-reallyminimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.9-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.9-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.9-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-5.9-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.0-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.0-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.0-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.0-x86_64-minimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.0-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.1-x86_64-minimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.1-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.2-i386-minimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.2-x86_64-minimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.2-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.3-i386-minimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.3-x86_64-minimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.3-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.3-x86_64-reallyminimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.4-i386-minimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.4-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.4-x86_64-minimal' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'CentOS-6.4-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-5.0.10-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-5.0.10-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-5.0.8-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-5.0.8-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.3-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.3-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.4-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.4-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.5-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.5-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.6-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.6-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.7-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-6.0.7-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-7.0-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-7.0-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-7.1.0-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-7.1.0-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-7.2.0-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Debian-7.2.0-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-14-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-14-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-14-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-14-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-15-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-15-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-15-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-15-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-16-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-16-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-16-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-17-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-17-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-18-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-18-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-19-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Fedora-19-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'OSX' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'OracleLinux-5.9-i386-DVD' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'OracleLinux-5.9-x86_64-DVD' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'OracleLinux-6.3-x86_64-DVD' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'OracleLinux-6.4-i386-DVD' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'OracleLinux-6.4-x86_64-DVD' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'SLES-11-SP1-DVD-i586-GM' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'SLES-11-SP1-DVD-x86_64-GM' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'SLES-11-SP2-DVD-x86_64-GM' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'Sysrescuecd-2.0.0-experimental' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'VMware-ESXi-5.0u2-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'VMware-ESXi-5.1-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'archlinux-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'archlinux-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'freebsd-8.2-experimental' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'freebsd-8.2-pcbsd-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'freebsd-8.2-pcbsd-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'freebsd-8.2-pcbsd-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'freebsd-9.0-RELEASE-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'freebsd-9.1-RELEASE-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'funtoo-latest-generic_64-stable' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'funtoo-latest-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'gentoo-latest-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'gentoo-latest-i686' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'nixos-minimal-0.2-i686' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openSUSE-11.4-DVD-i586' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openSUSE-11.4-DVD-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openSUSE-11.4-NET-i586' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openSUSE-11.4-NET-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openSUSE-12.1-DVD+NET-i586' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openSUSE-12.1-DVD+NET-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openSUSE-12.3-x86_64-NET_EN' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openbsd50_amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openbsd50_i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openbsd52_amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openbsd52_i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openbsd52_i386_snap' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openbsd53_amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openbsd53_i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openindiana-148-ai-x86' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'openindiana-151a7-text-x86' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'opensuse-11.4-i386-experimental' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-5.7-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-5.7-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-5.9-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-5.9-x86_64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-6.1-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-6.1-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-6.2-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-6.2-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-6.3-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-6.3-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-6.4-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'scientificlinux-6.4-x86_64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'solaris-10-ga-x86' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'solaris-11-express-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.04.2-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.04.2-server-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.04.3-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.04.3-server-amd64-alt' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.04.3-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.04.4-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.04.4-server-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.04.4-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.04.4-server-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.10-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.10-server-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.10-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-10.10-server-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-11.04-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-11.04-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-11.10-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-11.10-server-amd64-ishaya' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-11.10-server-amd64-ruby192' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-11.10-server-amd64-rvm' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-11.10-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.1-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.1-server-amd64-packages' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.1-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.1-server-i386-packages' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.2-desktop-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.2-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.2-server-amd64-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.2-server-amd64-packages' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.2-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.2-server-i386-netboot' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.2-server-i386-packages' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.3-desktop-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.3-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.04.3-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.10-desktop-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.10-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.10-server-amd64-packages' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.10-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-12.10-server-i386-packages' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-13.04-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-13.04-server-amd64-rvm' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-13.10-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-8.04.4-server-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'ubuntu-8.04.4-server-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2008R1-serverstandard-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2008R1-serverweb-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2008R1-serverweb-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2008R1-serverwebcore-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2008R2-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2008R2-serverstandard-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2008R2-serverstandard-amd64-winrm' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2008R2-serverweb-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2008R2-serverwebcore-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2012-serverstandard-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-2012R2-serverdatacenter-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-7-enterprise-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-7-enterprise-amd64-winrm' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-7-enterprise-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-7-premium-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-7-professional-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-7-ultimate-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-7sp1-ultimate-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-8-amd64' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-8-i386' --workdir=/home/punio/mybox/veewee
    veewee vbox define '<box_name>' 'windows-8-preview-amd64' --workdir=/home/punio/mybox/veewee
    
    201311182027VVEW07.png
    201311182027VVEW08.png
  2. 仮想マシンの設定

    テンプレートの中から、Debian-7.2.0-i386-netbootを指定して仮想マシンを設定します。

    $ veewee vbox define 'veewee-vagrant-debian' 'Debian-7.2.0-i386-netboot'
    
    The basebox 'veewee-vagrant-debian' has been successfully created from the template 'Debian-7.2.0-i386-netboot'
    You can now edit the definition files stored in /home/punio/mybox/veewee/definitions/veewee-vagrant-debian or build the box with:
    veewee vbox build 'veewee-vagrant-debian' --workdir=/home/punio/mybox/veewee
    
    201311182027VVEW09.png
  3. 仮想マシンの作成

    設定が終了しましたので、仮想マシンを作成します。

    $ veewee vbox build 'veewee-vagrant-debian'
    

    実行すると、インストールに必要なインストールISOおよび、VirtualBox Guest Add-InのインストールISOをダウンロードするか聞いて来ますので、Yesを入力します。

    201311182027VVEW10.png
    201311182027VVEW11.png

    VirtualBoxコンソールが起動され、OSのインストールとゲストアドインのインストールが行われます。

    201311182027VVEW12.png
    201311182027VVEW13.png
    201311182027VVEW14.png
    201311182027VVEW15.png
    201311182027VVEW16.png
    201311182027VVEW17.png
    Downloading vbox guest additions iso v 4.2.18 - http://download.virtualbox.org/virtualbox/4.2.18/VBoxGuestAdditions_4.2.18.iso
    Checking if isofile VBoxGuestAdditions_4.2.18.iso already exists.
    Full path: /home/punio/mybox/veewee/iso/VBoxGuestAdditions_4.2.18.iso
    Moving /home/punio/mybox/veewee/open-uri20131118-2576-13eca2g to /home/punio/mybox/veewee/iso/VBoxGuestAdditions_4.2.18.iso
    Building Box veewee-vagrant-debian with Definition veewee-vagrant-debian:
    - debug : false
    - cwd : /home/punio/mybox/veewee
    - force : false
    - nogui : false
    - auto : false
    - checksum : false
    - redirectconsole : false
    - postinstall_include : []
    - postinstall_exclude : []
    
    We did not find an isofile here : /home/punio/mybox/veewee/iso/debian-7.2.0-i386-netinst.iso.
    
    The definition provided the following download information:
    - Download url: http://cdimage.debian.org/debian-cd/7.2.0/i386/iso-cd/debian-7.2.0-i386-netinst.iso
    - Md5 Checksum: 564282a81b5aef7015501e497fc63d81
    
    
    Download? (Yes/No) Yes
    Checking if isofile VBoxGuestAdditions_4.2.18.iso already exists.
    Full path: /home/punio/mybox/veewee/iso/VBoxGuestAdditions_4.2.18.iso
    
    The isofile VBoxGuestAdditions_4.2.18.iso already exists.
    Building Box veewee-vagrant-debian with Definition veewee-vagrant-debian:
    - debug : false
    - cwd : /home/punio/mybox/veewee
    - force : false
    - nogui : false
    - auto : false
    - checksum : false
    - redirectconsole : false
    - postinstall_include : []
    - postinstall_exclude : []
    
    The isofile debian-7.2.0-i386-netinst.iso already exists.
    Creating vm veewee-vagrant-debian : 512M - 1 CPU - Debian
    Creating new harddrive of size 8192, format VDI, variant Standard
    Attaching disk: F:\VirtualBox/veewee-vagrant-debian/veewee-vagrant-debian1.vdi
    Mounting cdrom: /home/punio/mybox/veewee/iso/debian-7.2.0-i386-netinst.iso
    Mounting guest additions: /home/punio/mybox/veewee/iso/VBoxGuestAdditions_4.2.18.iso
    Finding unused TCP port in range: 7222 - 7262
    Selected TCP port 7222
    Finding unused TCP port in range: 7222 - 7262
    Selected TCP port 7222
    Waiting 10 seconds for the machine to boot
    Finding unused TCP port in range: 7122 - 7199
    Selected TCP port 7122
    Starting a webserver :7122
    
    Typing:[1]: <Esc>
    Typing:[2]: install
    Typing:[3]: preseed/url=http://10.0.2.2:7122/preseed.cfg
    Typing:[4]: debian-installer=en_US
    Typing:[5]: auto
    Typing:[6]: locale=en_US
    Typing:[7]: kbd-chooser/method=us
    Typing:[8]: netcfg/get_hostname=veewee-vagrant-debian
    Typing:[9]: netcfg/get_domain=vagrantup.com
    Typing:[10]: fb=false
    Typing:[11]: debconf/frontend=noninteractive
    Typing:[12]: console-setup/ask_detect=false
    Typing:[13]: console-keymaps-at/keymap=us
    Typing:[14]: keyboard-configuration/xkb-keymap=us
    Typing:[15]: <Enter>
    Done typing.
    
    Serving file /home/punio/mybox/veewee/definitions/veewee-vagrant-debian/preseed.cfg
    Shutting down for /home/punio/mybox/veewee/definitions/veewee-vagrant-debian/preseed.cfg
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .................................................................
    Transferring /home/punio/mybox/veewee/.veewee_version20131118-4916-1jr5xcv to .veewee_version
    ..
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Transferring /home/punio/mybox/veewee/.vbox_version20131118-4916-1evr5ei to .vbox_version
    ..
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Transferring /home/punio/mybox/veewee/iso/VBoxGuestAdditions_4.2.18.iso to VBoxGuestAdditions_4.2.18.iso
    ...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Transferring /home/punio/mybox/veewee/.veewee_params20131118-4916-1f2jak3 to .veewee_params
    ..
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Transferring /home/punio/mybox/veewee/definitions/veewee-vagrant-debian/base.sh to base.sh
    ..
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: chmod +x "base.sh"
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Transferring /home/punio/mybox/veewee/definitions/veewee-vagrant-debian/vagrant.sh to vagrant.sh
    ..
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: chmod +x "vagrant.sh"
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Transferring /home/punio/mybox/veewee/definitions/veewee-vagrant-debian/virtualbox.sh to virtualbox.sh
    ..
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: chmod +x "virtualbox.sh"
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Transferring /home/punio/mybox/veewee/definitions/veewee-vagrant-debian/cleanup-virtualbox.sh to cleanup-virtualbox.sh
    ..
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: chmod +x "cleanup-virtualbox.sh"
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Transferring /home/punio/mybox/veewee/definitions/veewee-vagrant-debian/cleanup.sh to cleanup.sh
    ..
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: chmod +x "cleanup.sh"
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Transferring /home/punio/mybox/veewee/definitions/veewee-vagrant-debian/zerodisk.sh to zerodisk.sh
    ..
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: chmod +x "zerodisk.sh"
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: echo 'vagrant'|sudo -S sh './base.sh'
    
    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:
    
        #1) Respect the privacy of others.
        #2) Think before you type.
        #3) With great power comes great responsibility.
    
    Hit http://http.us.debian.org wheezy Release.gpg
    Hit http://security.debian.org wheezy/updates Release.gpg
    Hit http://security.debian.org wheezy/updates Release
    Hit http://http.us.debian.org wheezy-updates Release.gpg
    Hit http://security.debian.org wheezy/updates/main Sources
    Hit http://http.us.debian.org wheezy Release
    Hit http://security.debian.org wheezy/updates/main i386 Packages
    Hit http://http.us.debian.org wheezy-updates Release
    Hit http://security.debian.org wheezy/updates/main Translation-en
    Hit http://http.us.debian.org wheezy/main Sources
    Hit http://http.us.debian.org wheezy/main i386 Packages
    Hit http://http.us.debian.org wheezy/main Translation-en
    Get:1 http://http.us.debian.org wheezy-updates/main Sources [2,981 B]
    Hit http://http.us.debian.org wheezy-updates/main i386 Packages/DiffIndex
    Hit http://http.us.debian.org wheezy-updates/main Translation-en/DiffIndex
    Fetched 2,981 B in 2s (1,255 B/s)
    Reading package lists... Done
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
      binutils cpp cpp-4.6 cpp-4.7 dpkg-dev fakeroot g++ g++-4.7 gcc gcc-4.6
      gcc-4.6-base gcc-4.7 libalgorithm-diff-perl libalgorithm-diff-xs-perl
      libalgorithm-merge-perl libc-dev-bin libc6-dev libdpkg-perl
      libfile-fcntllock-perl libgmp10 libgomp1 libitm1 libmpc2 libmpfr4
      libquadmath0 libstdc++6-4.7-dev libtimedate-perl
      linux-headers-3.2.0-4-common linux-kbuild-3.2 linux-libc-dev make
      manpages-dev patch
    Suggested packages:
      binutils-doc cpp-doc gcc-4.6-locales gcc-4.7-locales debian-keyring
      g++-multilib g++-4.7-multilib gcc-4.7-doc libstdc++6-4.7-dbg gcc-multilib
      autoconf automake1.9 libtool flex bison gdb gcc-doc gcc-4.6-multilib
      libmudflap0-4.6-dev gcc-4.6-doc libgcc1-dbg libgomp1-dbg libquadmath0-dbg
      libmudflap0-dbg binutils-gold gcc-4.7-multilib libmudflap0-4.7-dev
      libitm1-dbg libcloog-ppl0 libppl-c2 libppl7 glibc-doc libstdc++6-4.7-doc
      make-doc ed diffutils-doc
    The following NEW packages will be installed:
      binutils build-essential cpp cpp-4.6 cpp-4.7 dpkg-dev fakeroot g++ g++-4.7
      gcc gcc-4.6 gcc-4.6-base gcc-4.7 libalgorithm-diff-perl
      libalgorithm-diff-xs-perl libalgorithm-merge-perl libc-dev-bin libc6-dev
      libdpkg-perl libfile-fcntllock-perl libgmp10 libgomp1 libitm1 libmpc2
      libmpfr4 libquadmath0 libstdc++6-4.7-dev libtimedate-perl
      linux-headers-3.2.0-4-686-pae linux-headers-3.2.0-4-common linux-kbuild-3.2
      linux-libc-dev make manpages-dev patch
    0 upgraded, 35 newly installed, 0 to remove and 2 not upgraded.
    Need to get 56.0 MB of archives.
    After this operation, 157 MB of additional disk space will be used.
    Get:1 http://http.us.debian.org/debian/ wheezy/main libgmp10 i386 2:5.0.5+dfsg-2 [263 kB]
    Get:2 http://http.us.debian.org/debian/ wheezy/main libgomp1 i386 4.7.2-5 [29.1 kB]
    Get:3 http://http.us.debian.org/debian/ wheezy/main libitm1 i386 4.7.2-5 [36.2 kB]
    Get:4 http://http.us.debian.org/debian/ wheezy/main libmpfr4 i386 3.1.0-5 [535 kB]
    Get:5 http://http.us.debian.org/debian/ wheezy/main libquadmath0 i386 4.7.2-5 [198 kB]
    Get:6 http://http.us.debian.org/debian/ wheezy/main libmpc2 i386 0.9-4 [41.3 kB]
    Get:7 http://http.us.debian.org/debian/ wheezy/main patch i386 2.6.1-3 [127 kB]
    Get:8 http://http.us.debian.org/debian/ wheezy/main binutils i386 2.22-8 [4,565 kB]
    Get:9 http://http.us.debian.org/debian/ wheezy/main libc-dev-bin i386 2.13-38 [217 kB]
    Get:10 http://http.us.debian.org/debian/ wheezy/main linux-libc-dev i386 3.2.51-1 [814 kB]
    Get:11 http://http.us.debian.org/debian/ wheezy/main libc6-dev i386 2.13-38 [4,935 kB]
    Get:12 http://http.us.debian.org/debian/ wheezy/main cpp-4.7 i386 4.7.2-5 [5,213 kB]
    Get:13 http://http.us.debian.org/debian/ wheezy/main cpp i386 4:4.7.2-1 [16.6 kB]
    Get:14 http://http.us.debian.org/debian/ wheezy/main gcc-4.7 i386 4.7.2-5 [8,267 kB]
    Get:15 http://http.us.debian.org/debian/ wheezy/main gcc i386 4:4.7.2-1 [5,062 B]
    Get:16 http://http.us.debian.org/debian/ wheezy/main libstdc++6-4.7-dev i386 4.7.2-5 [1,711 kB]
    Get:17 http://http.us.debian.org/debian/ wheezy/main g++-4.7 i386 4.7.2-5 [7,786 kB]
    Get:18 http://http.us.debian.org/debian/ wheezy/main g++ i386 4:4.7.2-1 [1,372 B]
    Get:19 http://http.us.debian.org/debian/ wheezy/main make i386 3.81-8.2 [398 kB]
    Get:20 http://http.us.debian.org/debian/ wheezy/main libtimedate-perl all 1.2000-1 [41.2 kB]
    Get:21 http://http.us.debian.org/debian/ wheezy/main libdpkg-perl all 1.16.12 [951 kB]
    Get:22 http://http.us.debian.org/debian/ wheezy/main dpkg-dev all 1.16.12 [1,349 kB]
    Get:23 http://http.us.debian.org/debian/ wheezy/main build-essential i386 11.5 [7,190 B]
    Get:24 http://http.us.debian.org/debian/ wheezy/main gcc-4.6-base i386 4.6.3-14 [142 kB]
    Get:25 http://http.us.debian.org/debian/ wheezy/main cpp-4.6 i386 4.6.3-14 [4,654 kB]
    Get:26 http://http.us.debian.org/debian/ wheezy/main fakeroot i386 1.18.4-2 [107 kB]
    Get:27 http://http.us.debian.org/debian/ wheezy/main gcc-4.6 i386 4.6.3-14 [7,338 kB]
    Get:28 http://http.us.debian.org/debian/ wheezy/main libalgorithm-diff-perl all 1.19.02-2 [51.5 kB]
    Get:29 http://http.us.debian.org/debian/ wheezy/main libalgorithm-diff-xs-perl i386 0.04-2+b1 [13.3 kB]
    Get:30 http://http.us.debian.org/debian/ wheezy/main libalgorithm-merge-perl all 0.08-2 [13.5 kB]
    Get:31 http://http.us.debian.org/debian/ wheezy/main libfile-fcntllock-perl i386 0.14-2 [17.2 kB]
    Get:32 http://http.us.debian.org/debian/ wheezy/main linux-headers-3.2.0-4-common i386 3.2.51-1 [3,561 kB]
    Get:33 http://http.us.debian.org/debian/ wheezy/main linux-kbuild-3.2 i386 3.2.17-1 [233 kB]
    Get:34 http://http.us.debian.org/debian/ wheezy/main linux-headers-3.2.0-4-686-pae i386 3.2.51-1 [601 kB]
    Get:35 http://http.us.debian.org/debian/ wheezy/main manpages-dev all 3.44-1 [1,737 kB]
    Fetched 56.0 MB in 1min 32s (603 kB/s)
    Extracting templates from packages: 100%
    Selecting previously unselected package libgmp10:i386.
    (Reading database ... 20790 files and directories currently installed.)
    Unpacking libgmp10:i386 (from .../libgmp10_2%3a5.0.5+dfsg-2_i386.deb) ...
    Selecting previously unselected package libgomp1:i386.
    Unpacking libgomp1:i386 (from .../libgomp1_4.7.2-5_i386.deb) ...
    Selecting previously unselected package libitm1:i386.
    Unpacking libitm1:i386 (from .../libitm1_4.7.2-5_i386.deb) ...
    Selecting previously unselected package libmpfr4:i386.
    Unpacking libmpfr4:i386 (from .../libmpfr4_3.1.0-5_i386.deb) ...
    Selecting previously unselected package libquadmath0:i386.
    Unpacking libquadmath0:i386 (from .../libquadmath0_4.7.2-5_i386.deb) ...
    Selecting previously unselected package libmpc2:i386.
    Unpacking libmpc2:i386 (from .../libmpc2_0.9-4_i386.deb) ...
    Selecting previously unselected package patch.
    Unpacking patch (from .../patch_2.6.1-3_i386.deb) ...
    Selecting previously unselected package binutils.
    Unpacking binutils (from .../binutils_2.22-8_i386.deb) ...
    Selecting previously unselected package libc-dev-bin.
    Unpacking libc-dev-bin (from .../libc-dev-bin_2.13-38_i386.deb) ...
    Selecting previously unselected package linux-libc-dev:i386.
    Unpacking linux-libc-dev:i386 (from .../linux-libc-dev_3.2.51-1_i386.deb) ...
    Selecting previously unselected package libc6-dev:i386.
    Unpacking libc6-dev:i386 (from .../libc6-dev_2.13-38_i386.deb) ...
    Selecting previously unselected package cpp-4.7.
    Unpacking cpp-4.7 (from .../cpp-4.7_4.7.2-5_i386.deb) ...
    Selecting previously unselected package cpp.
    Unpacking cpp (from .../cpp_4%3a4.7.2-1_i386.deb) ...
    Selecting previously unselected package gcc-4.7.
    Unpacking gcc-4.7 (from .../gcc-4.7_4.7.2-5_i386.deb) ...
    Selecting previously unselected package gcc.
    Unpacking gcc (from .../gcc_4%3a4.7.2-1_i386.deb) ...
    Selecting previously unselected package libstdc++6-4.7-dev.
    Unpacking libstdc++6-4.7-dev (from .../libstdc++6-4.7-dev_4.7.2-5_i386.deb) ...
    Selecting previously unselected package g++-4.7.
    Unpacking g++-4.7 (from .../g++-4.7_4.7.2-5_i386.deb) ...
    Selecting previously unselected package g++.
    Unpacking g++ (from .../g++_4%3a4.7.2-1_i386.deb) ...
    Selecting previously unselected package make.
    Unpacking make (from .../make_3.81-8.2_i386.deb) ...
    Selecting previously unselected package libtimedate-perl.
    Unpacking libtimedate-perl (from .../libtimedate-perl_1.2000-1_all.deb) ...
    Selecting previously unselected package libdpkg-perl.
    Unpacking libdpkg-perl (from .../libdpkg-perl_1.16.12_all.deb) ...
    Selecting previously unselected package dpkg-dev.
    Unpacking dpkg-dev (from .../dpkg-dev_1.16.12_all.deb) ...
    Selecting previously unselected package build-essential.
    Unpacking build-essential (from .../build-essential_11.5_i386.deb) ...
    Selecting previously unselected package gcc-4.6-base:i386.
    Unpacking gcc-4.6-base:i386 (from .../gcc-4.6-base_4.6.3-14_i386.deb) ...
    Selecting previously unselected package cpp-4.6.
    Unpacking cpp-4.6 (from .../cpp-4.6_4.6.3-14_i386.deb) ...
    Selecting previously unselected package fakeroot.
    Unpacking fakeroot (from .../fakeroot_1.18.4-2_i386.deb) ...
    Selecting previously unselected package gcc-4.6.
    Unpacking gcc-4.6 (from .../gcc-4.6_4.6.3-14_i386.deb) ...
    Selecting previously unselected package libalgorithm-diff-perl.
    Unpacking libalgorithm-diff-perl (from .../libalgorithm-diff-perl_1.19.02-2_all.deb) ...
    Selecting previously unselected package libalgorithm-diff-xs-perl.
    Unpacking libalgorithm-diff-xs-perl (from .../libalgorithm-diff-xs-perl_0.04-2+b1_i386.deb) ...
    Selecting previously unselected package libalgorithm-merge-perl.
    Unpacking libalgorithm-merge-perl (from .../libalgorithm-merge-perl_0.08-2_all.deb) ...
    Selecting previously unselected package libfile-fcntllock-perl.
    Unpacking libfile-fcntllock-perl (from .../libfile-fcntllock-perl_0.14-2_i386.deb) ...
    Selecting previously unselected package linux-headers-3.2.0-4-common.
    Unpacking linux-headers-3.2.0-4-common (from .../linux-headers-3.2.0-4-common_3.2.51-1_i386.deb) ...
    Selecting previously unselected package linux-kbuild-3.2.
    Unpacking linux-kbuild-3.2 (from .../linux-kbuild-3.2_3.2.17-1_i386.deb) ...
    Selecting previously unselected package linux-headers-3.2.0-4-686-pae.
    Unpacking linux-headers-3.2.0-4-686-pae (from .../linux-headers-3.2.0-4-686-pae_3.2.51-1_i386.deb) ...
    Selecting previously unselected package manpages-dev.
    Unpacking manpages-dev (from .../manpages-dev_3.44-1_all.deb) ...
    Processing triggers for man-db ...
    Setting up libgmp10:i386 (2:5.0.5+dfsg-2) ...
    Setting up libgomp1:i386 (4.7.2-5) ...
    Setting up libitm1:i386 (4.7.2-5) ...
    Setting up libmpfr4:i386 (3.1.0-5) ...
    Setting up libquadmath0:i386 (4.7.2-5) ...
    Setting up libmpc2:i386 (0.9-4) ...
    Setting up patch (2.6.1-3) ...
    Setting up binutils (2.22-8) ...
    Setting up libc-dev-bin (2.13-38) ...
    Setting up linux-libc-dev:i386 (3.2.51-1) ...
    Setting up libc6-dev:i386 (2.13-38) ...
    Setting up cpp-4.7 (4.7.2-5) ...
    Setting up cpp (4:4.7.2-1) ...
    Setting up gcc-4.7 (4.7.2-5) ...
    Setting up gcc (4:4.7.2-1) ...
    Setting up make (3.81-8.2) ...
    Setting up libtimedate-perl (1.2000-1) ...
    Setting up libdpkg-perl (1.16.12) ...
    Setting up dpkg-dev (1.16.12) ...
    Setting up gcc-4.6-base:i386 (4.6.3-14) ...
    Setting up cpp-4.6 (4.6.3-14) ...
    Setting up fakeroot (1.18.4-2) ...
    update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
    Setting up gcc-4.6 (4.6.3-14) ...
    Setting up libalgorithm-diff-perl (1.19.02-2) ...
    Setting up libalgorithm-diff-xs-perl (0.04-2+b1) ...
    Setting up libalgorithm-merge-perl (0.08-2) ...
    Setting up libfile-fcntllock-perl (0.14-2) ...
    Setting up linux-headers-3.2.0-4-common (3.2.51-1) ...
    Setting up linux-kbuild-3.2 (3.2.17-1) ...
    Setting up linux-headers-3.2.0-4-686-pae (3.2.51-1) ...
    Setting up manpages-dev (3.44-1) ...
    Setting up g++-4.7 (4.7.2-5) ...
    Setting up g++ (4:4.7.2-1) ...
    update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
    Setting up build-essential (11.5) ...
    Setting up libstdc++6-4.7-dev (4.7.2-5) ...
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
      libssl-doc libtinfo-dev
    The following NEW packages will be installed:
      libreadline-gplv2-dev libssl-dev libssl-doc libtinfo-dev zlib1g-dev
    0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.
    Need to get 3,262 kB of archives.
    After this operation, 7,778 kB of additional disk space will be used.
    Get:1 http://http.us.debian.org/debian/ wheezy/main zlib1g-dev i386 1:1.2.7.dfsg-13 [212 kB]
    Get:2 http://http.us.debian.org/debian/ wheezy/main libssl-dev i386 1.0.1e-2 [1,592 kB]
    Get:3 http://http.us.debian.org/debian/ wheezy/main libssl-doc all 1.0.1e-2 [1,200 kB]
    Get:4 http://http.us.debian.org/debian/ wheezy/main libtinfo-dev i386 5.9-10 [93.2 kB]
    Get:5 http://http.us.debian.org/debian/ wheezy/main libreadline-gplv2-dev i386 5.2+dfsg-2~deb7u1 [164 kB]
    Fetched 3,262 kB in 7s (441 kB/s)
    Selecting previously unselected package zlib1g-dev:i386.
    (Reading database ... 34778 files and directories currently installed.)
    Unpacking zlib1g-dev:i386 (from .../zlib1g-dev_1%3a1.2.7.dfsg-13_i386.deb) ...
    Selecting previously unselected package libssl-dev.
    Unpacking libssl-dev (from .../libssl-dev_1.0.1e-2_i386.deb) ...
    Selecting previously unselected package libssl-doc.
    Unpacking libssl-doc (from .../libssl-doc_1.0.1e-2_all.deb) ...
    Selecting previously unselected package libtinfo-dev:i386.
    Unpacking libtinfo-dev:i386 (from .../libtinfo-dev_5.9-10_i386.deb) ...
    Selecting previously unselected package libreadline-gplv2-dev:i386.
    Unpacking libreadline-gplv2-dev:i386 (from .../libreadline-gplv2-dev_5.2+dfsg-2~deb7u1_i386.deb) ...
    Processing triggers for man-db ...
    Setting up zlib1g-dev:i386 (1:1.2.7.dfsg-13) ...
    Setting up libssl-dev (1.0.1e-2) ...
    Setting up libssl-doc (1.0.1e-2) ...
    Setting up libtinfo-dev:i386 (5.9-10) ...
    Setting up libreadline-gplv2-dev:i386 (5.2+dfsg-2~deb7u1) ...
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    curl is already the newest version.
    Suggested packages:
      zip
    The following NEW packages will be installed:
      unzip
    0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
    Need to get 186 kB of archives.
    After this operation, 387 kB of additional disk space will be used.
    Get:1 http://http.us.debian.org/debian/ wheezy/main unzip i386 6.0-8 [186 kB]
    Fetched 186 kB in 1s (111 kB/s)
    Selecting previously unselected package unzip.
    (Reading database ... 36253 files and directories currently installed.)
    Unpacking unzip (from .../archives/unzip_6.0-8_i386.deb) ...
    Processing triggers for man-db ...
    Setting up unzip (6.0-8) ...
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-3.2.0-4-686-pae
    Found initrd image: /boot/initrd.img-3.2.0-4-686-pae
    done
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: echo 'vagrant'|sudo -S sh './vagrant.sh'
    useradd: user 'vagrant' already exists
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   409  100   409    0     0    540      0 --:--:-- --:--:-- --:--:--   669
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
      file libevent-2.0-5 libgssglue1 libmagic1 libnfsidmap2 libtirpc1
      mime-support python python-minimal python2.7 python2.7-minimal rpcbind
    Suggested packages:
      open-iscsi watchdog python-doc python-tk python2.7-doc binfmt-support
    The following NEW packages will be installed:
      file libevent-2.0-5 libgssglue1 libmagic1 libnfsidmap2 libtirpc1
      mime-support nfs-common python python-minimal python2.7 python2.7-minimal
      rpcbind
    0 upgraded, 13 newly installed, 0 to remove and 2 not upgraded.
    Need to get 5,597 kB of archives.
    After this operation, 19.6 MB of additional disk space will be used.
    Get:1 http://http.us.debian.org/debian/ wheezy/main libevent-2.0-5 i386 2.0.19-stable-3 [171 kB]
    Get:2 http://http.us.debian.org/debian/ wheezy/main libgssglue1 i386 0.4-2 [26.1 kB]
    Get:3 http://http.us.debian.org/debian/ wheezy/main libmagic1 i386 5.11-2 [204 kB]
    Get:4 http://http.us.debian.org/debian/ wheezy/main libnfsidmap2 i386 0.25-4 [36.6 kB]
    Get:5 http://http.us.debian.org/debian/ wheezy/main libtirpc1 i386 0.2.2-5 [87.9 kB]
    Get:6 http://http.us.debian.org/debian/ wheezy/main file i386 5.11-2 [51.5 kB]
    Get:7 http://http.us.debian.org/debian/ wheezy/main mime-support all 3.52-1 [35.5 kB]
    Get:8 http://http.us.debian.org/debian/ wheezy/main rpcbind i386 0.2.0-8 [44.8 kB]
    Get:9 http://http.us.debian.org/debian/ wheezy/main nfs-common i386 1:1.2.6-4 [283 kB]
    Get:10 http://http.us.debian.org/debian/ wheezy/main python2.7-minimal i386 2.7.3-6 [1,716 kB]
    Get:11 http://http.us.debian.org/debian/ wheezy/main python2.7 i386 2.7.3-6 [2,718 kB]
    Get:12 http://http.us.debian.org/debian/ wheezy/main python-minimal all 2.7.3-4+deb7u1 [42.8 kB]
    Get:13 http://http.us.debian.org/debian/ wheezy/main python all 2.7.3-4+deb7u1 [181 kB]
    Fetched 5,597 kB in 7s (714 kB/s)
    Selecting previously unselected package libevent-2.0-5:i386.
    (Reading database ... 36271 files and directories currently installed.)
    Unpacking libevent-2.0-5:i386 (from .../libevent-2.0-5_2.0.19-stable-3_i386.deb) ...
    Selecting previously unselected package libgssglue1:i386.
    Unpacking libgssglue1:i386 (from .../libgssglue1_0.4-2_i386.deb) ...
    Selecting previously unselected package libmagic1:i386.
    Unpacking libmagic1:i386 (from .../libmagic1_5.11-2_i386.deb) ...
    Selecting previously unselected package libnfsidmap2:i386.
    Unpacking libnfsidmap2:i386 (from .../libnfsidmap2_0.25-4_i386.deb) ...
    Selecting previously unselected package libtirpc1:i386.
    Unpacking libtirpc1:i386 (from .../libtirpc1_0.2.2-5_i386.deb) ...
    Selecting previously unselected package file.
    Unpacking file (from .../archives/file_5.11-2_i386.deb) ...
    Selecting previously unselected package mime-support.
    Unpacking mime-support (from .../mime-support_3.52-1_all.deb) ...
    Selecting previously unselected package rpcbind.
    Unpacking rpcbind (from .../rpcbind_0.2.0-8_i386.deb) ...
    Selecting previously unselected package nfs-common.
    Unpacking nfs-common (from .../nfs-common_1%3a1.2.6-4_i386.deb) ...
    Selecting previously unselected package python2.7-minimal.
    Unpacking python2.7-minimal (from .../python2.7-minimal_2.7.3-6_i386.deb) ...
    Selecting previously unselected package python2.7.
    Unpacking python2.7 (from .../python2.7_2.7.3-6_i386.deb) ...
    Selecting previously unselected package python-minimal.
    Unpacking python-minimal (from .../python-minimal_2.7.3-4+deb7u1_all.deb) ...
    Selecting previously unselected package python.
    Unpacking python (from .../python_2.7.3-4+deb7u1_all.deb) ...
    Processing triggers for man-db ...
    Setting up libevent-2.0-5:i386 (2.0.19-stable-3) ...
    Setting up libgssglue1:i386 (0.4-2) ...
    Setting up libmagic1:i386 (5.11-2) ...
    Setting up libnfsidmap2:i386 (0.25-4) ...
    Setting up libtirpc1:i386 (0.2.2-5) ...
    Setting up file (5.11-2) ...
    Setting up mime-support (3.52-1) ...
    Setting up rpcbind (0.2.0-8) ...
    [ ok ] Starting rpcbind daemon....
    Setting up nfs-common (1:1.2.6-4) ...
    
    Creating config file /etc/idmapd.conf with new version
    
    Creating config file /etc/default/nfs-common with new version
    Adding system user `statd' (UID 103) ...
    Adding new user `statd' (UID 103) with group `nogroup' ...
    Not creating home directory `/var/lib/nfs'.
    [ ok ] Starting NFS common utilities: statd idmapd.
    Setting up python2.7-minimal (2.7.3-6) ...
    Linking and byte-compiling packages for runtime python2.7...
    Setting up python2.7 (2.7.3-6) ...
    Setting up python-minimal (2.7.3-4+deb7u1) ...
    Setting up python (2.7.3-4+deb7u1) ...
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: echo 'vagrant'|sudo -S sh './virtualbox.sh'
    mount: warning: /mnt seems to be mounted read-only.
    Verifying archive integrity... All good.
    Uncompressing VirtualBox 4.2.18 Guest Additions for Linux............
    VirtualBox Guest Additions installer
    Copying additional installer modules ...
    Installing additional modules ...
    Removing existing VirtualBox non-DKMS kernel modules ...done.
    Building the VirtualBox Guest Additions kernel modules
    The headers for the current running kernel were not found. If the following
    module compilation fails then this could be the reason.
    
    Building the main Guest Additions module ...done.
    Building the shared folder support module ...done.
    Building the OpenGL support module ...done.
    Doing non-kernel setup of the Guest Additions ...done.
    Starting the VirtualBox Guest Additions ...done.
    Installing the Window System drivers ...fail!
    (Could not find the X.Org or XFree86 Window System.)
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: echo 'vagrant'|sudo -S sh './cleanup-virtualbox.sh'
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: echo 'vagrant'|sudo -S sh './cleanup.sh'
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      linux-headers-3.2.0-4-common linux-kbuild-3.2
    Use 'apt-get autoremove' to remove them.
    The following packages will be REMOVED:
      build-essential linux-headers-3.2.0-4-686-pae
    0 upgraded, 0 newly installed, 2 to remove and 2 not upgraded.
    After this operation, 9,205 kB disk space will be freed.
    (Reading database ... 37230 files and directories currently installed.)
    Removing build-essential ...
    Removing linux-headers-3.2.0-4-686-pae ...
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages will be REMOVED:
      g++ g++-4.7 libstdc++6-4.7-dev linux-headers-3.2.0-4-common linux-kbuild-3.2
    0 upgraded, 0 newly installed, 5 to remove and 2 not upgraded.
    After this operation, 45.0 MB disk space will be freed.
    (Reading database ... 31318 files and directories currently installed.)
    Removing g++ ...
    Removing linux-headers-3.2.0-4-common ...
    Removing linux-kbuild-3.2 ...
    Removing g++-4.7 ...
    Removing libstdc++6-4.7-dev ...
    Processing triggers for man-db ...
    cleaning up dhcp leases
    cleaning up udev rules
    rm: cannot remove `/etc/udev/rules.d/70-persistent-net.rules': No such file or directory
    Adding a 2 sec delay to the interface up, to make the dhclient happy
    Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
    .
    Executing command: echo 'vagrant'|sudo -S sh './zerodisk.sh'
    dd: writing `/EMPTY': No space left on device
    6627+0 records in
    6626+0 records out
    6948593664 bytes (6.9 GB) copied, 46.7342 s, 149 MB/s
    The box veewee-vagrant-debian was built successfully!
    You can now login to the box with:
    ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 7222 -l vagrant 127.0.0.1
    
  4. 仮想マシンの停止

    Veeweeでは、仮想マシンをビルドした後、手動でシャットアウトしなければいけませんので、作成した仮想マシンに接続した後、シャットダウンします。

    $ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 7222 -l vagrant 127.0.0.1
    
    Warning: Permanently added '[127.0.0.1]:7222' (ECDSA) to the list of known hosts.
    vagrant@127.0.0.1's password:
    Linux veewee-vagrant-debian 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686
    
    The programs included with the Debian GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    Last login: Mon Nov 18 01:53:17 2013 from 10.0.2.2
    vagrant@veewee-vagrant-debian:~$
    
    201311182027VVEW18.png
    vagrant@veewee-vagrant-debian:~$ sudo shutdown -h now
    
    
    The system is going down for system halt NOW!bian (pts/0) (Mon Nov 18 01:59:1
    vagrant@veewee-vagrant-debian:~$ Connection to 127.0.0.1 closed by remote host.
    Connection to 127.0.0.1 closed.
    
    201311182027VVEW19.png
  5. 仮想マシンの変換

    VirtualBoxの仮想マシンイメージをVagrant用に変換すると同様の手順で、Vagrant用の仮想マシンイメージに変換することもできますが、Veeweeのexportコマンドを使った変換を行います。

    $ veewee vbox export veewee-vagrant-debian
    
    Creating a temporary directory for export
    Adding additional files
    Creating Vagrantfile
    Exporting the box
    Executing VBoxManage export veewee-vagrant-debian --output /home/punio/mybox/veewee/d20131118-5728-1rhsy90/box.ovf
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Successfully exported 1 machine(s).
    Packaging the box
    Cleaning up temporary directory
    
    To import it into vagrant type:
    vagrant box add 'veewee-vagrant-debian' '/home/punio/mybox/veewee/veewee-vagrant-debian.box'
    
    To use it:
    vagrant init 'veewee-vagrant-debian'
    vagrant up
    vagrant ssh
    
    201311182027VVEW20.png

    以上で、Vagrant用の仮想マシンに変換できましたので、vagrantコマンドで起動できます。

まとめ

ここまで、Veeweeを使った仮想マシンの作成方法について解説しました。Veeweeには、Packerには無い豊富なテンプレートがありますので、使いやすいツールと言えます。
Packerを利用する際に必要な各種設定ファイルをVeeweeを使って生成し、Packerで利用すると言った使い方がベストなのでは無いかと思います。