Vagrant Implementation….!!!

As i told you in my last article that I will provide a very simple way that you can follow to get your vagrant machine up and running, Today lets implement it:

Firstly the question is, how to install vagrant?

Open the terminal then go to root user by typing:

then you have to install virtualbox by typing:

Installing Vagrant:

Now check the version of your vagrant application by typing:

the output should be “vagrant 1.7.4”

Note:- “If you get the lower version of vagrant then upgrade it to 1.7.4, otherwise your vagrant file will not work perfectly”

To get latest version of vagrant, you need to download its updated package on the mentioned site below:

https://www.vagrantup.com/downloads.html

I am using ubuntu 14.04. So i have downloaded debian package and now lets install the updated package by typing:


Now check the version of your vagrant by typing:

Output should be 1.7.4

Now lets get the vagrant box from its official site:

http://www.vagrantbox.es/

Now copy the URL of the box which you want to download then hit command on terminal:

After downloading this box, you will have to come back to your user.

Note:-  If you will create your vagrant machine from the root user, then you will not get the UI of your vagrant machine in virtualbox.

Now lets create a directory in which you will create your vagrant machine by typing:

Now we will enter in the directory ‘what you just made’ by typing:

Now initialize the vagrant by typing:

Now check your directory by typing “ls” command, you will see a file named Vagrantfile.

Just open it with your editor, i will open with nano editor by typing:

Now search the line named config.vm.box = “base” and change that base word with your box_name what you gave at the time of downloading the vagrant box.

Now in the next line, add your username & password by typing:

Note:- You can keep your username & password by your choice, i kept vagrant because its default… 🙂

Now Lets give the ip address to your vagrant machine.

Find out the line “config.vm.network public_network”, firstly uncomment this line and then modify this line and it should be like:

config.vm.network “public_network”, ip: “YOUR_IP_ADDRESS”

Now save this file and exit…!!!

Now lets get your vagrant box up by typing:

After getting it up, access your vagrant machine by typing:

and now check your virtual box, you will get the GUI of your vagrant machine there. Similarly, you can create your machine in just few steps how much you want….:)

Now if you want to destroy your vagrant box, hit the command:

To halt your vagrant machine type:

To restart your vagrant machine type:

To check your currently running vagrant machines, type:

To check the total number of vagrant machines that you have in your system type:

Now lets talk about the backup of your vagrant machine box.

Yes, You can take a backup of your vagrant machine for future, if your os gets corrupted, reinstalled or upgraded, then your vagrant machine will not get corrupted and You will not loose your pre-installed application, for this you just need to take backup of your vagrant machine by typing:

Firstly shut down the vagrant machine.

To do that go to the directory in which you initialized your vagrant machine and then shut down the vagrant machine by typing:

Now copy the name of your vagrant machine.

To know the name of your vagrant machine type:

It will show the name and UID of your all VM machine.

Now copy the name of your vagrant machine whose you want to take backup and then type:

after this command, you will get your virtual machine’s backup box now you can keep it anywhere in your local, in your cloud and next time you will run it, you will have to give the path of this box in your vagrantfile and then your vagrant machine will be ready to use.

FOR ANY TYPE OF QUERY OR HELP, KINDLY CONTACT US

 

 

Category(s) Uncategorized
. . .

Comment

Add Your Comment

Be the first to comment.

css.php