Skip to content
Advertisement

How to start a VM though Vagrant

I have never used Vagrant before. Now, Im investigating to use it for my project. Here is my problem so need some help from every one.

Currently , I have a CentOS guest that has been installed via Virtual Machine in MAC host. Im going to install Vagrant into MACbook then I want to use Vagrant command line for control CentOS by terminal. As far as I know, after install Vagrant we have to add a box then start up this box ( Windows, *Unix,…). So in my case I ALREADY have a CentOS VM , I do NOT want add a box (because I have to install all of package, soft again). How to integrate the current CentOS with vagrant ?

Please help me if you know. Thank you so much !

Advertisement

Answer

How to create a “base box”, as it’s known in vagrant, is all there in the documentation: http://docs.vagrantup.com/v2/virtualbox/boxes.html

Honestly though, if you’re new to it all, I would advise that it would be easier to start with vagrant and a fresh CentOS VM, rather than the approach you’re trying. e.g.:

$ vagrant init chef/centos-7.1
$ vagrant up --provider virtualbox

The installation of packages, software etc can all be defined in the Vagrantfile (see: http://docs.vagrantup.com/v2/provisioning/).

This approach avoids ending up with a snowflake server.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement