Vagrant can build, and destroy, your entire dev setup in a matter of minutes. Its a powerful tool for achieving a cleanroom enginerring deployment setup.
I've given up on alot of things in my life, especially including the idea of managing software on my development machine. Im not a sysadmin guy but... vagrant is really cool so I'm forcing myself to start using it. Also DanielKnell told me to... so... Here's how I got a vagrant VM environment running on ubuntu.
Now, both veewee and vagrant are installed.
You can borrow a full blown vm base box to start :
vagrant box add base https://s3.amazonaws.com/cloudbiolinux/cbl_ubuntu_11_4_32_20110628.box
Or, simpler and faster one like this :
vagrant box add ubuntu-lucid-32 http://files.vagrantup.com/lucid32.box
Vagrant has a set "Vagrantfile" that is initialized for you. This file is created with the "vagrant init my-base-box" command. For example :
vagrant init ubuntu-lucid-32
So, you first can initialize vagrant via the init command, followed by the box name, and then you can edit the contents of the "Vagrantfile" to point to a shell script which executes some custom instructions, i.e. installing programs.
Now what ?
Now, you can get into your vm :
vagrant ssh
Yipeeee.
Now, as long as you commit changes to the ssh file associated with your Vagrant , anyone can run this vagrant up command, from anywhere, to recreate your environment.
Finally - if you screw up the environment, you can run "vagrant destroy" followed by "vagrant up" to refresh it to the original start point.
------- UPDATES --------
Just found got this wonderful piece of advice on irc #vagrant :
Oh and watch out for this :
I've given up on alot of things in my life, especially including the idea of managing software on my development machine. Im not a sysadmin guy but... vagrant is really cool so I'm forcing myself to start using it. Also DanielKnell told me to... so... Here's how I got a vagrant VM environment running on ubuntu.
(Vagrant requires a solid Ruby setup - heres what i did to get it working.)
First, install ruby and the ruby bundler :
sudo apt-get install ruby-bundler
To do this , create a directory, cd to it, and create a gem file that looks like this.
sudo apt-get install ruby-bundler
To do this , create a directory, cd to it, and create a gem file that looks like this.
source 'http://rubygems.org'
gem 'vagrant', "~> 0.8.1"
gem 'veewee', "~> 0.2.0"
gem 'vagrant', "~> 0.8.1"
gem 'veewee', "~> 0.2.0"
(note that veewee isn't really necessary here).
THEN
run the bundle install via the gemfile :
$> sudo bundle install
Now... In ubuntu 10, I had to update ruby gems to avoid this crazy error related to date formats :
$>sudo gem install rubygems-update
$>update_rubygems
Now, both veewee and vagrant are installed.
Lets build a VM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You can borrow a full blown vm base box to start :
vagrant box add base https://s3.amazonaws.com/cloudbiolinux/cbl_ubuntu_11_4_32_20110628.box
Or, simpler and faster one like this :
vagrant box add ubuntu-lucid-32 http://files.vagrantup.com/lucid32.box
Next, before I install it - How do I customize it ?
Vagrant has a set "Vagrantfile" that is initialized for you. This file is created with the "vagrant init my-base-box" command. For example :
vagrant init ubuntu-lucid-32
So, you first can initialize vagrant via the init command, followed by the box name, and then you can edit the contents of the "Vagrantfile" to point to a shell script which executes some custom instructions, i.e. installing programs.
Now what ?
Now, you can get into your vm :
vagrant ssh
Yipeeee.
Now, as long as you commit changes to the ssh file associated with your Vagrant , anyone can run this vagrant up command, from anywhere, to recreate your environment.
Finally - if you screw up the environment, you can run "vagrant destroy" followed by "vagrant up" to refresh it to the original start point.
------- UPDATES --------
Just found got this wonderful piece of advice on irc #vagrant :
bgy_:
Oh and watch out for this :
....





0 comments:
Post a Comment