Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to be able to create a guest VM with VirtualBox and take two snapshots of it:

  • "Clean Config" - just the OS and minimal dependencies installed, no purposeful software stack on it yet
  • "Fully Configured" - the Clean Config + my software stack (app server, database, web server, etc.)

This way I will always be able to either wipe the VM clean and start over with a brand new VM (Clean Config) or I can wipe my software stack clean and start over with not only a Clean Config but newly-installed server software.

When I create my VM (using a SATA controller and VDI drive for simplicity) I see three files associated with it:

  • my-first-vbox-vm.vbox
  • my-first-vbox-vm.vbox-prev
  • my-first-vbox-vm.vdi

I assume the VDI file is my hard drive and actually contains all the data (OS + software stack) for the VM, and that the VBOX file is every other configuration for the VM that doesn't have to do with storage (monitor/display config, mobo, etc.). Not sure what the VBOX-PREV file is...

My question(s) have to do with actually implementing such a snapshot-backup system. I bought a 1TB external HD that I want to use for storing these snapshots. So:

  • What file(s) do I need to backup in order to have these two configs (Clean & Full)? Do I need all three or just the VDI? I guess it comes down to this: can I just save the VDI and "plug it in" to any old VBOX file (VM)? Or are all these files tied together at the hip?

Thanks in advance!

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

Some of this functionality is built in to VirtualBox, though I can't say it's robust. (In fact as I started up my VirtualBox it told me that one of my snapshot VHDs was unavailable for some reason...) The VDI is your virtual disk image, and basically is the hard drive. As snapshots are taken they are added to a snapshot folder as VHDs. This works fairly well for testing purposes, but I've had more than a few snapshots stop working for whatever reason.

It sounds like you're a lot more set up than you need to be though with a 1TB external. You should be able to boot a machine up with just the VDI, but the vbox file is small so you may as well back that up too. As long as you have the VDI though, I can't think of any reason you would not be able to start the machine back up in VirtualBox. If you start with a VHD you might even be able to boot up the machine in another VM with some tweaking.

It might be best to configure your clean setup, back up everything, then do the same for your full configuration. With a 1TB drive you definitely have the space.

share|improve this answer
    
Thanks @r.tanner.f (+1) - that's exactly what I intend to do: (1) install Ubuntu, (2) backup the "Clean Config", (3) install and configure my hardware stack, (4) backup the "Full Config". Thanks again! –  pnongrata Aug 14 '12 at 14:39
add comment

My only concern is that the virtual disk images' UUID will give you grief by trying to run two snapshots of the virtual machine. It is possible to overcome this by editing the VirtualBox.xml file but that is far too much work to have to do for what your looking to achieve here.

My suggestion is to take a Full Clone of the current state of your virtual machine and configure the second virtual machine to use a different MAC address so that you don't have any headaches on the local LAN.

I actually just wrote a blog on this topic; if you would like to see how to go about performing this then check it out at:

http://ed.tella.info/blog/how-to-clone-a-vm-in-virtualbox

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.