Vagrant VM does not save any changes; creates a new virtual machine on each "halt / suspend + up" (Windows Vagrant, VirtualBox, RailsDevBox)

I am trying to use Virtual Box + Vagrant + Rails Dev Box on a windows machine. I can run vagrant upand vagrant sshto enter the virtual machine, but none of the changes that I make are saved, for example, the installation of rails. Every time I haltVagrant and start again, it is as if I downloaded it for the first time. The process goes through all the steps that take the first vagrant up.

I noticed, however, that one change I made to Vagrantfile (location of synchronized folders) is saved. Also, if I use vagrant reload, the changes seem to be saved. So it seems like the problem occurs if I use vagrant haltor vagrant suspend, and then vagrant up. But I had no impression that vagrant halt(and especially not vagrant suspend) should destroy the virtual machine.

And when I open VirtualBox Manager, I see a bunch of rails-dev-box virtual machine instances that were created.

I found a problem that looks like this on the Vagrant Github issues website , but to be honest, the discussion is completely over my head, and I was not able to understand the resolution, even if this thread is closed.

If someone knows what causes and can explain in terms of “newbies”, or if my problem is too opaque, I can go through the following steps for debugging, I would really appreciate it!

EDIT After I wrote this and thought about it more, I realized that the problem is not that "the changes are not saved." They are saved ... but I just end up in a new virtual machine every time I start vagrant up.

+4
source share
3 answers

Have you tried vagrant resumeinstead vagrant up?

+1
source

I had the same problem and I have several possible solutions.

Vagrant VM .vagrant/machines/default/virtualbox/id. ( UUID , VirtualBox.xml.) - VM, , Vagrant, -, .

One GitHub , " " VirtualBox. .

, , . , , .

: VirtualBox Manager ( , Vagrant). , . id , . vagrant up, . , action_provision . : 1.5:<uuid>, <uuid> - UUID. ( , 1.5). vagrant suspend, vagrant halt ( vagrant up) , . , . - , , .

2: , , . -, , VAGRANT_LOG=debug vagrant status. , , : VBoxManage.exe: error: could not find a registered machine with uuid <uuid>. , VBoxManage.exe list vms . , VirtualBox .VirtualBox, Cygwin. , , , VirtualBox, HOME. Windows (/cygdrive/c/Users/<me>) .bashrc, , .

TL; :

  • VirtualBox , , .
  • Cygwin, , HOME .
  • VAGRANT_LOG=debug Vagrant .
+1

-, , , .

vagrant global-status "" , vagrant package {id} package.box.

vagrant box add package.box --name {whatever-name} - .

You can then either create a new Vagrantfile or modify the existing one to load vm with this new name.

Hope this helps.

0
source

All Articles