vagrant provider specific hostmanager settings

1k Views Asked by At

Sounds simple - I'm trying to switch the vagrant hostmanager plugin on for Virtualbox only.

So I attempt an overwrite:

config.hostmanager.enabled = false

...

config.vm.provider "virtualbox" do |vb|
    vb.hostmanager.enabled = true
    ...
end
config.vm.provider "azure" do |azure|
    # do nothing
    ...
end

However, vagrant complains about it:

There are errors in the configuration of this machine. Please fix the following errors and try again:

VirtualBox Provider:
* The following settings shouldn't exist: hostmanager

Edit: I also tried...

config.vm.provider "virtualbox" do |vb,override|
    override.hostmanager.enabled = true
    ...
end

This doesn't throw an error but it also doesn't run hostmanager either :(

What am I doing wrong?

1

There are 1 best solutions below

0
On

I had the same error when I configured something like

config.vm.hostmanager.aliases = %w(my.example.local)

but correct is

config.hostmanager.aliases = %w(my.example.local)

Maybe you had a similar typo?