I'm creating a Red Hat Enterprise Linux 7 VM in VirtualBox with vagrant. If I have a base box that both doesn't have the VirtualBox guest additions, and isn't registered, then I'd manually need to do the following:
- Register the box with subscription-manager
- Install guest additions
The reason that I'd need to perform registration first, is that to install guest additions, I'd need to install some extra packages.
Now, there are 3rd-party vagrant plugins for both of these tasks: vagrant-registration and vagrant-vbguest.
The issue that I'm having is that the vagrant-vbguest
plugin will always try to run first, and will fail to download the packages that it needs, because the vagrant-registration
plugin hasn't yet had a chance to register the system.
Is there a way to force one of them to be run before the other? Or any other alternative solution that I haven't thought of yet (I'm not a vagrant wizard (or is that just called a vagrant?) yet)?
in the spirit of my comments but it should be in a more automatic way
not sure though that it will run in the correct order (did not try myself)
Edit the issue with this code is that it will try to run the vbguest right when the command is launched so before the vm is running so vbguest cannot install the necessary libs.
the other possibility I see is to use the vagrant trigger plugin (https://github.com/emyl/vagrant-triggers), you can define to run specific script after specific command has been run
the vbguest is correctly run after the machine is booted (so I am assuming after vagrant-registration did its own stuff)
the output (interesting part) of running
vagrant up
:installation of the guest additions goes on and machine rebooted ok
This seems to be an issue with vagrant-registration plugin. See https://github.com/projectatomic/adb-vagrant-registration/issues/69
The issue has been fixed and the fixed version is released now i.e. https://rubygems.org/gems/vagrant-registration/versions/1.2.2