...

/

Some Vagrant Commands

Some Vagrant Commands

Let's explore some common Vagrant commands.

Basic Vagrant commands

vagrant init [name [url]]

Initializes the Vagrant environment and creates the Vagrantfile.

$ vagrant init centos/7

Output

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 up [name|id]

Creates and configures the Virtual Machine from the Vagrantfile.

$ vagrant up 

Output

==> default: Configuring and enabling network interfaces...
    default: SSH address: 192.168.121.24:22
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Rsyncing folder: /home/naavi/Vagrant/my-vagrant/ => /vagrant

vagrant status [name|id]

...