How to use Vagrant plugins

Overview:

Vagrant plugins are third-party tools that extend the functionality of the Vagrant installed on your system. Be aware of the risks related to third-party plugins when using them in your environment.

Also, be aware that some of the plugins are paid and locked behind the license agreements.

Plugin commands:

  1. To install the plugin use:
    vagrant plugin install [plugin_name]
    
    For example vbinfo plugin gives info about available VirtualBox images on the system:
    vagrant plugin install vbinfo
    
  2. To use the plugin:
    vagrant [plugin_name]
    
  3. To list all installed plugins use:
    vagrant plugin list
    
  4. To update the plugin use:
    vagrant plugin update [plugin_name]
    
  5. In case of errors with plugins, use the following command to repair plugin with common solutions:
    vagrant plugin repair
    
  6. To associate the plugin with licence file you have use:
    vagrant plugin license [license_file]
    
  7. To remove the plugin use:
    vagrant plugin uninstall [plugin_name]
    
  8. To delete all plugins use:
    vagrant plugin expunge
    
  9. To reinstall all expunged plugins use:
    vagrant plugin expunge --reinstall
    

Provider plugins:

Provider plugins adds functionality to communicate with cloud providers and hypervisors. For example to install AWS Cloud provider plugin use:

vagrant plugin install vagrant-aws

To see the complete list of provider plugins go here

Useful plugins:

  1. vbguest plugin install VirtualBox guest addition to the system automatically (manage machines via GUI):
    vagrant plugin install vagrant-vbguest
    
  2. For Windows-based machines to enable NFS support:
    vagrant plugin install vagrant-winnfsd
    
  3. Hostmanager for multi-machine setups:
    vagrant plugin install vagrant-hostmanager
    
  4. To show all forwarded ports from guest to host machine use:
    vagrant plugin install vagrant-netinfo
    
  5. To work with Git repositories use:
    vagrant plugin install vagrant-git
    

Reference:

  1. Vagrant core plugins
  2. Vagrant plugins docs
  3. Available Vagrant plugins