TL;DR; Can someone help me understand the difference between these "names" defined in a Vagrantfile?
config.vm.define "worker"
box.vm.box = "ots-box"
box.vm.host_name = "worker"
vb.name = "barhost"
While trying to change the hostname of the vagrant instance I had, I was lost in the Vagrantfile syntax. Now I have successfully changed the hostname but some other things (network) isn't working. I suspect I've changed something that has lead vagrant to configure the box is a particular way, which caused this issue.
Vagrant.configure("2") do |config|
config.vm.define "worker".to_sym do |box|
box.vm.box = "ots-box"
box.vm.box_url = "http://testing.xxx.com.s3.amazonaws.com/ots-fe.box"
box.vm.host_name = "worker"
end
I suppose it's irrelevant but I'm trying to create an ubuntu box on Mac El-capitan with Oracle VirtualBox and vagrant version 1.7.4.
Documentation says: config.vm.box - This configures what box the machine will be brought up against. The value here should be the name of an installed box or a shorthand name of a box in HashiCorp's Atlas.
Example here introduces another term vb.name
:
Vagrant.configure('2') do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.define "foohost" do |foohost|
end
config.vm.provider :virtualbox do |vb|
vb.name = "barhost"
end
end