English 中文(简体)
VirtualBox snapshots
原标题:

Heres what happened.

I had a snapshot on which I was working from within a linux VM. A friend requested a clean VM as a clone of mine. So I closed / shutdown my running VM, made a copy of the Disk1.vdi along with the snapshots ({uuid}.vdi). Then I restarted the VM and did merged snapshots, deleted my home directory and made a tar+bz2 for my friend.

Then after I restored my backups, I am not able to mount my snapshot. The VM seems to boot from my version before snapshot. I cant seem to find a way to mount back my snapshot.

Any idea how to make VirtualBox see the snapshot and mount it?

最佳回答

I am not an expert but have coincidentally done some investigation into just this topic. You indicated that you backed up your disks (VDI and snapshots) before making changes but you did not back up the VM itself (the XML file). So you have created an incompatibility by restoring VDI and snapshots to the changed VM (that still thinks there is only a merged disk with no snapshots). Without a backup of the original VM file itself you may be out of luck. (Please see Cloning a VM With Multiple Snapshots for supporting evidence.)

问题回答

You can get back to work the snapshot, tricky but may try this (with no Virtual Machine running):

  • Open VirtualBOX GUI
  • Go to manage disks
  • Detach your main VDI from your Virtual machine.
  • Set it as INMUTABLE.
  • Reattach the main VDI from your Virtual machine
  • Exit from ALL virtualbox processes
  • Get the uuid of your snapshot VDI with VBoxManage showhdinfo, the one you want to use not the one created when making immutable the main VDI
  • Now edit the VBOX file with text editor and look for the path of the snapshot that was created so you know where to go to delete that small file, do not close the text editor
  • Delete that small snapshot vdi file
  • Now, on the text editor, replace the uuid of the snapshot and the path to the snapshot vdi to point to your snapshot vdi file
  • Save the VBOX file and close the text editor.

For future times: Remember to also backup the VBOX files too.

The trick is based on making VirtualBox create a fake snapshot file (a file that you will manually delete) and replace the references added to the vbox file with your snapshot, but take take to also replace the uuid of the snapshot file with the correct one, for that you can get it with showhdinfo.

Be warned, the snapshot uuid on the VBOX file appears on to sections, the register (near the beginning) and the attached section (near the end), you must replace both, you can use search & replace the newly uuid with yours.

Hope it will work for you; i never do snapshots of a virtualbox, I prefer the immutable way (but that is only for just one level).





相关问题
SQL Server communication between VirtualBox images

I have a WinXP host with VirtualBox 3.1.2 installed. I have a VirtualBox image called "hydrogen" on which I installed WinXP and MS SQL Server 2005 Express. I have another VirtualBox image called "...

Tool to Debug Guest OS in Virtual Box

I m just cross posting the same question I did on virtualbox.org. http://forums.virtualbox.org/viewtopic.php?f=9&t=26702&p=119139#p119139 If not breaking any rule, I d appreciate to kwon more ...

View a vmdk file from Python?

Is there any way to view the contents of a vmdk file from Python, and to be able to read files from it? (I have no need to write to it). If not, is there any way to mount a vmdk file on a host machine,...

VirtualBox snapshots

Heres what happened. I had a snapshot on which I was working from within a linux VM. A friend requested a clean VM as a clone of mine. So I closed / shutdown my running VM, made a copy of the Disk1....

Cleaning a Production Database for use in Testing

I m building a local vm for doing web dev rather than using our on site development. I need a database locally, but I don t want to just pull down a production db and use that as it has information ...

Linux Development C/C++/bash/python on windows-7

Before resorting to stackoverflow, i have spend a lot of times looking for the solutions. I have been a linux-user/developer for few years, now shifting to windows-7. I am looking for seting-up a ...

热门标签