0

Why I can't make new Virtual Machine using Vagrant, every time I do vagrant up it always overrides my previous created VM, even I changed the box name and vm name like below codes:

# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION_NO = "2"    
Vagrant.configure(VAGRANTFILE_API_VERSION_NO) do |config|        
  config.vm.define "vagrant" do |v|
     v.vm.box = "changed_box_name"
     ........
     v.vm.provider :virtualbox do |vb|
       vb.gui = true
       vb.name = "changed_vm_name"
       .....
    end
  end
end
aldrien.h
  • 3,437
  • 2
  • 30
  • 52
  • How about copy the code (Vagrantfile) to new folder? Vagrant virtual machines are named by its folder. – BMW Oct 23 '15 at 04:29
  • i tried to rename the main folder where the Vagrant file is, and also changed box and vm name but still overriding my previous created VM. – aldrien.h Oct 23 '15 at 08:37
  • what do you use as `changed_box_name` is it a local box so you installed it ? or you reference a public box ? – Frederic Henri Oct 23 '15 at 12:48
  • Hi Frederic, the changed_box_name is referenced to the url (e.g. v.vm.box_url = "https://....") provided for downloading box (Centos7 for ex.) is that what you mean? – aldrien.h Oct 26 '15 at 00:53

1 Answers1

0

SOLVED

I got by deleting the .vagrant directory inside the main folder which Vagrant file is. The .vagrant directory holds the caches for every VM creation via vagrant up. In some of my environment that directory is AUTO clear every time I do vagrant up.

But not on my current unit (I'm not sure why) so I need to delete/remove (.vagrant) directory manually

Then changing box and vm name, eventually works to create new VM Instance.

Finally running vagrant up again.

aldrien.h
  • 3,437
  • 2
  • 30
  • 52