Lucius, in order for Vagrant to automatically select a provider, you would
need to supply it a metadata.json file that tells it which providers are
available for the box, and this is usually done at the time the box is
created (in Atlas for example). If you have two boxes with the same name
locally, you WILL always have to specify the provider for one, though you
can change which provider is used by default by setting an environment
variable with your preferred provider.
If you have more questions let us know, I think there have been examples of
the dual provider metadata file posted in the past, otherwise I have one we
use regularly for our boxes, but we have switched from Vbox to VMware and
no longer do the dual provider thing.
On Thursday, August 13, 2015 at 11:29:54 AM UTC-5, Lucius Bono wrote:
>
> Having trouble creating a Vagrantfile that will automatically select an
> available provider / box pair. Here is my Vagrantfile so far:
>
> # -*- mode: ruby -*-
> # vi: set ft=ruby :
>
> Vagrant.require_version ">= 1.6.2"
>
> Vagrant.configure("2") do |config|
> config.vm.box = "windows_81"
> config.vm.communicator = "winrm"
>
> config.vm.guest = :windows
>
> config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp",
> auto_correct: true
> config.vm.network :forwarded_port, guest: 5985, host: 5985, id:
> "winrm", auto_correct: true
>
> config.vm.provider "vmware_fusion" do |v, override|
> v.vmx["memsize"] = "2048"
> v.vmx["numvcpus"] = "2"
> v.vmx["ethernet0.virtualDev"] = "vmxnet3"
> v.vmx["scsi0.virtualDev"] = "lsisas1068"
> end
>
> config.vm.provider "vmware_workstation" do |v, override|
> v.vmx["memsize"] = "2048"
> v.vmx["numvcpus"] = "2"
> v.vmx["ethernet0.virtualDev"] = "vmxnet3"
> v.vmx["scsi0.virtualDev"] = "lsisas1068"
> end
>
> config.vm.provider "virtualbox" do |v, override|
> v.customize ["modifyvm", :id, "--memory", 2048]
> v.customize ["modifyvm", :id, "--cpus", 2]
> v.customize ["setextradata", "global", "GUI/SuppressMessages",
> "all" ]
> end
>
> end
>
> I have both Virtualbox and VMWare Fusion (with the VMWare Fusion Vagrant
> plugin, of course) installed on this system. If the VMWare Fusion box is
> installed, no problem - the Vagrantfile fires up right away - however, if I
> only install a Virtualbox box with the name "windows_81" I have to specify
> the provider in vagrant up or else I get an error.
>
> This isn't a big deal, but from what I understand Vagrant should be able
> to navigate this scenario automatically - which leads me to believe that my
> Vagrantfile is written incorrectly. This Vagrantfile is mostly cannibalized
> from other projects, I am not super comfortable with writing my own
> Vagrantfiles yet.
>
> Any help would be appreciated! The last piece of this is I am running
> Vagrant 1.7.2 due to an issue I'm having with 1.7.4 (which I will log an
> issue in Github for as soon as I get a moment).
>
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/4380d96a-ac44-4a8c-a514-9d0bddb1ff2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.