Changelogを読むと、以前調べたmanifestファイルがないとクラッシュする問題が解決しているようです。
ちなみに、Download VirtualBox for Linux Hostsに書かれていますが、virtualbox.repoを設定しておくと、
yum update
でアップデートできます。私は、repoファイルを
enabled=0
に設定しているので、こんな感じです。1 | # yum update --enablerepo=virtualbox |
yum update
でアップデートできます。enabled=0
に設定しているので、こんな感じです。1 | # yum update --enablerepo=virtualbox |
1 2 3 4 5 6 7 8 9 10 11 | $ bundle exec veewee vbox build 'CentOS-6.4-x86_64' : Typing:[1]: <tab> text ks=http://10.0.2.2:7122/ks.cfg<enter> Error: We executed a shell command and the exit status was not 0 - Command :VBoxManage controlvm "CentOS-6.4-x86_64" keyboardputscancode 0f. - Exitcode :1. - Output : VBoxManage: error: Guest not running $ </enter></tab> |
1 2 3 4 5 6 7 | $ VBoxManage startvm "CentOS-6.4-x86_64" Waiting for VM "CentOS-6.4-x86_64" to power on... VBoxManage: error: The virtual machine 'CentOS-6.4-x86_64' has terminated unexpe ctedly during startup with exit code 0 VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Machin e, interface IMachine $ |
--nogui
と--force
を付けて再度build
コマンドを実行します。--force
を付けないとエラーになります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | $ bundle exec veewee vbox build 'CentOS-6.4-x86_64' --force --nogui Downloading vbox guest additions iso v 4.2.14 - http://download.virtualbox.org/virtualbox/4.2.14/VBoxGuestAdditions_4.2.14.iso Checking if isofile VBoxGuestAdditions_4.2.14.iso already exists. Full path: /home/foo/work/veewee/iso/VBoxGuestAdditions_4.2.14.iso The isofile VBoxGuestAdditions_4.2.14.iso already exists. Building Box CentOS-6.4-x86_64 with Definition CentOS-6.4-x86_64: - debug : false - cwd : /home/foo/work/veewee - force : true - nogui : true - auto : false - checksum : false - redirectconsole : false - postinstall_include : [] - postinstall_exclude : [] The isofile CentOS-6.4-x86_64-minimal.iso already exists. VBoxManage unregistervm "CentOS-6.4-x86_64" --delete Deleting vm CentOS-6.4-x86_64 Creating vm CentOS-6.4-x86_64 : 480M - 1 CPU - RedHat_64 Creating new harddrive of size 10140, format VDI, variant Standard Attaching disk: /home/foo/VirtualBox VMs/CentOS-6.4-x86_64/CentOS-6.4-x86_641.vdi Mounting cdrom: /home/foo/work/veewee/iso/CentOS-6.4-x86_64-minimal.iso Mounting guest additions: /home/foo/work/veewee/iso/VBoxGuestAdditions_4.2.14.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]: <tab> text ks=http://10.0.2.2:7122/ks.cfg<enter> Done typing. : : No Match for argument: bitstream-vera-fonts No Packages marked for removal Loaded plugins: fastestmirror Cleaning repos: base epel extras puppetlabs puppetlabs-dependencies updates Cleaning up Everything Cleaning up list of fastest mirrors Waiting for ssh login on 127.0.0.1 with user veewee to sshd on port => 7222 to work, timeout=10000 sec . Executing command: echo 'veewee'|sudo -S sh './zerodisk.sh' dd: writing `/EMPTY': デバイスに空き領域がありません 7454+0 records in 7453+0 records out 7815069696 bytes (7.8 GB) copied, 12.6561 s, 617 MB/s The box CentOS-6.4-x86_64 was built successfully! You can now login to the box with: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 7222 -l veewee 127.0.0.1 $ </enter></tab> |
validate
コマンドで作成した仮想マシンの検証をします。
1 2 3 4 5 6 7 8 9 | $ bundle exec veewee vbox validate 'CentOS-6.4-x86_64' Checking user - OK Checking sudo - OK Checking ruby - OK Checking gem - OK Checking chef - OK Checking puppet - OK Checking shared folder - OK $ |
export
コマンドでboxを作ります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | $ bundle exec veewee vbox export 'CentOS-6.4-x86_64' Vagrant requires the box to be shutdown, before it can export Sudo also needs to work for user veewee Performing a clean shutdown now. Waiting for ssh login on 127.0.0.1 with user veewee to sshd on port => 7222 to work, timeout=10000 sec . Executing command: echo '/sbin/halt -h -p' > /tmp/shutdown.sh Waiting for ssh login on 127.0.0.1 with user veewee to sshd on port => 7222 to work, timeout=10000 sec . Executing command: chmod +x /tmp/shutdown.sh Waiting for ssh login on 127.0.0.1 with user veewee to sshd on port => 7222 to work, timeout=10000 sec . Executing command: echo 'veewee'|sudo -S sh '/tmp/shutdown.sh' ....... Machine CentOS-6.4-x86_64 is powered off cleanly Creating a temporary directory for export Adding additional files Creating Vagrantfile Exporting the box Executing VBoxManage export CentOS-6.4-x86_64 --output /tmp/d20130713-10173-1y2vmzn/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 'CentOS-6.4-x86_64' '/home/foo/work/veewee/CentOS-6.4-x86_64.box' To use it: vagrant init 'CentOS-6.4-x86_64' vagrant up vagrant ssh $ $ ls *.box CentOS-6.4-x86_64.box $ |
git clone
してbundle install
するだけです。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | $ git clone https://github.com/jedi4ever/veewee.git Initialized empty Git repository in /home/foo/work/veewee/.git/ remote: Counting objects: 12661, done. remote: Compressing objects: 100% (4587/4587), done. remote: Total 12661 (delta 8416), reused 11992 (delta 7873) Receiving objects: 100% (12661/12661), 3.74 MiB | 1.30 MiB/s, done. Resolving deltas: 100% (8416/8416), done. $ cd veewee $ rbenv versions 1.8.7-p371 * 1.9.3-p429 (set by /usr/local/rbenv/version) 2.0.0-p195 $ rbenv local 1.9.3-p429 $ bundle install Fetching http://github.com/hh/em-winrm.git remote: Counting objects: 144, done. remote: Compressing objects: 100% (100/100), done. remote: Total 144 (delta 68), reused 113 (delta 43) Receiving objects: 100% (144/144), 23.55 KiB, done. Resolving deltas: 100% (68/68), done. Fetching gem metadata from http://rubygems.org/........ Fetching gem metadata from http://rubygems.org/.. Resolving dependencies... Installing rake (10.1.0) Installing libxml-ruby (2.6.0) : Installing whichr (0.3.6) Using veewee (0.3.7) from source at /home/foo/work/veewee Your bundle is complete! Gems in the group kvm were not installed. Use `bundle show [gemname]` to see where a bundled gem is installed. $ $ rbenv rehash |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | $ bundle exec veewee Commands: veewee fusion # Subcommand for Vmware fusion veewee help [COMMAND] # Describe available commands or one specific command veewee kvm # Subcommand for KVM veewee parallels # Subcommand for Parallels veewee vbox # Subcommand for VirtualBox veewee version # Prints the Veewee version information $ bundle exec veewee vbox Commands: veewee vbox build [BOX_NAME] # Build box veewee vbox copy [BOX_NAME] [SRC] [DST] # Copy a file to the VM veewee vbox define [BOX_NAME] [TEMPLATE] # Define a new basebox sta... veewee vbox destroy [BOX_NAME] # Destroys the virtualmach... veewee vbox export [BOX_NAME] # Exports the basebox to t... veewee vbox halt [BOX_NAME] # Activates a shutdown the... veewee vbox help [COMMAND] # Describe subcommands or ... veewee vbox list # Lists all defined boxes veewee vbox ostypes # List the available Opera... veewee vbox screenshot [BOX_NAME] [PNGFILENAME] # Takes a screenshot of th... veewee vbox sendkeys [BOX_NAME] [SEQUENCE] # Sends the key sequence (... veewee vbox ssh [BOX_NAME] [COMMAND] # SSH to box veewee vbox templates # List the currently avail... veewee vbox undefine [BOX_NAME] # Removes the definition o... veewee vbox up [BOX_NAME] # Starts a Box veewee vbox validate [BOX_NAME] # Validates a box against ... veewee vbox winrm [BOX_NAME] [COMMAND] # Execute command via winrm Options: [--debug] # enable debugging -w, --workdir, [--cwd=CWD] # Change the working directory. (The folder contai ning the definitions folder). # Default: /home/hide/work/veewee $ |
1 2 3 4 5 6 7 8 9 10 | $ bundle exec veewee vbox templates |grep -i centos veewee vbox define '<box_name>' 'CentOS-4.8-i386' --workdir=/home/foo/work/veewee veewee vbox define '<box_name>' 'CentOS-5.5-i386-netboot' --workdir=/home/foo/work/veewee : veewee vbox define '<box_name>' 'CentOS-6.4-i386-minimal' --workdir=/home/foo/work/veewee veewee vbox define '<box_name>' 'CentOS-6.4-i386-netboot' --workdir=/home/foo/work/veewee veewee vbox define '<box_name>' 'CentOS-6.4-x86_64-minimal' --workdir=/home/foo/work/veewee veewee vbox define '<box_name>' 'CentOS-6.4-x86_64-netboot' --workdir=/home/foo/work/veewee $ </box_name></box_name></box_name></box_name></box_name></box_name> |
1 2 3 4 5 | $ bundle exec veewee vbox define 'CentOS-6.4-x86_64' 'CentOS-6.4-x86_64-minimal' The basebox 'CentOS-6.4-x86_64' has been successfully created from the template 'CentOS-6.4-x86_64-minimal' You can now edit the definition files stored in /home/foo/work/veewee/definitions/CentOS-6.4-x86_64 or build the box with: veewee vbox build 'CentOS-6.4-x86_64' --workdir=/home/foo/work/veewee $ |
1 2 3 4 5 6 | $ ls definitions/ CentOS-6.4-x86_64 $ ls definitions/CentOS-6.4-x86_64/ base.sh cleanup.sh ks.cfg vagrant.sh vmfusion.sh chef.sh definition.rb puppet.sh virtualbox.sh zerodisk.sh $ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | $ diff -uw definitions/CentOS-6.4-x86_64/{definition.rb.original,definition.rb} --- definitions/CentOS-6.4-x86_64/definition.rb.original 2013-07-13 21:35:08.719699339 +0900 +++ definitions/CentOS-6.4-x86_64/definition.rb 2013-07-14 11:27:50.263552526 +0900 @@ -6,7 +6,7 @@ :hostiocache => 'off', :os_type_id => 'RedHat6_64', :iso_file => "CentOS-6.4-x86_64-minimal.iso", :iso_md5 => "4a5fa01c81cc300f4729136e28ebe600", :iso_download_timeout => 1000, :boot_wait => "10", $ $ diff -uw definitions/CentOS-6.4-x86_64/{ks.cfg.original,ks.cfg} --- definitions/CentOS-6.4-x86_64/ks.cfg.original 2013-07-13 21:35:08.719699339 +0900 +++ definitions/CentOS-6.4-x86_64/ks.cfg 2013-07-14 11:28:32.210553491 +0900 @@ -1,13 +1,13 @@ install cdrom -lang en_US.UTF-8 -keyboard us +lang ja_JP.UTF-8 +keyboard jp106 network --bootproto=dhcp rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/ firewall --enabled --service=ssh authconfig --enableshadow --passalgo=sha512 selinux --disabled -timezone UTC +timezone Asia/Tokyo bootloader --location=mbr text |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | $ bundle exec veewee vbox build 'CentOS-6.4-x86_64' Downloading vbox guest additions iso v 4.2.14 - http://download.virtualbox.org/virtualbox/4.2.14/VBoxGuestAdditions_4.2.14.iso Checking if isofile VBoxGuestAdditions_4.2.14.iso already exists. Full path: /home/foo/work/veewee/iso/VBoxGuestAdditions_4.2.14.iso The isofile VBoxGuestAdditions_4.2.14.iso already exists. Building Box CentOS-6.4-x86_64 with Definition CentOS-6.4-x86_64: - debug : false - cwd : /home/foo/work/veewee - force : false - nogui : false - auto : false - checksum : false - redirectconsole : false - postinstall_include : [] - postinstall_exclude : [] We did not find an isofile here : /home/foo/work/veewee/iso/CentOS-6.4-x86_64-minimal.iso. The definition provided the following download information: - Md5 Checksum: 4a5fa01c81cc300f4729136e28ebe600 Download? (Yes/No) Yes Checking if isofile CentOS-6.4-x86_64-minimal.iso already exists. Full path: /home/foo/work/veewee/iso/CentOS-6.4-x86_64-minimal.iso Moving /tmp/open-uri20130713-9671-3i1bbnotoo/home/foo/work/veewee/iso/CentOS-6.4-x86_64-minimal.iso| 343M 6.1MB/s ETA: 0:00:00 Creating vm CentOS-6.4-x86_64 : 480M - 1 CPU - RedHat_64 Creating new harddrive of size 10140, format VDI, variant Standard Attaching disk: /home/foo/VirtualBox VMs/CentOS-6.4-x86_64/CentOS-6.4-x86_641.vdi Mounting cdrom: /home/foo/work/veewee/iso/CentOS-6.4-x86_64-minimal.iso Mounting guest additions: /home/foo/work/veewee/iso/VBoxGuestAdditions_4.2.14.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]: <tab> text ks=http://10.0.2.2:7122/ks.cfg<enter> Error: We executed a shell command and the exit status was not 0 - Command :VBoxManage controlvm "CentOS-6.4-x86_64" keyboardputscancode 0f. - Exitcode :1. - Output : VBoxManage: error: Guest not running $ </enter></tab> |
1 2 3 4 5 6 | Download? (Yes/No) Y You have selected manual download: curl -C - -L 'http://ftp.riken.jp/Linux/centos/6.4/isos/x86_64/CentOS-6.4-x86_64-minimal.iso' -o 'iso/CentOS-6.4-x86_64-minimal.iso' md5 'iso/CentOS-6.4-x86_64-minimal.iso' $ |