VirtualBox and Comodo Time Machine

Discussion in 'sandboxing & virtualization' started by tobacco, Apr 27, 2010.

Thread Status:
Not open for further replies.
  1. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    Which came first - the chicken or the egg o_O

    Ok - i'm testing out some apps in a CTM snapshot (not baseline) in snapshot #6 (not first install) of a vista32 VirtualBox virtual machine - Whewwwww ;)

    Two questions - Firstly, CTM takes over the boot area so if i restore to a previous snapshot in virtualbox, will it remove CTM entirely including the boot area??

    Secondly - anyone know of plans for virtualbox to include moving back and forth between snapshots (currently just back) like you can with CTM??

    Amazing what we can do with computers nowadays :D
     
  2. ratwing

    ratwing Guest

    It is certainly amazing what CTM can do a computer's MBR.

    But I would like to know about VirtualBox moving back and forth between snapshots.

    rat
     
  3. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    If the previous snapshot was from before CTM was installed in the VM, then going back to that snapshot shouldn't have any traces of CTM.

    Are you using VirtualBox 3.1 or later? You can already do this in 3.1 or later. If you want to go back to 'now', then make a snapshot before restoring a previous snapshot, and restore to this snapshot when you want to go 'forward'.
     
  4. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    Understand your first answer and thank you :) As to Virtualbox, i didn't know that. Right now, i'm in "snapshot 6". So what your saying is i could right now, restore "back" to "snapshot 2" and 20 minutes later restore "forward" to "snapshot 5"? And then restore forward again to "snapshot 6"? Correct??
     
  5. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    You're welcome :).

    I'm relatively new to VirtualBox myself, but I am pretty sure you can, provided you're using v3.1 or later. Http://www.virtualbox.org/manual/ch05.html#diffimages may (or may not) be of interest to you.
     
    Last edited: Apr 28, 2010
  6. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    Still trying to make sense of that o_O lol!

    Anyways, the last time i restored "back" from say "snapshot 5" to "snapshot 4", snapshot 5 was gone and there was no way to restore to "snapshot 5 "again. It was deleted. Am using 3.1.6.
     
  7. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    I just tried going back to a previous snapshot (snapshot 1) and booted the VM. It worked properly; the changes that I had made from snapshot 1 to snapshot 2 were not present. Then I restored to snapshot 2 and booted the VM. The changes I had made from snapshot 1 to 2 were there. So everything worked correctly for me, using v3.1.6. Are you sure you didn't accidently delete the snapshot instead of restoring it?
     
  8. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    Yes, that is possible. I will try it again then. Thank You.
     
  9. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    You are Correct :thumb:

    Finally took some time to investigate this further and am happy to report you were right :)

    However, the way deletion of snapshots are handled by Virtualbox (changes are merged between the about to be deleted snapshot and the previous snapshot) caused me the loss of all my snapshots :thumbd:

    Had CTM installed in my 2 most up to date snapshots and when deleting the current snapshot, merging into previous snapshot and booting into it, windows became corrupted and wouldn't load. Each time i deleted the hosed snapshot, it was merged with the previous one with the exact same results :(

    I had to start all over again. Want to mention that CTM was very stable for me and performed very well so i don't know who to blame this fiasco on!

    Why in the world Virtualbox doesn't give the option to just delete the snapshot without merging is beyond me!
     
  10. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    I wonder if it has anything to do with the fact that CTM uses sectors that the file system believes are not allocated to any file. When/if I try CTM within VirtualBox, I'll report the results here.
     
  11. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    Oh, i agree that CTM had something to do with what happened. But my point is "WHY" is virtualbox so limited in the way it handles it's deletion of snapshots - "no option to delete the snapshot without merging"?
     
  12. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    I was confused by this also when I started using VirtualBox, but there is a good reason for this behavior. Part of the reason for my confusion was that sometimes I had neglected to actually restore to the desired snapshot (doh!), so I made some incorrect conclusions about the snapshot functionality; make sure that the snapshot doesn't differ from the current state if you're unsure - the GUI indicates this. Another reason is that the GUI messages when deleting a snapshot IMHO are somewhat misleading.

    Let's go through an example to illustrate what's actually happening. You create snapshot 1. When this happens, VirtualBox creates a new differencing file 1 that contains changed hard disk contents since you created snapshot 1. You make some changes to the virtual machine, which are recorded in differencing file 1. You then create snapshot 2, which results in differencing file 2 being created by VirtualBox. You make some changes to the virtual machine. These changes are recorded in differencing file 2. You then create snapshot 3, which results in the creation of differencing file 3. You then delete snapshot 2. Think about what needs to be done now if you want to restore to snapshot 3 sometime in the future. VirtualBox still needs to know all the changes that happened between the creation of snapshot 1 and snapshot 3. One way to do this would be to keep differencing file 1 and differencing file 2. Another way is to merge the contents of differencing file 1 and differencing file 2 and then delete one of these two differencing files; this is what VirtualBox actually does. So from the end user's perspective, you can still restore to snapshot 1 or snapshot 3, and these snapshots work as expected. Technically, when you deleted snapshot 2, there was a merging of two differencing files; differencing file 1 now contains all the changes made between the creation of snapshot 1 and snapshot 3, while differencing file 3 contains all changes made since the creation of snapshot 3.

    In a nutshell then, from an end user's perspective, everything works as expected when deleting snapshots (CTM issues aside), but VirtualBox sometimes merges files, which can take some time, which I believe is the reason for the (IMHO poorly worded) message VirtualBox issues when deleting a snapshot.
     
  13. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    Could you help me understand how to handle a situation like that again then?

    Let's say i have snapshots #1, #2, #3 and #4. I'm currently in snapshot #4 and realize a major problem that has affected not only this snapshot but also snapshot #3. And the only option left is to delete snapshot #3 and #4. How do i do this without affecting snapshots #1 and #2 who don't have this problem at the moment?
     
  14. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    Delete snapshot 3 and snapshot 4. Restore to snapshot 2 (don't forget this step) - snapshot 2 should still work as expected and be unaffected by what you did afterwards :).
     
    Last edited: May 7, 2010
  15. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    I neglected to mention the fastest way.

    In general:
    1. Restore the newest snapshot that you want to keep.
    2. Delete unwanted snapshots from newest in branch to oldest.

    Doing so results in 0 merges, because VirtualBox needs to only delete differencing files :).

    In your case you would do this:
    1. Restore to snapshot 2.
    2. Delete snapshot 4.
    3. Delete snapshot 3.
     
  16. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    Oh i see where i made the mistake. Alrighty then, i'll remember that next time ;)

    Thank You :thumb:
     
  17. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    You're welcome :).

    Where did you make the mistake, if I may ask?
     
  18. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    I was in snapshot #4/ powered down that snapshot and in the virtalbox snapshots window, deleted snapshot #4 which kept merging and taking be back to the previous snapshot. As you said, before deleting, i should of restored to snapshot #2 first. I didn't. I kept deleting the snapshot i was in o_O lol!
     
  19. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    That actually should have worked also, I believe, unless you didn't restore to snapshot #2 when you were done deleting unwanted snapshots.
     
  20. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    Snapshot #3 and #4 contained CTM. #1 & #2 didn't. I wanted to get rid of the changes made in 4 so while in 4, i deleted which merged into 3 and in the left panel, showed 3 as being the now current snapshot. And when i fired it up, windows wouldn't load. So i repeated the same process, sitting in 3 and deleted which took me back to #2 (i deleted not restored - it automatically merged and took me to the previous snapshot after deleting). So CTM ended up being merged into #2 which of course was still hosed and the process repeated itself into #1 when deleting #2 o_O

    So i should of restored first in #1 or #2 and then deleted #4 and #3.
     
  21. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    If you can reproduce this, then you may want to let the VirtualBox crew know. It could be a VirtualBox bug.

    Maybe I'll try CTM in VirtualBox today....
     
  22. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    My thought though is that you didn't restore to the desired snapshot ;).

    Pop quiz:

    Snapshot 1
    --Current State

    isn't the same as

    Snapshot 1
    --Current State (changed)

    Know why?
     
  23. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    lol!

    I have no clue :blink:
     
  24. MrBrian

    MrBrian Registered Member

    Joined:
    Feb 24, 2008
    Posts:
    6,032
    Location:
    USA
    Answer:

    Snapshot 1
    --Current State

    means that the current state of your virtual machine is the same as snapshot 1.

    Snapshot 1
    --Current State (changed)

    means that the current state of your virtual machine is not the same as snapshot 1.

    I think what happened in your case is that the current state of your virtual machine was a non-booting Windows. If you had looked in the GUI you would have seen this before you deleted any snapshots

    Snapshot 1
    ---Snapshot 2
    ------Snapshot 3
    ---------Snapshot 4
    ------------Current State (changed)

    Assuming the virtual machine is off, this means the current state of the virtual machine isn't the same as snapshot 4. You have to restore to snapshot 4 in order to make the current state of the virtual machine the same as snapshot 4, as follows

    Snapshot 1
    ---Snapshot 2
    ------Snapshot 3
    ---------Snapshot 4
    ------------Current State

    When you noticed trouble, first you should have tried to restore to the latest snapshot, which is snapshot 4. But I think you didn't. Instead, you deleted snapshot 4, which led to this

    Snapshot 1
    ---Snapshot 2
    ------Snapshot 3
    ---------Current State (changed)

    At this point you tried to power up the virtual machine, and still got a non-functioning Windows, because you didn't change the current state at all. Then you deleted snapshot 3 and got this

    Snapshot 1
    ---Snapshot 2
    ------Current State (changed)

    Your current virtual machine state as this point is unchanged, because you never restored to a snapshot. Then you repeated the process, and so forth.
     
  25. tobacco

    tobacco Frequent Poster

    Joined:
    Nov 7, 2005
    Posts:
    1,531
    Location:
    British Columbia
    Wow - what an explanation :thumb:

    Who'd of thought snapshots were so involved!. Thanks again for your help :)
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.