Vagrant command lines

Install Vagrant from official website

  If you use apt or yum to download Vagrant, the version might be too old to be compatible to your virtualbox or vmware. Therefore, please download it from the official website .

Download VirtualBox from website

  Please download the suitable version of VirtualBox.

Common and useful commands:

Download and init vagrant box
$ vagrant init <Vargant box>
E.g : Download vagrant box which has Kubernetes.
vagrant init flixtech/kubernetes

Note: The box file will be stored in ~/.vagrant.d/boxes/
Creates and configures guest machines according to your Vagrantfile.
$ vargant up

Bring the machine up with the given provider. By default, this is "virtualbox".
$ vargant up --provider x

E.g : Change the provider to vmware
$ vagrant up --provider vmware

Check the current machine states
$ vagrant status

List all of base boxes for Vagrant
$ vagrant box list

Shut the current machine
$ vagrant halt

Stops the running machine and destroys all resources that were created 
$ vagrant destroy

SSH into a running Vagrant machine
$ vagrant ssh

No comments:

Post a Comment