Page 1 of 1

the xml file of the virtual machine is destroyed

Posted: 23. May 2009, 23:08
by *ellen*
Hi,

I am using VirtualBox with Ubuntu 8.04 and recently, I have installed a WindowsXP virtual machine with VirtualBox. Unfortunately, the disk was full and the $HOME/.VirtualBox/Machines/WindowsXP.xml file has not been saved completely. The end of the file is missing. I cannot run this virtual machine anymore. Is there any way to recover that WindowsXP.xml file and reuse my virtual machine again?

Thanks a lot,
Ellen

Re: the xml file of the virtual machine is destroyed

Posted: 23. May 2009, 23:21
by Perryg
If the original VDI file is still intact you can re-create the container in VBox. All you need to do is create a new VM and tell it to use your original VDI instead of a new one. You may need to mess around with the settings a bit if you don't remember what they were, but default settings usually are what most people use anyway. You also will need to delete the original XP vm from the gui. DO NOT delete it from anywhere else.

Re: the xml file of the virtual machine is destroyed

Posted: 23. May 2009, 23:44
by *ellen*
It works. Thanks a million! :)

My virtual machine is installed on an external usb disk because I don't have much space in my home folder. I just deleted the other WindowsXP virtual machine from the gui. But in my home folder there is still a snapshot with 4.4GB. I think that this snapshot has just been loaded when I created a new VM. Can I somehow tell VirtualBox to store the snapshots onto the external usb disk like the .vdi file? I am afraid I will loose this VM again because everything is stored in my home folder.

Re: the xml file of the virtual machine is destroyed

Posted: 23. May 2009, 23:58
by Perryg
Unfortunately the previous snapshot is a lost cause. I know of no way to associate it to the new VM. But hey you were able to get the machine going again. Pat yourself on the back and move ahead. You may want to hang on to the old snapshot for a while just in case someone has figured out how to tie them back in.

Re: the xml file of the virtual machine is destroyed

Posted: 24. May 2009, 00:29
by Sasquatch
Removing the VM itself wasn't a good idea. If you were missing a part in the XML file, you could have repaired that by taking the end of a correct file and put that in the broken one. Same thing goes for the snapshot restoration. If you still have the old xml file, you can put the snapshot part in the new one, and hope for the best that it's picked up properly.

Re: the xml file of the virtual machine is destroyed

Posted: 24. May 2009, 00:49
by Perryg
Sasquatch wrote:Removing the VM itself wasn't a good idea. If you were missing a part in the XML file, you could have repaired that by taking the end of a correct file and put that in the broken one. Same thing goes for the snapshot restoration. If you still have the old xml file, you can put the snapshot part in the new one, and hope for the best that it's picked up properly.
OK so enlighten me. She said that end of her old machine.xml file was missing. How would she be able to recover that? Assuming as I did that she only had the one VM how was she to copy part of a another file?

Re: the xml file of the virtual machine is destroyed

Posted: 24. May 2009, 08:53
by *ellen*
Yes, I have just one Virtual Machine (with Windows XP on an Ubuntu host) and the .xml file was and still is cropped. Severly cropped. There was a lot missing.

It's not a problem that I cannot access the snapshot for now, I can reinstall my Virtual Machine now. But as mentioned: my .vdi file is on a large external USB disk because the hard disk of my laptop is too small and I don't have enough space. My .vdi file is just 2 GB big. And the snapshop which is stored locally 4,4 GB. Very strange, isn't it? :? Can I delete the whole $HOME/.VirtualBox folder and its subfolders now (because it is stored on my small hard disk and I need the space) and tell VirtualBox somehow that this folder should be stored on my external USB disk, too? The .xml file is still cropped. So, creating the new VM yesterday evening didn't change anything in the $HOME/.VirtualBox folder.

Re: the xml file of the virtual machine is destroyed

Posted: 24. May 2009, 13:16
by Sasquatch
The reason your snapshot is saved in your home folder is because the default VB settings put it there. If you start with a new clean VM, then indeed, remove the entire ~/.VirtualBox folder so you will have a clean slate to begin with. Now before creating new VMs or whatever, open the preferences and change the default location for both the machines and hard drives. You need to change both, as snapshots are saved in the machine folder, not the hard drive folder.
Perryg wrote:OK so enlighten me. She said that end of her old machine.xml file was missing. How would she be able to recover that? Assuming as I did that she only had the one VM how was she to copy part of a another file?
By creating a new VM, a new, correct XML file will be created. You can then copy the missing part from the new one to the old one, fixing the file itself. This will make sure that the snapshot will still be accessible.
Doing it the other way around would also be possible, copy the snapshot part in the new, working xml file, but it's possible the snapshot is linked to a Virtual Machine's UUID.