Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly does Vagrant snapshot save?

I use Vagrant on VirtualBox. Yesterday, I saved a snapshot of my project by running:

$ vagrant snapshot save 'my-project-date-time'

Today, I've made some changes to files and folders in my project that I want to revert. When I run:

$ vagrant snapshot restore 'my-project-date-time'

... the restoring process is completed successfully, yet the changed files and folders in my project remain the same and do not revert to the sate they were when the snapshot was taken yesterday.

So what exactly does the Vagrant snapshot save?

like image 464
qwaz Avatar asked Mar 27 '17 12:03

qwaz


People also ask

How do I restore a vagrant snapshot?

You can restore the snapshot at any time by ==> default: using `vagrant snapshot restore`. You can delete it using ==> default: `vagrant snapshot delete`. To see all the snapshots we've created we can run the vagrant snapshot list command.

How do I clear vagrant cache?

AFAIK, vagrant box remove just remove the boxes you downloaded or created using package command, to delete the VM, you should use `vagrant destroy` at the folder where Vagrantfile is. vagrant destroy will only delete the VM, so you still need to manually delete Vagrantfile and any other files in that folder.

What does vagrant box prune do?

Command: vagrant box prune This command removes old versions of installed boxes. If the box is currently in use vagrant will ask for confirmation.


1 Answers

Vagrant snapshots just call the provider "snapshots" method. So Vagrant snapshot on virtualbox just calls virtualbox snapshot.

So what exactly does the Vagrant snapshot save?

More info on virtualbox snapshots can be found here: https://www.virtualbox.org/manual/ch01.html#snapshots

like image 173
Marc Young Avatar answered Sep 29 '22 11:09

Marc Young