vagrant เป็นโปรแกรมที่ช่วยบริหารจัดการเครื่องเสมือนได้ง่ายขึ้น โดยจะมีคำสั่งที่ใช้สร้าง แก้ไข คอนฟิก ลบ เปิด ปิดเครื่องเสมือน และจะมีการรวม (package) เครื่องเสมือนให้เป็นไฟล์เดียวที่เรียกว่า box เพื่อให้คนอื่นๆ สามารถนำไปใช้งานได้ ด้วยสภาพแวดล้อม (environment) เดียวกัน
ลองมาดูตัวอย่างการดาวน์โหลดและติดตั้ง vagrant บน Mac OS X กัน
ก่อนติดตั้ง vagrant บนเครื่องต้องมีโปรแกรม Virtual Machine อยู่ก่อนแล้ว โดย vagrant จะรองรับโปรแกรม Virtual Machine ที่เรียกว่า provider ทั้ง VirtualBox, VMWare และอื่นๆ โดยสามารถรันได้ทั้งบน Windows, Mac OS X, หรือบนลีนุกซ์ ด้วยคำสั่งรูปแบบเดียวกัน
การใช้งาน vagrant ก็สามารถดาวน์โหลดโปรแกรมมาติดตั้งบนเครื่องได้เลย ภายใต้สิทธิ์ Open Source
เข้าหน้าเว็บไซต์ Vagrant : https://www.vagrantup.com/
ตัวอย่างหน้าเว็บไซต์ Vagrant

คลิกที่ปุ่ม DOWNLOAD
ตัวอย่างหน้า DOWNLOAD VAGRANT จะมีให้เลือกติดตั้งบนหลายระบบปฏิบัติการ
ในที่นี้คลิก MAC OS X

คลิกไฟล์ที่ดาวน์โหลด เพื่อเริ่มการติดตั้ง

หลังจากติดตั้งเสร็จเรียบร้อย เปิดโปรแกรมประเภท terminal ลองรันคำสั่ง vagrant
[alice@MacOS ~]$ vagrant
Usage: vagrant [options] <command> [<args>]
-v, --version Print the version and exit.
-h, --help Print this help.
Common commands:
box manages boxes: installation, removal, etc.
connect connect to a remotely shared Vagrant environment
destroy stops and deletes all traces of the vagrant machine
global-status outputs status Vagrant environments for this user
halt stops the vagrant machine
help shows the help for a subcommand
init initializes a new Vagrant environment by creating a Vagrantfile
login log in to HashiCorp's Atlas
package packages a running vagrant environment into a box
plugin manages plugins: install, uninstall, update, etc.
port displays information about guest port mappings
powershell connects to machine via powershell remoting
provision provisions the vagrant machine
push deploys code in this environment to a configured destination
rdp connects to machine via RDP
reload restarts vagrant machine, loads new Vagrantfile configuration
resume resume a suspended vagrant machine
share share your Vagrant environment with anyone in the world
snapshot manages snapshots: saving, restoring, etc.
ssh connects to machine via SSH
ssh-config outputs OpenSSH valid configuration to connect to the machine
status outputs status of the vagrant machine
suspend suspends the machine
up starts and provisions the vagrant environment
version prints current and latest Vagrant version
For help on any individual command run `vagrant COMMAND -h`
Additional subcommands are available, but are either more advanced
or not commonly used. To see all subcommands, run the command
`vagrant list-commands`.
การใช้งาน vagrant จะเป็นรูปแบบการพิมพ์คำสั่ง (command line)
เวอร์ชันล่าสุดที่ติดตั้ง ณ ตอนที่เขียน
[alice@MacOS ~]$ vagrant version Installed Version: 1.8.1 Latest Version: 1.8.1 You're running an up-to-date version of Vagrant!