Vagrant 1.8.1
MacOS El Capitan 10.11.5
Ubuntu 16.04 LTS
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
end
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/xenial64' is up to date...
A VirtualBox machine with the name 'ubuntu-xenial-16.04-cloudimg' already exists.
Please use another name or delete the machine with the existing
name, and try again.
Second virtual machine with ubuntu 16.04 is created.
Second virtual machine with ubuntu 16.04 is not created.
Hi @zhdanovartur
Can you please share the complete debug output from both vagrant up commands?
Hi @zhdanovartur
Thank you for that. I spent about an hour tracing down this issue, and, unfortunately, it is actually an issue with that base box. For a little bit of background - base boxes can package their own Vagrantfile that gets merged with _your_ Vagrantfile to define some common configuration and settings.
Here is the Vagrantfile that the ubuntu/xenial64 box is loading (you can find this in ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-xenial64/20160531.0.0/virtualbox/Vagrantfile):
Vagrant.configure("2") do |config|
config.vm.base_mac = "0227536041F1"
config.ssh.username = "ubuntu"
config.ssh.password = "ef360fd092f03db9cc3f8aa0"
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.provider "virtualbox" do |vb|
vb.name = "ubuntu-xenial-16.04-cloudimg"
vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ]
vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "%s-console.log" % vb.name) ]
end
end
Virtualbox requires that machine names are unique, and Vagrant has special code to set the name to a unique value. However, as you may notice, that code only runs if the provider was not given a specific name. If the user wants to give the box a name, we have to respect that configuration.
We will bring this to the attention of the box creator, but please note that Atlas (formerly VagrantCloud) is structured similar to GitHub; there are no "official" boxes. The boxes published under the ubuntu namespace are merely owned by that organization - they are not the official boxes. I would recommend giving the boxes under the bento namespace a try. Many users have traditionally had more success with those. Thanks and sorry! 馃槃
@sethvargo thanks!
vagrant init bento/ubuntu-16.04
works fine for me.
Most helpful comment
Hi @zhdanovartur
Thank you for that. I spent about an hour tracing down this issue, and, unfortunately, it is actually an issue with that base box. For a little bit of background - base boxes can package their own Vagrantfile that gets merged with _your_ Vagrantfile to define some common configuration and settings.
Here is the Vagrantfile that the ubuntu/xenial64 box is loading (you can find this in
~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-xenial64/20160531.0.0/virtualbox/Vagrantfile):Virtualbox requires that machine names are unique, and Vagrant has special code to set the name to a unique value. However, as you may notice, that code only runs if the provider was not given a specific name. If the user wants to give the box a name, we have to respect that configuration.
We will bring this to the attention of the box creator, but please note that Atlas (formerly VagrantCloud) is structured similar to GitHub; there are no "official" boxes. The boxes published under the
ubuntunamespace are merely owned by that organization - they are not the official boxes. I would recommend giving the boxes under thebentonamespace a try. Many users have traditionally had more success with those. Thanks and sorry! 馃槃