====== Vagrant ======
[[http://www.vagrantup.com/|Vagrant]] is open-source software for creating and configuring virtual development environments. It can be considered a wrapper around [[wp>VirtualBox]] and configuration management software such as Chef, Salt and Puppet. Although written in Ruby, it is usable in other programming projects such as PHP, Python, Java, and C#.
Quick workflow is such:
- install [[package>vagrant]] package: ''poldek -u vagrant''
- add your user to ''vbox'' group
- register base box with ''vagrant box add''
- create ''Vagrantfile'' with ''vagrant init BASEBOXNAME''
- bring up VM defined in ''Vagrantfile'' with ''vagrant up''
- log in to VM with ''vagrant ssh''
The commands are run in dir where is ''Vagrantfile''.
Base box you need to import only once, you can make new VM's without need to import base box again.
===== PLD Base boxes =====
[[people:glen|glen]] is providing regularly built [[/people/glen/vm-info|vagrant base boxes]]:
''box add'' command is needed only once or if you want to refresh your base box.
With Vagrant 1.5+ you can also use [[https://vagrantcloud.com/glen|vagrant cloud urls]]:
* vagrant box add [[https://vagrantcloud.com/glen/boxes/pld32|glen/pld32]]
* vagrant box add [[https://vagrantcloud.com/glen/boxes/pld64|glen/pld64]]
* vagrant box add [[https://vagrantcloud.com/glen/boxes/pld32-th2012 | glen/pld32-th2012 ]]
* vagrant box add [[https://vagrantcloud.com/glen/boxes/pld32-th2013 | glen/pld32-th2013 ]]
the ''.box'' is actually [[https://github.com/mitchellh/vagrant/issues/1741|importable by plain VirtualBox]] as well if you rename the file as ''.ova'', on [[ftp://ftp.pld-linux.org/people/glen/vm/|ftp]] there are symlinks for .ova files made for convenience.
===== What next? =====
After box is up, you probably want to provision it or install packages with ''poldek'' directly.
Also quite common is to [[people/glen/vm-info#grow_a_disk|grow a disk]]
==== Chef ====
To install ''chef-solo'' do ''poldek -u chef'', if you want to run chef server inside that box, have look at [[chef-server]].
If you are using ''chef-client'', it's recommended to install [[https://github.com/cassianoleal/vagrant-butcher|vagrant-butcher]] plugin to automatically delete node when destroying VM:
$ vagrant plugin install vagrant-butcher
If using older Vagrant (< 1.5), you need older butcher plugin:
$ vagrant plugin install vagrant-butcher --plugin-version=2.0.0
==== MATE Desktop ====
I ([[people:glen]]) needed to give someone VM image containing desktop application, as a result there's [[https://gist.github.com/glensc/9948541|PLD Linux with MATE Desktop]] ''Vagrantfile'' which you can use to create same image from scratch.