Skip to main content

Adding Vagrant Plugins

Hands-On Lab

 

Photo of Elle Krout

Elle Krout

Content Team Lead in Content

Length

00:15:00

Difficulty

Beginner

While Vagrant offers plenty of features out of the box, it's not uncommon to come across a Vagrantfile that requires some kind of additional plugin to run properly. Vagrant plugins can be managed via the vagrant plugin command, and are generally single-command installs. In this hands-on lab, we will add, remove, and otherwise manage various plugins to ensure we have the proper setup to support our Vagrantfile.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Adding Vagrant Plugins

Introduction

In this hands-on lab, we will add, remove, and otherwise manage various plugins to ensure we have the proper setup to support our Vagrantfile.

Solution

Begin by logging in to the lab server using the credentials provided on the hands-on lab page:

ssh cloud_user@PUBLIC_IP_ADDRESS

Review and Update Current Vagrant Setup

  1. List current plugins:

    vagrant plugin list
  2. Remove existing plugins; any of the following commands will work:

    vagrant plugin uninstall vagrant-hostmanager
    vagrant plugin expunge

Add Required Provider and Plugin

  1. Install the LXC provider:

    vagrant plugin install vagrant-lxc
  2. Install the vagrant-git plugin:

    vagrant plugin install vagrant-git
  3. Confirm the installation was successful with the following command:

    vagrant plugin list

Run the Vagrantfile

  1. We can check that we have the proper plugins installed by running the provided Vagrantfile:

    cd lxc-env
    vagrant up

    Note: We should see successful and ready messages indicating that our Vagrant environment is up without errors.

Conclusion

Congratulations - you've completed this hands-on lab!