Exporting a box with snapshots

748 views
Skip to first unread message

nick....@onyxpoint.com

unread,
Mar 16, 2016, 11:40:21 AM3/16/16
to Vagrant
Hey guys,

I was wondering if its possible to export a vagrant box containing snapshots that I took using `vagrant snapshot`?

I have tried just packaging a box with several snapshots and they are all discarded upon packaging.

Thanks,
Nick

Alvaro Miranda Aguilera

unread,
Mar 16, 2016, 6:23:12 PM3/16/16
to vagra...@googlegroups.com
Hello,

What command did you use?

I run a test, and I can see the snaps are still there.

I did export using pure Virtualbox, and then using Vagrant:




mini:~ kikitux$ vagrant package --base ub --output ub.box

==> ub: Exporting VM...

==> ub: Compressing package to: /Users/kikitux/ub.box


mini:~ kikitux$ ls -al ub.box Documents/ub.ova 

-rw-------  1 kikitux  staff    81K 17 Mar 11:18 Documents/ub.ova

-rw-r--r--  1 kikitux  staff   3.7K 17 Mar 11:20 ub.box

mini:~ kikitux$ 


mini:~ kikitux$ mkdir t

mini:~ kikitux$ cd t

mini:t kikitux$ tar zxvf ../ub.box 

x ./box-disk1.vmdk

x ./box.ovf

x ./Vagrantfile

mini:t kikitux$ ls -al

total 176

drwxr-xr-x   5 kikitux  staff   170B 17 Mar 11:22 ./

drwxr-xr-x+ 71 kikitux  staff   2.4K 17 Mar 11:22 ../

-rw-r--r--   1 kikitux  staff   505B 17 Mar 11:20 Vagrantfile

-rw-------   1 kikitux  staff    67K 17 Mar 11:20 box-disk1.vmdk

-rw-------   1 kikitux  staff    12K 17 Mar 11:20 box.ovf

mini:t kikitux$ 


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/69ba19fd-50ce-4385-b015-8b8fcf198fd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nick Miller

unread,
Mar 17, 2016, 9:47:15 AM3/17/16
to vagra...@googlegroups.com
Using the following workflow, I was not able to export a box with snapshots.

$ vagrant up # box I want to save
$ vagrant snapshot save one
$ vagrant ssh # made some changes
$ vagrant snapshot save two
$ vagrant package --base 'vm name' --output snapshottest.box
# moved the box to a new directory
$ vagrant init snapshottest.box
$ vagrant up
$ vagrant snapshot list
==> default: No snapshots have been taken yet!
    default: You can take a snapshot using `vagrant snapshot save`. Note that
    default: not all providers support this yet. Once a snapshot is taken, you
    default: can list them using this command, and use commands such as
    default: `vagrant snapshot restore` to go back to a certain snapshot.

I would like to continue to use vagrant up because I'd still like other features of vagrant, like shared folders.

You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/vtjE93bz1hI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezUsheTccS_H0ZOJmjuGi3Lq9GfOOQFyOecyLSEboZr2A%40mail.gmail.com.

Alvaro Miranda Aguilera

unread,
Mar 18, 2016, 4:25:35 PM3/18/16
to vagra...@googlegroups.com
Hello,

It seems the box was exported, and you were able to import it.

So, the expectation here is that the snapshots are going to be included in the exported box?

Vagrant uses standard features from Virtualbox, if they only export by default a copy of the running machine, then I am not sure how Vagrant can help.

Can you please explain a bit more?

Thanks
Alvaro.


Nick Miller

unread,
Mar 24, 2016, 11:10:31 AM3/24/16
to vagra...@googlegroups.com
Nope, I expected to be able to export VMs including snapshots. You are correct that you are not able to do that because it isn't a feature VirtualBox supports. Thanks for you help anyway!

Reply all
Reply to author
Forward
0 new messages