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?
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.
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.
Command: vagrant box prune This command removes old versions of installed boxes. If the box is currently in use vagrant will ask for confirmation.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With