Hello guys. Today we’ll look at How to install centos 7 box with vagrant on virtualbox. Below are the steps to follow
1) First download the Centos 7 vagrant box from the link http://www.vagrantbox.es/. Direct Link to download the CentOS 7 box
Once the download is complete, create a vagrant folder on your home directory

 mkdir -p ~/vagrant/centos7
 cd ~/vagrant/centos7

2)Now copy the downloaded centos7 vagrant box and put it in the directory you just created.
3) You should have the vagrant already installed, if not installed download vagrant and install it.
For my case, i am using vagrant 1.7.4 and Virtualbox 5.0. Have a look at How to install Virtualbox Latest on Ubuntu and Kali Linux
Now open the terminal as standard user and cd to directory containing vagrant centos7 box
4) Add the centos7 box by typing the following command

     vagrant box add centos-7.0-x86_64.box --name centos7

Replace centos7 by the name you want the box to have and  centos-7.0-x86_64.box by the name of the box you downloaded.
If the Virtual machine was created on Virtualbox,You’ll should see the message, ” The box successfully added to Virtualbox”
5) Now create Vagrantfile needed to start the vm by typing”

     vagrant init
vagrant%2B1

6)  Edit the Vagrantfile and replace the name of box inside the file with the name you specified in the –name option while creating the vm from the box file.For my case the name is centos7. Use any editor you like, make changes and save them to the file.

vim  Vagrantfile
vagrant2

 

vagrant%2B6

7) Now it’s time to start the added box. Use the command

   vagrant up

8) Login to the CentOS 7 Virtual Machine with the command

     vagrant ssh

You can see that i have successfully login to the Centos 7 box on Virtualbox from the Screen-shot below. You can do system update and upgrade.

vagrant3

 

vagrant%2B4

9) Next time you want to ssh in to the Centos 7 box added, just cd to the directory you created and  do

 vagrant ssh

Watch the Video Below for More details and Clarification.

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here