Open existing VM without previous VirtualBox.xml

This is for discussing general topics about how to use VirtualBox.
Post Reply
vedyakoff
Posts: 4
Joined: 3. Dec 2009, 16:26
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Win Servers and Win7

Open existing VM without previous VirtualBox.xml

Post 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!!!!!!
vedyakoff
Posts: 4
Joined: 3. Dec 2009, 16:26
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Win Servers and Win7

Re: Open existing VM without previous VirtualBox.xml

Post 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
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: Open existing VM without previous VirtualBox.xml

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Open existing VM without previous VirtualBox.xml

Post by Perryg »

Did you happen to look in the trash to see if the file was recoverable?
Sometimes they are.
vedyakoff
Posts: 4
Joined: 3. Dec 2009, 16:26
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Win Servers and Win7

Re: Open existing VM without previous VirtualBox.xml

Post 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.
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: Open existing VM without previous VirtualBox.xml

Post 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'.
Post Reply