VAGRANT Offline Setup

Offline Setup VAGRANT machine 

In my previous post, I walk you through the steps to setup and use Vagrant with VirtualBox and start your first Vagrant project.

In this post I will continue with the offline setup, In some cases you may need to download the box file to local server and use it as an offline vagrant base instead of downloading.

Setups to setup offline vagrant machine:

  • Download the file
  • Add it to vagrant file
  • Initialize and boot

 

Download the file

In order to download the box file you have to add version and provider in the URL.

For example, to download puppet box first you need its URL which is https://app.vagrantup.com/puppetlabs/boxes/centos-6.6-64-puppet/

Then you have to add version and provider afterwards, for our example the download URL would be.

https://app.vagrantup.com/puppetlabs/boxes/centos-6.6-64-puppet/versions/1.0.3/providers/virtualbox.box

Add it to vagrant file

Then you have to add it locally to vagrant file. Use the following command:

vagrant box add puppet-box d:\download\centos-6.6-x86_64-virtualbox-puppet-1.0.3.box

Bonus: It will create a local vagrant folder and use it when initialize new vagrant

 

Initialize and boot

Create a project folder, open command window in project folder and type:

vagrant init puppet-box

Note: It will create a “Vagrantfile” in project folder.

Then boot the Vagrant machine:

vagrant up

It will create a VM “”AppSrv1” on the hypervisor after executing “vagrant up”

  

 

SSH into the Box

After vagrant box started, SSH into the box (use putty) or use the console to start customizing it . Here’s how to SSH into the box:

vagrant ssh

 

Some vagrant command to start/stop the vagrant machine:

Stops the vagrant machine

vagrant halt

stops and deletes all traces of vagrant machine

vagrant destroy

suspend the vagrant machine

vagrant suspend

To get more help type:

vagrant -h

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s