VBox Recovery from cloned snapshots

This is for discussing general topics about how to use VirtualBox.
Post Reply
jlamelas
Posts: 4
Joined: 10. Jul 2021, 08:59

VBox Recovery from cloned snapshots

Post by jlamelas »

Hi everyone,

how can i rebuild a virtualbox machine with original vdi and cloned machine snapshots.

i only have the original machine and by mistake deleted cloned machine, but i have snapshots from cloned machine

thank you for your help
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VBox Recovery from cloned snapshots

Post by mpack »

If you already have a clone VM then you had better just use that, because that's the best you can do.

1. You cannot easily use the snapshots from your clone in a different VM.

2. If you could, you'd have a copy of your clone, not the original VM.

Snapshots are later states of the VM, they are not backups. If you want to be able to restore a VM after a disaster, then make backups.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VBox Recovery from cloned snapshots

Post by scottgus1 »

If I gather the problem correctly, you had an original VM and a cloned VM with some snapshots. Then you 'deleted the cloned VM' but you still have the clone's snapshot disk files.

If 'delete the cloned VM' means you only removed it from Virtualbox but you still have the cloned VM's folder with all the files in it, including the cloned VM's .vbox file, then you should be able to re-register the cloned VM using the main Virtualbox window's Machine menu Add command.

If 'delete the cloned VM' means you deleted the cloned VM's base disk, which was an exact copy of the original VM's base disk, then a bit of Frankensteining might get you something.

Please explain exactly what you have done and what files you still possess.
jlamelas
Posts: 4
Joined: 10. Jul 2021, 08:59

Re: VBox Recovery from cloned snapshots

Post by jlamelas »

thanks for your reply,

i have cloned a VM Machine to another hard drive, then i deleted the original disk of 250Gb but after 2 months i realized that the drive i deleted was the important one, never happned to me, its firts time in 30 years.

now what i have in virtual box?

basically i have a :
1 - Cloned VM with a snapshots 100Gb (2020) and no VM HD
2 - Original VM (2014) with complete VM HD(120Gb) and folder, working fine

ther is anyway to merge Original HD with Cloned VM ?

Thanks
jlamelas
Posts: 4
Joined: 10. Jul 2021, 08:59

Re: VBox Recovery from cloned snapshots

Post by jlamelas »

I also have a 2014 .vbox file and this file in jpeg attached
Attachments
Capturar.JPG
Capturar.JPG (36.09 KiB) Viewed 3746 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VBox Recovery from cloned snapshots

Post by scottgus1 »

OK, thanks for the info. If your usage of these VMs followed this procession:
  1. You had an original VM.
  2. You made a full clone of the original VM.
  3. You have never run the original VM since making the full clone.
  4. You immediately made a snapshot in the cloned VM before running it the first time after making the clone.
Then the base disk of the original VM and the clone are identical, and with editing of UUIDs, a copy of the original's base disk could be substituted into the clone's disk chain.

If your usage of these VMs followed this procession:
  1. You had an original VM.
  2. You made a linked clone of the original VM.
Then the original disk was never edited, since linked cloning makes a permanent snapshot in both the original and linked VMs, and with editing of UUIDs, a copy of the original's base disk could be substituted into the clone's disk chain.

If on the other hand you did any of these:
  • ran the original after making the full clone
  • ran the full clone without making any snapshots
then the original's base disk is not an exact copy of the clone's base disk. Substitution will probably not work.

FWIW the difference in size between the original disk and the clone disk shows the prospect to not be good.

Can you please describe whether any of these scenarios fits your usage of these VMs?
jlamelas
Posts: 4
Joined: 10. Jul 2021, 08:59

Re: VBox Recovery from cloned snapshots

Post by jlamelas »

thanks for your reply

after the full clone i never run the original VM and didnt made a shot after run clone for first time, but i have snapshots of clone machine too
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VBox Recovery from cloned snapshots

Post by scottgus1 »

jlamelas wrote:after the full clone
A full clone is completely independent of the original and allows for the clone's base disk to change.
jlamelas wrote:didnt made a shot after run clone for first time
If I read this correctly, you ran the clone before making a snapshot for the first time. This would mean the clone's base disk has changed and was no longer an identical copy of the original base disk.

Because of how snapshot disks work, being a list of changed sectors, the snapshots no longer exactly match the original base disk. Therefore, any attempt to connect the original base disk to the clone snapshot chain may on a very slim chance work, might on a good chance have corrupted data, and on a reasonable chance not work at all. The disk size differences do not hold out much hope.

That said, if you want to try, you'd need to make a copy of the original base disk, set the copy's UUID(*) to be the parent UUID of the first disk in the snapshot, then use Mpack's CloneVDI to clone the snapshot chain. Then make a new VM with the existing clone's hardware settings and use the CloneVDI single output disk as the new VM's disk.
* there is a command to set a disk file's UUID, but I don't remember what it is. It's in the manual; if I run across it I'll post it. Finding the first snapshot disk's parent UUID can be done with the command:
vboxmanage showmediuminfo "drive:\path\to\firstsnapshotdisk.ext"

This can all be a moot point if you happen to have backups of your host PC that might have the cloned VM's base disk in them.
Post Reply