Page 1 of 1

Open existing VM without previous VirtualBox.xml

Posted: 3. Dec 2009, 16:39
by vedyakoff
Hi everyone.

I've got a big trouble.
My last VirtBox is 3.1.0 version. I have 2 VMs with lots of snapshots.

Today i experienced some troubles in the end i reinstalled my VirtualBox. And the worstest thing is i occasionally deleted the old VirtualBox.xml.
So after new installation I have a new VirtualBox.xml without any mentioning of my previous VMs. But they are still on hard disk.

I didn't find a way to import an existing VM though I created a new one and attached vdi disk from one of my VMs. But the guest system now has the same state as it used to be write before the first snapshot... :(

So i have a question - is there any way to get my snapshots or last state from my previous VMs.

I already tried to add information about existing VMs to VirtualBox.xml. But the app said it couldn't find the snaps guids in the VirtualBox.xml...

Any help!!!!!!

Re: Open existing VM without previous VirtualBox.xml

Posted: 3. Dec 2009, 17:06
by vedyakoff
the command VBoxManage registervm didn;t help me:

VirtualBox Command Line Management Interface Version 3.1.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Runtime error: -102 (File not found.).
/home/vbox/vbox-3.1.0/src/VBox/Main/MachineImpl.cpp[5817] (nsresult Machine::loadSettings(bool))
Details: code NS_ERROR_FAILURE (0x80004005), component VirtualBox, interface IVirtualBox, callee nsISupports
Context: "OpenMachine(Bstr(a->argv[0]), machine.asOutParam())" at line 92 of file VBoxManageMisc.cpp

Re: Open existing VM without previous VirtualBox.xml

Posted: 3. Dec 2009, 17:58
by mpack
vedyakoff wrote:And the worstest thing is i occasionally deleted the old VirtualBox.xml.
Before you go any further I suggest you back up your current .VirtualBox folder (or at least back up .VirtualBox\Machines), to insulate yourself against any further disasters you cause in your attempts to recover from the last one.

Is VirtualBox.xml the only thing you deleted? Or did you delete your entire .VirtualBox folder? The first might be recoverable - with difficulty. The second is not recoverable without backups. A possible solution would involve creating a new VM with an organisation similar to the old VM, then manually edit the VirtualBox.xml file to make the new VM reference your old files instead of the new ones.

Re: Open existing VM without previous VirtualBox.xml

Posted: 3. Dec 2009, 18:02
by Perryg
Did you happen to look in the trash to see if the file was recoverable?
Sometimes they are.

Re: Open existing VM without previous VirtualBox.xml

Posted: 3. Dec 2009, 21:54
by vedyakoff
mpack wrote: Is VirtualBox.xml the only thing you deleted? Or did you delete your entire .VirtualBox folder? The first might be recoverable - with difficulty. The second is not recoverable without backups. A possible solution would involve creating a new VM with an organisation similar to the old VM, then manually edit the VirtualBox.xml file to make the new VM reference your old files instead of the new ones.
I delete the only VirualBox.xml. It happened case my VirtualBox didn't start with some errors where mentioned my previous VirualBox.xml and all attempts to fix it using reinstall wheren't succesfull. I used to work with vmware workstation, so i though there is nothing critical if i just delete that xml file. It was really stupid idea :D

I'm still have the entire of .VirtualBox folder, with the two main folder HardDisks and Machines. I added the line describing my previous VM into the new VirtualBox.xml with the right GUID(got it from VM.xml). But when i started the app, it said my VM isn't acceccible becase there is a link to dvd iso image (showed me GUID of that image) wich couldn't be found under the repositary section in the VirtualBox.xml. I made a backup copy of my VM.xml and deleted any lines with that link in the VM.xml (no link - no trouble), restarted the Box and was shocked that there are no any lines with the links to my snapshots in the VirtualBox.xml but they are in the VM.xml.

So as i understood the VirtualBox.xml it's a central information file where mentioned all my Vms, all vdi used, all snapshots and dvd iso images.
Actually it's good to me to get back one of my VMs with linear chain of snapshots.

And of course i checked the Trash folder. The problem is my host is Debian and i used rm command to delete my sweety VirtualBox.xml.

Re: Open existing VM without previous VirtualBox.xml

Posted: 4. Dec 2009, 00:56
by MarkCranness
I repeat what mpack said: BACKUP the files you have. By attaching the base VDI file to a new machine you may have lost the ability to recover the old 'Current State' of the virtual disk.
If you try, or we suggest, experiments to try and recover your VDI, those experiments may damage what you have, so BACKUP!

When you booted one of your VMs, how up-to-date was the data on the disk?
The way snapshots work is that if you take a snapshot the base image file is frozen, and all changes made after the snapshot are stored elsewhere. If you are happy with the hard disk being in the state it was in when you took the first snapshot, then OK, but otherwise we can try and recover the old 'Current State' of the virtual disks.

Please 'Upload attachment' the xml files for your old VMs and we might be able to help recover the old 'Current State'.