Installing a Vagrant plugin

Let's install a plugin from the RubyGems website. I've searched for vagrant and found one called vagrant-hostsupdater, which is currently version 1.1.1.160 and has just over 500,000 downloads. Here is a screenshot of the plugin in the RubyGems search results:

This plugin will attempt to edit your /etc/hosts file by adding and removing hosts when Vagrant machines are created and destroyed, respectively. This means that you can access the Vagrant machine by a domain name such as machine.dev instead of 192.168.10.10.

We can install this plugin by running the following command:

vagrant plugin install vagrant-hostsupdater ...

Get Hands-On DevOps with Vagrant now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.