Reconstructing VM from Backup - possible?

This is for discussing general topics about how to use VirtualBox.
KFlash
Posts: 26
Joined: 10. Feb 2013, 19:11

Reconstructing VM from Backup - possible?

Post by KFlash »

Hi all,

today I run into an error message that was new to me: Some "guru meditation" window showed up, an I could not start the VM.

After some clicking around, I could read the real problem: not enough memory was available in the host system. Fine....

BUT, for some reason I selected the check box "Return to Sanpshot 1"
After I started the VM I was shocked, because it was different than what I expected. My mail program was not there and than.... dammit... Snapshot 1 was old!

But, luckily I copied the VM folder (the folder that is named like my machine, and only that folder) to a external hard drive some weeks ago.

I copied the VM folder back and tried to start, but Virtualbox tells me, it could not find a suiting disk/hard drive for it. So now I go panic.

Is it possible to reconstruct the VM?

In the copied VM folder under snapshot I found a *.vdi file. It is 9,5GB big and has a fancy name with some {}. Am I correct, that this is "Snapshot 1"?

In the folder "Harddisks" I find an other *.vdi file, named like my virtual machine but 14GB big. Looks like, this file holds a much more resent state (why else should it be so big)

Is it possible, to boot from both *.vdi files, to examine the status?
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Reconstructing VM from Backup - possible?

Post by noteirak »

Moving this to "Using Virtualbox"
KFlash wrote:I copied the VM folder back
This was a good first step. Now to make sure it all works smoothly :
1. Copy the folder itself, not the files inside
2. Overwrite the existing folder when prompted
3. Overwrite the existing files when prompted

Then try to start the VM again and see what's happening.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
KFlash
Posts: 26
Joined: 10. Feb 2013, 19:11

Re: Reconstructing VM from Backup - possible?

Post by KFlash »

I did, but it didn't work.

I copied that folder that has the name of my VM to the folder "Machines".

Do i also have to copy something into the folder "HardDisks"?
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Reconstructing VM from Backup - possible?

Post by noteirak »

I see that you are still using the old Virtualbox format for your VM. What Virtualbox version are you using now?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
KFlash
Posts: 26
Joined: 10. Feb 2013, 19:11

Re: Reconstructing VM from Backup - possible?

Post by KFlash »

It is Version 4.2.6

I made some screenshots (Its quite big. right click --> View Image) to show the current status. Hope you can help me. This VM is important to me.
Attachments
virtualBox.png
virtualBox.png (108.03 KiB) Viewed 7354 times
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Reconstructing VM from Backup - possible?

Post by noteirak »

I will let mpack or Perryg help you further - they have more experience than me with old format VMs
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Reconstructing VM from Backup - possible?

Post by Perryg »

Do you still have the VDI file?
If so create a new guest and when asked to create a new HDD or use an existing one select to use an existing one and select the original VDI file.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Reconstructing VM from Backup - possible?

Post by mpack »

That's a v3.x era VM. They are not designed for portability, especially if you use snapshots. I.e. it's quite hard to restore a snapshotted VM from a backup.

The only cure is to create a temp folder, copy in the base VDI (.VirtualBox\HardDisks\hatchery.vdi), then copy in all the snapshot VDIs from your backup. The .sav files are ignored. Use the CloneVDI tool to clone the newest snapshot VDI, do not make the mistake of cloning the base vdi. The clone will be a merge of the snapshot chain starting with the base vdi and ending with the selected snapshot. You can build a new VM around the clone. Be careful to get the VM recipe as close as possible to the old one, I would copy hdd controller type, IO APIC setting, network card MAC address, RAM size.

Note that since this is a new VM it will be in v4 format, so it should be easier to back up and restore in future, especially if you avoid snapshots. I strongly suggest that you move the clone VDI into the new VM folder so that everything will be in one folder for easier backup. Once you are happy that the VM works you can delete the old one.
KFlash
Posts: 26
Joined: 10. Feb 2013, 19:11

Re: Reconstructing VM from Backup - possible?

Post by KFlash »

The hatcherie.vdi File is still there.

Just to understand the concept of the vdi files:
Are those Snapshots diffs to the hatchery.vdi, or complete replacements?
I ask because hatchery.vdi is much bigger than those snapshot.vdi files.

Of both of the proposed solutions, Perryg's seems to be easier to try. Is there a chance to ruin the hatchery.vdi file by creating a new guest which reuses this file?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Reconstructing VM from Backup - possible?

Post by Perryg »

If you have snap shots you should use Dons approach. You can create with the VDI but all of the work in the snapshots will be lost. I never use snap shots so I Don't need that approach.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Reconstructing VM from Backup - possible?

Post by mpack »

Each snapshot vdi is like a patch script to modify the previous (next older) file in the chain. They are not stand alone, the complete chain is needed.
KFlash
Posts: 26
Joined: 10. Feb 2013, 19:11

Re: Reconstructing VM from Backup - possible?

Post by KFlash »

The thing is, the snap shot was quite old.
You say, that the base file (hachery.vdi) is even older than the snapshot?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Reconstructing VM from Backup - possible?

Post by mpack »

Yes.
KFlash
Posts: 26
Joined: 10. Feb 2013, 19:11

Re: Reconstructing VM from Backup - possible?

Post by KFlash »

I did clone the disks+Snapshot like said.

How do I create a new VM with this? Can I copy the settings so that the Parameters are identical with the one from the old VM?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Reconstructing VM from Backup - possible?

Post by mpack »

How did you clone the snapshot? If you used CloneVDI as I suggested then it comes with release notes, one section of which tells you how to create the VM. You can't directly copy the settings from another VM, but you can view the .xml file from the older VM in a text editor for reference while you create the new VM.

The main thing is to ensure, by the end, that the clone VDI is located inside the new VM folder. That will reduce the chance of future problems.
Post Reply