Monday, October 21, 2013

Using Vagrant for Development

VAGRANT

- install vagrant project from vagrant website
- install oracle virtual box
- select a vagrant virtual machine from varant.es website
- add your selected virtual box with the following command

vagrant box add ubuntu12_04 http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-i386-vagrant-disk1.box

- create a project directory
e.g.

mkdir vagrant-project
mkdir mytestproject
cd vagrant-project/mytestproject

- init vagrant

vagrant init ubuntu12_04

- start vagrant

vagrant up

- connect with ssh to vagrant. user name and password is vagrant

ssh 127.0.0.1 -p 2222 -l vagrant

you can now work on your mytestproject directory. It will be available to vagrant virtual machine under the /vagrant directory.

If you change to /vagrant and create a file there it will appear on windows directory as well.

install guest additions. If you have sharefolder problems you need to install guest additions. Go to the http://download.virtualbox.org/virtualbox and find your guest additions file and install it as follows

wget -c \http://download.virtualbox.org/virtualbox/4.3.0/VBoxGuestAdditions_4.3.0.iso -O VBoxGuestAdditions_4.3.0.iso
sudo mount VBoxGuestAdditions_4.3.0.iso -o loop /mnt
sudo sh /mnt/VBoxLinuxAdditions.run --nox11
sudo umont /mnt
rm *.iso

go to host machine and restart your guest by using this command

vagrant reload

You can optionally add a name server to your VM box

sudo vim /etc/resolv.conf

and add opendns domainname servers as follows.

nameserver  208.67.222.222
nameserver 208.67.220.220

1 comment:

ayshwariya said...



I actually enjoyed reading through this posting.Many thanks.



ISO Consulting

LinkWithin

Related Posts Plugin for WordPress, Blogger...