Create and configure lightweight, reproducible, and portable development environments. Vagrant is an amazing tool for managing virtual machines via a simple to use command line interface.
Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.
$ brew cask install virtualbox
Now install Vagrant either from the website or use homebrew for installing it.
$ brew cask install vagrant
Vagrant-Manager helps you manage all your virtual machines in one place directly from the menubar.
$ brew cask install vagrant-manager
Now lets start the Vagrant box. The following DevOps tools will be automatically install in your Vagrant box.
Navigate to the root /vagrant.resources/ directory and then run the following command to start the Vagrant:
$ cd vagrant.resources
$ vagrant upYou can ssh into the machine now.
$ vagrant ssh
Login and password for most of Vagrant boxes are
Username : vagrant
Password : vagrant
Halt the vagrant machine now.
$ vagrant halt
Other useful commands are suspend, destroy etc.
If you want to connect to your vagrant box then you would connect to it in the following way.
ssh vagrant@192.168.50.10 -i ~/.vagrant.d/insecure_private_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o IdentitiesOnly=yes
You can also copy vagrant ssh-config into~/.ssh/config. This will allow you to use ssh ssh k8s-1 from anywhere.
$ cd ~/Vagrant
$ vagrant ssh-config >> ~/.ssh/config