Install vagrant and create VM on your windows laptop or desktop

In this post we will show you how to install vagrant in your laptop and start a Ubuntu Linux VM.

You will have to download these softwares and install them on your laptop.

 

  • Once they are downloaded.

First Install Virtual Box.  Just click on exe and follow installation instructions.

Next Install Vagrant. Just click on exe and follow installation instructions.

Putty and PuttyGen don’t need any installation, you can use them directly.

Once the pre-requisites are installed let’s move ahead.

  • Open the windows command prompt. CMD
  • Go to the directory where you will need the vagrant machines to be installed. e.g.
cd C:\users
  • Once you are in desired directory create a new directory .
mkdir ProjectVagrant

cd ProjectVagrant
  • Create a new Vagrant File
vagrant init ubuntu/trusty64
  • Below command will download the Ubuntu Trusty 64 OS image and create VM. Ensure you are connected to network.
vagrant up

 

Code your future with Programming skills. Courses starting at $10.99 only!
  • Setup ssh
vagrant ssh

Above command will give you IP, Port and Private key for the machine.

  • Using putty you can connect to the machine. Your putty session should look like below image.

Hostname:- vagrant@127.0.0.1

Port :- 2222

Default password :- vagrant

If you want to login using the ssh key you will have to first convert the .pem key to .ppk. Follow this post on How to convert .pem key to .ppk and login to VM ?

That’s all in this post! Hope it’s useful for you. If you have any query please write in comments section.

Leave a Reply

Your email address will not be published. Required fields are marked *