Use your RHEL Vagrant boxes as any other with vagrant-registration

vagrant-registration plugin for Vagrant allows developers to easily register their guests for updates on systems with a subscription model like Red Hat Enterprise Linux. Here is how to install the plugin and set it up.

You can install vagrant-registration plugin as:

Note that on Fedora, we have it packaged:

After installation you are able to update your project’s Vagrantfile (or global Vagrantfile for every project as I already mentioned):

As you can see, you can either choose username/password or org/activationkey combinations to register your RHEL box. This will run subscription-manager register on vagrant up and unregister on vagrant halt and vagrant destroy.

You can even choose to unregister only on destroy:

or skip registration altogether:

You need to explicitly skip registration because otherwise the plugin will prompt you for your username/password input interactively.

If you need to pass more options to subscription-manager register, vagrant-registration supports all the options of register command. By default it appends --force and --auto-attach flags.

Also support for other systems such as SLES would be very easy to add, but I don’t have the subscription to properly test it. Perhaps some of you can help?

Join the Conversation

1 Comment

  1. Great work, thank you!

    One caveat: if you are using NFS for file sharing between host and VM, you can run into a chicken-and-egg problem; Vagrant may try to install some NFS-related RPMs before the VM is registered with the subscription manager.

    The solution is to install the three required RPMs (and their dependencies) when preparing your box: nfs-utils nfs-utils-lib portmap

Leave a comment

Your email address will not be published. Required fields are marked *