Install Vagrant and Vagrant Plugins

Install Vagrant, Vagrant plugin vagrant-lxd, vagrant-windows-sysprep and enable Vagrant autocomplete.

To install Vagrant, follow these steps:

  1. Install Vagrant: begin by downloading and installing the appropriate Vagrant package for your operating system:

    wget https://releases.hashicorp.com/vagrant/2.3.1/vagrant_2.3.1-1_amd64.deb
    sudo dpkg -i vagrant_2.3.1-1_amd64.deb
    
  2. Install Plugins and Enable Autocomplete: to extend Vagrant’s functionality with the vagrant-lxd and vagrant-registration plugins, and to enable Vagrant command completion  , execute the following:

    vagrant plugin install minitest --plugin-version 5.17.0
    vagrant plugin install public_suffix --plugin-version 5.0.3
    vagrant plugin install vagrant-lxd --plugin-version 0.7.1
    vagrant plugin install vagrant-registration --plugin-version 1.3.4
    vagrant autocomplete install --bash
    

    To see what you have installed, execute the following command:

    ls ~/.vagrant.d/gems/2.7.6/gems/ -1
    
    Show me
    onknows@io3:~$ ls ~/.vagrant.d/gems/2.7.6/gems/ -1
    activesupport-5.2.8.1
    addressable-2.8.6
    faraday-0.17.6
    hyperkit-1.3.0
    minitest-5.17.0
    multipart-post-2.4.0
    public_suffix-5.0.3
    sawyer-0.9.2
    thread_safe-0.3.6
    tzinfo-1.2.11
    vagrant-berkshelf-5.1.2
    vagrant-lxd-0.7.1
    vagrant-omnibus-1.5.0
    vagrant-registration-1.3.4
    vagrant-windows-sysprep-0.0.11
    

    To remove all installed plugins execute:

    rm -rf ~/.vagrant.d
    
  3. Install the Vagrant Windows Sysprep Provisioner: Additionally, install a custom version of the Vagrant Windows Sysprep Provisioner  . This version is designed to work idempotently, enabling you to prepare Windows installations for reuse using Sysprep  . Follow these steps:

    wget https://c2platform.org/downloads/c2-iekeiTh7Fah5Orangooy/vagrant-windows-sysprep-0.0.11.gem
    vagrant plugin install vagrant-windows-sysprep-*.gem
    
  4. Optional: Automate Red Hat Linux VM Registration: for those utilizing Red Hat Linux VMs, streamline the registration and unsubscription process by setting up RHEL_DEV_ACCOUNT and RHEL_DEV_SECRET environment variables. Refer to Streamlining RHEL Registration and Subscription Automation for detailed guidance.