Monday, February 2, 2015

How to install vagrant on ubuntu 12.04

Leave a Comment

What does vagrant mean?

Vagrant is computer software for creating and configuring virtual development environments.

How to install vagrant on ubuntu 12.04

The first, you need install virtual box, after install vagrant.

How to install Virtual Box 4.3 on ubuntu 12.04

# vim /etc/apt/sources.list
Add lines in sources.list below:
deb http://download.virtualbox.org/virtualbox/debian saucy contrib
deb http://download.virtualbox.org/virtualbox/debian raring contrib
deb http://download.virtualbox.org/virtualbox/debian quantal contrib
deb http://download.virtualbox.org/virtualbox/debian precise contrib
deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free
deb http://download.virtualbox.org/virtualbox/debian wheezy contrib
deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free
# wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
# apt-key add oracle_vbox.asc
# apt-get update
# apt-get install virtualbox-4.3

How to install Vagrant

# apt-get install vagrant

Download a box vagrant

# vagrant box add precise32 http://files.vagrantup.com/precise32.box
Files will be saved to ~/.vagrant.d/boxes/

Vagrant Up and Running

# vagrant init precise32
# vagrant up

Vagrant Login ssh

# vagrant ssh
Default user and password: vagrant/vagrant

Config Vagrantfile:

# vim Vagrantfile
Add line in Vagrantfile file as below:
config.vm.box = "precise32"
config.vm.network "forwarded_port", guest: 80, host: 8888
config.vm.network :public_network, ip: "192.168.1.2", :bridge => 'eth0'
config.vm.synced_folder "../data", "/vagrant_data"
After modify Vagrantfile file, you need reload to apply as below:
# vagrant reload
I hope will this help you! How to install vagrant on ubuntu 12.04

Link youtube how to install vagrant on ubuntu 12.04 


Copyright by: www.linuxoperatingsystem.info http://goo.gl/kMscJ4

0 comments:

Post a Comment