4. Vagrant
• A open source command line VM provision tool
• MIT licence
• Still virtualization,
but more easier, more flexible
• Support shell, puppet, chef on provisioning
2/17/2014
Copyright 2013 Trend Micro Inc.
5. Easy to use and share
http://www.vagrantbox.es/
http://puppet-vagrant-boxes.puppetlabs.com/
2/17/2014
Copyright 2013 Trend Micro Inc.
6. Installation
• Install virtualbox
– https://www.virtualbox.org/wiki/Downloads
• Install vagrant (support windows, mac, linux)
– http://downloads.vagrantup.com/tags/v1.3.5
• Get GNU commands on windows (not necessary)
– Install git (MINGW)
– Install Cygwin (too fat)
2/17/2014
Copyright 2013 Trend Micro Inc.
8. How does it work?
• Via VBoxManage tool
• list running VM
– $ VBoxManage list runningvms
• pause VM
– $ VBoxManage controlvm <vmname> pause
• send poweroff single to VM
(tells VM OS to shutdown)
– $ VBoxManage controlvm <vmname> acpipowerbutton
• …
2/17/2014
Copyright 2013 Trend Micro Inc.
9. Why we need it
• Deploy a project on a machine for testing
– mess things up
– Fix it
– …loop…
• Environment specific
– I can run it well on MY machine
(cause I only test it on my machine)
• Can not automate
• I don‟t have machines…
2/17/2014
Copyright 2013 Trend Micro Inc.
10. Problem to solve
• Provisioning:
– automate trivial things
• install httpd, mysql, config, config, config…
• reuse:
– Package configured VM as a “box”
• testing:
– clean environment for testing
• Portable:
– one box file
– local machine
2/17/2014
Copyright 2013 Trend Micro Inc.
12. Basic Commands
• Vm status control:
–
–
–
–
Up
halt
destroy
reload
(for config change)
– resume
– suspend
2/17/2014
Copyright 2013 Trend Micro Inc.
13. Create a VM
• vagrant box add precise32
http://files.vagrantup.com/precise32.box
• Vagrant init precise32 (new a vagrantfile)
• Vagrant up (create VM)
• vagrant ssh (get into the VM)
2/17/2014
Copyright 2013 Trend Micro Inc.
22. Get ssh command on windows
• ssh
– Install git (MINGW)
– Install Cygwin (too fat, I think)
• There‟re many ways you can do to achieve this goal,
My suggestion is to install git on your windows
– Download git
– 6 page quick tutorial
• Then use putty to ssh in.
2/17/2014
Copyright 2013 Trend Micro Inc.