Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will "vagrant box update" destroy my current VM?

Tags:

vagrant

as described on the title, will vagrant box update destroy my current VM? My current vagrant VM is a little too fragile and needs some time to setup after it has been destroyed.

On each vagrant up I get a message, that a newer version of my base box is available, but I hesitate to do so, because I need the current setup of my VM for daily work.

Am I safe to update?

like image 689
Basster Avatar asked Feb 25 '15 09:02

Basster


People also ask

What does vagrant box update do?

Command: vagrant box update This command updates the box for the current Vagrant environment if there are updates available. The command can also update a specific box (outside of an active Vagrant environment), by specifying the --box flag. Note that updating the box will not update an already-running Vagrant machine.

How do I update vagrant files?

If a Vagrant environment is already running, you'll have to destroy and recreate it to acquire the new updates in the box. The update command just downloads these updates locally. So I need to run vagrant destroy and then vagrant up ? vagrant reload The equivalent of running a halt followed by an up.

Where are vagrant boxes stored?

As mentioned in the docs, boxes are stored at: Mac OS X and Linux: ~/. vagrant. d/boxes.

Can I have more than one vagrant box?

You can definitely run multiple Vagrant boxes concurrently, as long as their configuration does not clash with one another in some breaking way, e.g. mapping the same network ports on the host, or using same box names/IDs inside the same provider.


Video Answer


1 Answers

short answer is no vagrant box update only downloads and installs the new box it will NOT update any of your running Vagrant VMs.

You get the "new version box" message because check for updates on vagrant up is enabled by default. If you don't want to see it you can modify your Vagrant file by adding following line

config.vm.box_check_update = false

You have to explicitly destroy your machine and recreate it to use the updated box. Vagrant will NOT do that on its own.

like image 56
Arek Czarnogłowski Avatar answered Oct 07 '22 01:10

Arek Czarnogłowski