LinuxCommandLibrary

vagrant-plugin

Manage Vagrant plugins

TLDR

List all the plugins currently installed

$ vagrant plugin list
copy

Install a plugin from remote repositories, usually RubyGems
$ vagrant plugin install [vagrant_vbguest]
copy

Install a plugin from a local file source
$ vagrant plugin install [path/to/my_plugin.gem]
copy

Update all installed plugins to their latest version
$ vagrant plugin update
copy

Update a plugin to the latest version
$ vagrant plugin update [vagrant_vbguest]
copy

Uninstall a specific plugin
$ vagrant plugin uninstall [vagrant_vbguest]
copy

SYNOPSIS

vagrant plugin install <name> [<name2> ...] [--plugin-version <version>] [--plugin-source <source>] [--local] [--no-install-deps] [--system]
vagrant plugin uninstall <name> [<name2> ...] [--system]
vagrant plugin list
vagrant plugin update [<name> [<name2> ...]] [--plugin-version <version>] [--plugin-source <source>] [--system]
vagrant plugin license <name> <path_to_license_file>

PARAMETERS

<name>
    The name of the plugin (Ruby gem) to install, uninstall, update, or license. Multiple names can be specified for `install`, `uninstall`, and `update` subcommands.

--plugin-version <version>
    Specifies a specific version of the plugin to install or update to. If omitted, the latest compatible version is used. Applicable to `install` and `update`.

--plugin-source <source>
    Provides an alternative RubyGems source URL from which to download the plugin. This is useful for private gem servers or custom repositories. Applicable to `install` and `update`.

--local
    Instructs the `install` subcommand to treat <name> as a local gem file path (e.g., /path/to/my-plugin-1.0.0.gem) rather than a remote gem name from RubyGems.org.

--no-install-deps
    When installing, this flag prevents Vagrant from automatically installing plugin dependencies. Use with caution, as this may lead to broken or non-functional plugins if dependencies are missing. Applicable to `install`.

--system
    (Advanced) Installs or uninstalls the plugin into the system-wide Ruby environment instead of Vagrant's isolated environment. This is generally discouraged for typical usage due to potential conflicts with other Ruby installations.

<path_to_license_file>
    For the `license` subcommand, this is the absolute path to the license file required by a commercial plugin to unlock its full functionality.

DESCRIPTION

The `vagrant plugin` command is a powerful subcommand of Vagrant that allows users to seamlessly manage extensions to Vagrant's core functionality. These plugins significantly expand Vagrant's capabilities, enabling support for new virtualization providers (e.g., Hyper-V, VMware), integrating additional provisioners (e.g., Puppet Apply, Chef Solo), facilitating different communication methods, and offering custom synced folder types. This command provides a unified and user-friendly interface to install new plugins from remote sources or local files, uninstall existing ones, list currently installed plugins with their versions, and update them to their latest compatible versions. Underneath, it leverages the RubyGems package manager to handle the actual gem installation and management, abstracting away the complexities from the user. It's an essential tool for customizing and extending your Vagrant workflows.

CAVEATS

Key considerations and limitations:

1. Internet Dependency: Most plugin operations (install, update) require an active internet connection to download gems from RubyGems.org or specified sources.

2. RubyGems Reliance: Plugins are Ruby gems and operations rely on the underlying RubyGems ecosystem. Issues with RubyGems configuration or network connectivity can prevent successful operations.

3. System Flag Caution: Using the --system flag can lead to conflicts with other Ruby installations or system-wide gems and is generally not recommended for typical Vagrant usage. Use with extreme caution.

4. Compatibility: Always ensure plugin compatibility with your specific Vagrant version before installation to avoid unexpected behavior.

PLUGIN DISCOVERY

Plugins are primarily discovered on RubyGems.org, the official gem hosting service. You can search for 'vagrant-' prefixed gems, or consult the official Vagrant documentation and community resources for recommended plugins. The `vagrant plugin list` command shows all plugins currently installed in your Vagrant environment, including their versions.

COMMERCIAL PLUGINS AND LICENSING

While a vast majority of Vagrant plugins are open-source and free, some are commercial offerings (e.g., the Vagrant VMware Fusion provider). For these, you typically need to purchase a license. The `vagrant plugin license` subcommand is specifically designed to apply these license files to your installed commercial plugins, thereby unlocking their full functionality.

HISTORY

Plugin support has been a cornerstone of Vagrant's extensibility since its early versions. Initially, users might have manually installed RubyGems. The dedicated `vagrant plugin` subcommand was introduced to streamline and standardize this process, making it significantly easier for users to extend Vagrant's functionality without deep knowledge of RubyGems. This command has continuously evolved to provide a robust and user-friendly interface for managing the rich ecosystem of Vagrant plugins, solidifying its role as a key feature.

SEE ALSO

vagrant(1), gem(1), vagrant box(1)

Copied to clipboard