Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 41

Thread: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

  1. #31
    Join Date
    Nov 2006
    Beans
    75

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    I just wanted to add that I read that you shouldn't copy the vdi virtual disk file. apparently this hoses it (I assume that the problem would be in the copy file not the original). Instead, you are supposed to use the vboxmanage clone command. I am guessing that the uuid of original disk doesn't authenticate or something with the copied file.

  2. #32
    Join Date
    Nov 2006
    Beans
    75

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    Also, one another thought, is each snapshot a whole bit for bit copy of the system or is it really just a difference from a reference version?

  3. #33
    Join Date
    Feb 2008
    Beans
    12

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    Quote Originally Posted by maddentim View Post
    Also, one another thought, is each snapshot a whole bit for bit copy of the system or is it really just a difference from a reference version?
    The files themselves are really just differencing files, referencing the previous snapshot which references the one prior to that, and so on.

    But I think the point being made here is that when managing snapshots from within VBox (or VBoxManage), you should assume/pretend they are bit-for-bit copies.

    For example, if you "discard" a snapshot from somewhere in the middle of the tree/history:
    • If each snapshot were a full copy of the disk, you could safely discard it
    • ...thus when doing this inside VirtualBox (or VBoxManage) you can assume the above to be the case
    • Internally, however, the "diffs" in that snapshot are then merged into the next most recent one (so the snapshots either side of the one being discarded will appear not to have changed)
    • WARNING: this is the mindset you need to use from within VirtualBox or VBoxManage, but you cannot use this mindset if you start messing with the physical VDI files themselves. Under the surface, they are just incremental diffs, so removing a physical VDI file from the middle of the chain will render any more recent snapshots useless

  4. #34
    Join Date
    Feb 2008
    Beans
    12

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    Quote Originally Posted by UranUtan View Post
    Found this blog which explains perfectly how to manage VirtualBox snapshots and cloning a VDI which has snapshots:

    http://srackham.wordpress.com/clonin...tual-machines/
    There is an easier way, I discovered last night, which does not require you to merge/discard snapshots in order to clone the most recent (or any) snapshot/state. I've posted the answer to the above blog post, but will add it here as well:

    You do not actually need to do all the merges to clone the latest (or any) snapshot, as "VBoxManage clonehd" allows you to provide a snapshot identifier as an alternative to a VDI filename, and this merges all the changes up to the chosen snapshot into the output file.

    You need to get the snapshot id for the drive first, but this is not difficult.
    The following works from the VBox GUI, but there would also be a commandline way to do it:

    1. Select the VM, and click on "snapshots"
    2. Note the name/description of the snapshot you want to clone (if you want to clone "current state" you will need to snapshot this state first, and give it a name)
    3. Go to the "VirtualMediaManager" and expand the entire tree of the drive you want to clone
    4. Find the diff file relating to the snapshot you want to clone --> As you select each "child" or diff-file, the bottom of the window will display the full filepath/location, and also "Attached to: <VM Name> (<snapshot name>)" and it is the snapshot name that will help you find the relevant vdi file
    5. Once found, you are able to select and copy the location. It will be something like ".VirtualBox/Machines/MyVM/Snapshots/{297a42c0-236c-474b-af3c-6393b31518ef}.vdi"
    6. Paste the location into a text editor and remove everything except the ID of the diff file, eg "297a42c0-236c-474b-af3c-6393b31518ef" (note, no braces or ".vdi" - just the ID)
    7. You can then use this ID to clone the snapshot, using CLONEHD (not clonevdi), eg "VBoxManage clonehd 297a42c0-236c-474b-af3c-6393b31518ef /home/myClonedVHD.vdi"


    And that's it - no need to merge all the snapshots - clonehd will do that for you for the new vdi, but leave the original chain/tree of snapshots untouched!

    Edit: for the record, I did this on Mac OSX Snow Leopard, with Version 3.1.6 of VBox. The GUI for Ubuntu (which I also use) is pretty much the same, so the same instructions should still apply. I can't say for sure which version of VBox is the earliest one that let you use clonehd in this way, but VBox is one of those apps that's worth keeping right up to date anyway.
    Last edited by grazanaut; May 8th, 2010 at 06:29 PM.

  5. #35
    Join Date
    Nov 2006
    Beans
    75

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    Thanks, I am clear now. My main concern that prompted my question was whether using snapshots would consume my hard drive by replicating the entire virtual drive, but I see now that the .VirtualBox folder includes the snapshot diff files and they are quite reasonable in size (so far!). I think thinking these snapshots as diff files as the key to getting your head around how they work.

    I wonder how much overhead using the snapshot files creates... If you build up a bunch of snapshots, does it increase the latency of the process as the software navigates through the diff files?? Maybe it is loaded at runtime as a single thing making it negligible...

  6. #36
    Join Date
    Jun 2010
    Beans
    3

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    hi, i ahve created multiple snaphots of different systems like ubuntu server10.4, windows xp , windows 2008 on virtual box. now i want to install virtual box on another system at work and use these snapshots to make new machines for the above mentioned operating systems.
    but when i do so i get error message and the snapshot vdi is not enough i guess.
    u need anything else for it? image also ?
    any one can suggest .?

    thanks

  7. #37
    Join Date
    Nov 2006
    Beans
    75

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    I think you have to use the vdi manage clone command. Search google for a guide If you don't know how to clone. If you use just use regular file system copy command, linux or otherwise, the copy will not function. Not sure why, seems like some sort of underlying security control related to the disk's uuid.
    Quote Originally Posted by student-18 View Post
    hi, i ahve created multiple snaphots of different systems like ubuntu server10.4, windows xp , windows 2008 on virtual box. now i want to install virtual box on another system at work and use these snapshots to make new machines for the above mentioned operating systems.
    but when i do so i get error message and the snapshot vdi is not enough i guess.
    u need anything else for it? image also ?
    any one can suggest .?

    thanks

  8. #38
    Join Date
    Feb 2008
    Beans
    12

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    Quote Originally Posted by maddentim View Post
    I think you have to use the vdi manage clone command. Search google for a guide If you don't know how to clone. If you use just use regular file system copy command, linux or otherwise, the copy will not function. Not sure why, seems like some sort of underlying security control related to the disk's uuid.
    Yes, he will need to use the vboxmanage clonehd command described elsewhere in this thread. Copying the latest snapshot is only copying the "differencing disk" and not the actual disk - using clonehd on the snapshot will get the whole disk.

    Note that you will probably have issues with Windows - it will likely complain about the hardware having changed - you'll need to Google how to get around this as well.

  9. #39
    Join Date
    Jul 2006
    Beans
    90

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    Copying the .vdi doesn't work even if you're going to put it back in the same place as the original (in event of failure)?

    Also, if I delete all of the snapshots and keep only the Current State, surely then there won't be any issues with copying the .vdi, no?

  10. #40
    Join Date
    Jul 2008
    Beans
    4

    Re: HOWTO: VirtualBox Snapshots. The Ins and Outs of Snapshots.

    I was able to reattach an orphaned snapshot by going to the VM's settings, storage, deleting the drive and then readding the *snapshot* (found in .VirtualBox/Machines/<vmname>/Snapshots/

Page 4 of 5 FirstFirst ... 2345 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •