the xml file of the virtual machine is destroyed

Discussions related to using VirtualBox on Linux hosts.
Post Reply
*ellen*
Posts: 3
Joined: 23. May 2009, 23:03
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: Ubuntu

the xml file of the virtual machine is destroyed

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

Re: the xml file of the virtual machine is destroyed

Post 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.
*ellen*
Posts: 3
Joined: 23. May 2009, 23:03
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: Ubuntu

Re: the xml file of the virtual machine is destroyed

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

Re: the xml file of the virtual machine is destroyed

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: the xml file of the virtual machine is destroyed

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: the xml file of the virtual machine is destroyed

Post 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?
*ellen*
Posts: 3
Joined: 23. May 2009, 23:03
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: Ubuntu

Re: the xml file of the virtual machine is destroyed

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: the xml file of the virtual machine is destroyed

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply