Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

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 ProjectVagrantcd 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
  • 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. Add entries like below.
Hostname:- vagrant@
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.

Solved: Install ifconfig and ssh in Ubuntu

In this post we will see how to install ifconfig and ssh in Ubuntu 16.04 Xenial Xerus. You can install both or either of them independently .
By default you can check IP details in Ubuntu using
ip addr
But if you are more comfortable with “ifconfig”  then follow on.
Ensure that your Ubuntu instance is connected to internet or to your local package repository server from which it can pull packages.
If you need ifconfig in your ubuntu server use following commands.
sudo apt-get updatesudo apt-get install net-tools
“ifconfig” command should now work
ifconfig -a
If you are trying to get ssh. Use the below command.
sudo apt-get install openssh-server
Once the ssh installation is done check the status of ssh service
sudo service ssh status
If the service is not running you will have to start it with following command.
sudo service ssh start
Once this is done you should get a message of service started ok. You can check service status again with
sudo service ssh status
The default configuration file for ssh is /etc/ssh/sshd_config . If you make any changes to this file you will have to restart the ssh service to make the changes effective.
sudo service ssh restart
If you are using docker you can create a golden image after doing this installation. So that you don’t have to do this installation in all new containers. To check how to create a golden image for a docker container check this post .