Michael Joyner
Michael Joyner

Reputation: 145

Moving Vagrant machines off of old computer

Here are the steps that I went to move off of old computer

Copied ~/.vagrant to USB drive
Copied ~/Virtual Box/* to USB hard drive
Copied clients to USB hard drive

Each subdirectory in clients looks like this:

enter image description here

HERE IS MY PROBLEM :

enter image description here

enter image description here

And here is my Vagrant file where I set the name:

enter image description here

My problem is that it wont bring up the Vagrant machine that I copied over, CAN SOMEONE PLEASE TELL ME WHY VAGRANT ISN'T RECOGNIZING THE MACHINE AND STARTING IT. Why does it want to create a new box if I told it what box to start?

Upvotes: 1

Views: 911

Answers (1)

Frederic Henri
Frederic Henri

Reputation: 53783

The name of the VM is not much important - what is really important is the uuid of the machine.

When you moved the VirtualBox VMs to your USD, when you had reopened VirtualBox those VM became inaccessible so you had to reimport them and thus it recreated a new uuid for the VM and vagrant which keeps track of the uuid was not able to retrieve it from VirtualBox then it recreated a new VM.

VirtualBox keeps the link between the uuid of your VM and the physical location in the file ./Library/VirtualBox/VirtualBox.xml if you open this file, you will find the entry:

<MachineRegistry>
  <MachineEntry uuid="{cf5c9fe6-be04-40f8-aeec-415bb0b74e37}" src="/Users/fhenri/Documents/Virtual Machines.localized/tacsvn_default_1386768343/tacsvn_default_1386768343.vbox"/>
  <MachineEntry uuid="{08732b8b-e80e-4707-9f4c-842bdcdb2442}" src="/Users/fhenri/Documents/Virtual Machines.localized/pwslocal_default_1386328036/pwslocal_default_1386328036.vbox"/>
  <MachineEntry uuid="{ced87630-c5d9-4396-9fc1-7a9277ec2f4a}" src="/Volumes/Passport/vm/AribaSandbox_sourcing_1386791950/AribaSandbox_sourcing_1386791950.vbox"/>
  <MachineEntry uuid="{b9fc4466-2382-4629-9fcf-f414ab5093fd}" src="/Volumes/Passport/vm/AribaSandbox_asm_1386792168/AribaSandbox_asm_1386792168.vbox"/>
  <MachineEntry uuid="{4442b12f-2b52-4edd-aa94-e87e2f4e54cd}" src="/Volumes/Passport/vm/fhsolution.com/fhsolution.com.vbox"/>
  <MachineEntry uuid="{650472d0-3bb7-4a64-9035-8a6c6e012eb3}" src="/Users/fhenri/.docker/machine/machines/default/default/default.vbox"/>
  <MachineEntry uuid="{17140ebf-94f3-4434-8576-e8c19cce05f4}" src="/Users/fhenri/Documents/Virtual Machines.localized/ubuntu_web_1452632837414_99758/ubuntu_web_1452632837414_99758.vbox"/>
  <MachineEntry uuid="{4bbf157f-00d4-4ee6-8aa1-fc3b170ad1a9}" src="/Users/fhenri/Documents/Virtual Machines.localized/ubuntu_default_1457125361118_11876/ubuntu_default_1457125361118_11876.vbox"/>
  <MachineEntry uuid="{ff197c01-2f63-4e46-b8b6-98757a6f5084}" src="/Users/fhenri/Documents/Virtual Machines.localized/java_default_1460033990347_57680/java_default_1460033990347_57680.vbox"/>
  <MachineEntry uuid="{c4a3a84c-6cf3-4d8f-87de-47b6abe41b5d}" src="/Users/fhenri/Documents/Virtual Machines.localized/ubuntu_default_1461321611815_8129/ubuntu_default_1461321611815_8129.vbox"/>
  <MachineEntry uuid="{57559b51-0446-4b62-98c6-100bd09700a0}" src="/Users/fhenri/Documents/Virtual Machines.localized/debian_default_1461336132946_97987/debian_default_1461336132946_97987.vbox"/>
</MachineRegistry>

Vagrant is keeping those uuid in an id file inside the .vagrant/machines/default/virtualbox of your project folder so both must match and point to the right folder within your USB drive

Upvotes: 3

Related Questions