how to clone just the initial vdi file and delete snapshots correctly

Discussions related to using VirtualBox on Windows hosts.
Post Reply
science2002
Posts: 38
Joined: 4. Jan 2021, 01:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Win10, WinXP, Android

how to clone just the initial vdi file and delete snapshots correctly

Post by science2002 »

I am still with VB 6.1 on Win10 64bit. I have learned here (and thanks for that) well before experiencing their growing size that snapshots are deprecable. Far better to create - correct me if I am wrong - a new machine if one needs to make further tests even using the same type of guest OS.

If I may, I have two questions related to that:
  • 1. I tried to create a new machine (call it B) and attach to it by simply copying and pasting in the new location the "initial" .vdi file of my main machine (call it A). But it did not work (same ID number, etc., against which VB rebelled). I know about cloning, but Machine A has several snapshots that I do not want on Machine B. What is the best way to "clone" just the "initial" .vdi file (without its snapshots) in a new Machine B?
  • 2. Now comes the problem of Machine A: removing snapshots without deleting the contents. Let's say that the structure of the snapshots is like this:
    snapshot_1 (I can see: file A)
    --snapshot_1.1 (I can see: file A & B)
    ----snapshot_1.1.1 (in bold, I can see: file A & B & C)
    ------current state (in bold, I can see: file A & B & C & D)
    ----snapshot 1.1.2 (I can see: file A & B & C & E)
    a) Is it correct that if I delete snapshot_1 and snapshot_1.1, I will not lose any files that I can see in the two remaining snapshots and in the current state?
    b) Is there a better way to eliminate as many snapshots as possible, but keeping all my files?
    c) Is it possible - with the above structure - to remove all snapshots without losing any files: in that case how?
Many thanks for any help.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: how to clone just the initial vdi file and delete snapshots correctly

Post by fth0 »

Ad 1. First make the initial snapshot the current state, then clone the current state.

Ad 2. It's not clear to me what you mean with "keeping all my files". Imagine snapshots as captures of the disk state at certain points in time. You can return to any point in time where you still have a snapshot for.

Everything written to the virtual disk (and not deleted afterwards) until the first snapshot is in file A. Everything written to the virtual disk (and not deleted afterwards) between the first and second snapshot is in file B. If you delete the first snapshot using the VirtualBox Manager, files A and B get merged into a new file that contains everything written to the virtual disk (and not deleted afterwards) until the second snapshot.
Post Reply