Installing Vagrant on Windows 7 and 8


How to install Vagrant on Windows and run using VirtualBox?

Based on the instructions from http://www.seascapewebdesign.com/blog/part-1-getting-started-vagrant-windows-7-and-8   , I am in the process of installing Vagrant on Windows 7. In this tutorial, we will be installing Vagrant, a bare bones server with Ubuntu installed. Vagrant is a server that runs under VirtualBox. You will need to have VirtualBox installed. You will also need to have Putty installed in order to access your new Vagrant server via SSH. These instructions also apply to Windows 8. Requirements: A hard connection to the Internet Putty needs to be installed. http://www.putty.org/ VirtualBox needs to be installed.

1. Download and install the most recent VirtualBox for Windows from https://www.virtualbox.org/wiki/Downloads

2. Setup new Virtual Machine In Virtual Box

3.  Download and install the latest version of Vagrant from http://downloads.vagrantup.com.
Steps are very simple and once the installation complete this is what you will see in C:\

vagrant_installation_folder

4. Setup Vagrant in Windows 7/8

Change directory to C:\HashiCorp\vagrant\bin

Then type the following commands:

C:\HashiCorp\vagrant\bin> vagrant box add lucid32 http://files.vagrantup.com/lucid32.box

vagrant_command
vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
added_virtualbox
Successfully added Box ‘Lucid32″ for “Virtualbox”

C:\HashiCorp\vagrant\bin> vagrant init lucid32

A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on`vagrantup.com` for more information on using Vagrant.

vagrant_init_lucid32
A `Vagrantfile` has been placed in this directory

C:\HashiCorp\vagrant\bin> vagrant up

C:\HashiCorp\Vagrant\bin>vagrant up
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Importing base box ‘lucid32’…
==> default: Matching MAC address for NAT networking…
==> default: Setting the name of the VM: bin_default_1396737444370_66404
==> default: Clearing any previously set network interfaces…
==> default: Preparing network interfaces based on configuration…
default: Adapter 1: nat
==> default: Forwarding ports…
default: 22 => 2222 (adapter 1)
==> default: Booting VM…
==> default: Waiting for machine to boot. This may take a few minutes…
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key

Vagrant Up
Vagrant Up

 5. Open VirtualBox . Vagrant setup Ubuntu virtual machine in three line of command.

vagrant_virtulbox

Very powerful and easy to setup Virtual Machine using Vagrant

 

6. Now let’s connect to Vagrant build virtual machine using putty

Open Putty and enter the following information.  When I installed I got IP address of 127.0.0.1 with port 2222

connect-vagrant-virtul-box-using-putty
connect-vagrant-virtul-box-using-putty

 

You may get puTTY security Alert, click “Yes”

connect-vagrant-virtual-machine-using-putty

The server’s host key is not cached in the registry. You have to guarantee that the server is computer you think it is.
If you trust this host, hit yes to add the key to PuTTy’s cache and carry on connecting.
If you want to carry on connecting just once, without adding the key to the cache, hit NO. If you do not trust this host, hit Cancel to abandon the connection.

7. Enter username: vagrant and Password: vagrant

Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 07:26:29 2012 from 10.0.2.2

vagrant-built-virtual-machine
vagrant-built-virtual-machine

vagrant-built-virtual-machine is ready 

 

2 thoughts on “Installing Vagrant on Windows 7 and 8

  1. Hello. Thanks for the post, however I keep getting this error whenever I run vagrant up:

    ==> default: Clearing any previously set network interfaces…
    ==> default: Preparing network interfaces based on configuration…
    default: Adapter 1: nat
    default: Adapter 2: hostonly
    ==> default: Forwarding ports…
    default: 22 => 2222 (adapter 1)
    ==> default: Booting VM…
    ==> default: Waiting for machine to boot. This may take a few minutes…
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…
    default: Error: Connection timeout. Retrying…

    How can I fix this? Please help. I am a nubby at vagrant. Thanks.

    • Check:
      1. Hardware virtualization enabled iin BIOS
      2. path to SSH keys in .yaml file
      3. filenames of SSH keys correct in .yaml file

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s