Migrating virtual machines

This is for discussing general topics about how to use VirtualBox.
Post Reply
luicpend
Posts: 5
Joined: 26. Jun 2007, 23:29

Migrating virtual machines

Post by luicpend »

Hi there,

I am trying to migrate a virtual machine from XP to Linux (Ubuntu 7.x). I have gone through the forums and the documentation, and the answer seems to be using vboxmanage clonevdi

Now, when I look to my vdi files, I have two related to this specific virtual machine: one with the normal name (MSIII.vdi), plus another ({hexadecimal number.vdi}). This last vdi file has an associated .sav file.

If I clone the file MSIII.vdi, I got indeed a copy of the initial virtual machine, but this has not the final state. But I cannot clone the second vdi file, as vboxmanage reports that that is a differencing file.

This looks quite clear to me, but then: how can I merge the last state into the original MSIII.vdi file, so that cloning this file allows me to fully migrate my virtual machine?

Thanks!
michael
Oracle Corporation
Posts: 682
Joined: 10. May 2007, 09:46
Contact:

Post by michael »

You want "discard snapshot" under the "Snapshots" tab for the machine in the main VirtualBox user interface. This merges the snapshot into the current state and leaves you with a single VDI file representing the most recent state of the VM.
hubert
Posts: 4
Joined: 26. Jun 2007, 17:31

Post by hubert »

I've tried that.
But "discard snapshot" (in German: Sicherungspunkt verwerfen) is not clickable (greyed-out).
michael
Oracle Corporation
Posts: 682
Joined: 10. May 2007, 09:46
Contact:

Post by michael »

Did you select the snapshot, rather than the current state? Just a guess, I can't immediately think of other reasons for this to happen, except perhaps that the XML settings file is corrupt in some way.
hubert
Posts: 4
Joined: 26. Jun 2007, 17:31

Post by hubert »

Yes, I selected one of the snapshots.
Since I also do have the problem with "Speicherzugriffsfehler" (--> http://forums.virtualbox.org/viewtopic.php?t=385 ) you may be right and I have corrupt files. But what to do.
luicpend
Posts: 5
Joined: 26. Jun 2007, 23:29

Post by luicpend »

Hi,

thanks for your answers, and sorry for the delay on my feedback, but I was trying to repeat the scenario, losing my machine while trying, and spending some good time.

I have been trying it again, and it seems fine. Here goes the steps I performed:

1- Create the machine.
2- Take a snapshot. The snapshots directory will contain a .sav and a .vdi files.
3- Close the machine, saving its state.
4- Discard snapshot. Here, the .vdi file in the snapshots directory DOES NOT disappear.
5- Start again the machine, do some work, then exit, saving its state.

6- If now I clone the VDI file, and create a new machine based on this disk, the work done on step (5) is missing. This seems OKAY, as I just saved the state, didn't power off the machine.

7- I restart again the original machine, and power it off. The snapshots directory contains now a .VDI file, that, inspected with Vboxmanage, is reported to be a differentiating disk.

8- Cloning now the VDI file (the original one, not the one in the snapshots directory) works now properly: when I create a new machine based on it, all the intermediate work I had done appears on the cloned machine.

That is, the cloning seems to take perfect care of the existing differentiating file.

I have been yet unable to migrate the machine to Ubuntu, losing my machine and quite a lot of work on that makes me a bit afraid of repeating the experience; however, I am pretty confident that the error was mine, not on the virtualbox application.

Cheers
vsridhars
Posts: 5
Joined: 7. Jul 2007, 19:44

Adding my observation - xml missing

Post by vsridhars »

Hi,

I have a similar problem. While trying to delete some snapshots, ran out of disk space.

Moved some of the differencing files to a separate partition, edited the xml. Virtualbox window (main server / guest os) was not running at that time - however one process was still running. Killed that.

Realized that with it, it removed my XML settings file. Now I am left with a blank xml file, a 12GB partition + 4 3GB files.

Have to figure out how to get this back in shape.

Rgds
loan
Posts: 3
Joined: 13. Jul 2007, 11:50
Location: Switzerland

Post by loan »

Hi

in my opinion there is a missunderstanding in this entire post. There are three files that are related to the virtual disk in VB.
1. the base vdi with a simple filename.vdi
2. one or more UUID.vid -> they contain the different snapshots (only when snapshots exist. The base.vdi and the associated UUID.vdi can be shown in the Virtual Disk Manager when a disk is mounted)
3. a UUID.sav file -> This is the saved state of a VM and exists only when the VM state is saved durring 'power off' a VM.

regards
André
vsridhars
Posts: 5
Joined: 7. Jul 2007, 19:44

RE: Virtual Drives

Post by vsridhars »

Got this sorted in the following manner.

a) To regenerate the $HOME/.VirtualBox/VirtualBox.xml --> removed VirtualBox, deleted the dir. and did a fresh install.

b) Then, picked up the 12GB drive as the first primary boot disk.

c) Was not able to add all those differential files -- each one said something about invalid header. Ignored the same.

d) On booting - got back the OS as it was a week back. Not bad.
Did the necessary changes to get it rolling.


The observation that I have -- is

1. For normal usages, taking a snapshot may not be very essential -- as long as your primary virtual disk is safe and steady

2. There is some issue within the virtualbox process - where if it gets killed, it wipes off the config xml.
luicpend
Posts: 5
Joined: 26. Jun 2007, 23:29

Post by luicpend »

a7d16fe6Well, I have run again into the same problem again.
My normal scenario is to save the state of the machine, or power it off to create a backup. That is, I never create snapshots.
.....And I eventually end with more than one .vdi file

Having more than one .vdi file implies:
1- No easy backup. (Although not much more difficult, just caring of more files)
2- Impossible to migrate the machine (well, perhaps hacking the .xml description this could be achieved, I do not know).
3- As user vsridhars posts, trying to restore a corrupted machine (with missing .xml file) gets as well complicated.

I guess that the solution is to have a 'merger', producing one .vdi file out of the original plus the differentiating image. When I try to clone the diff .vdi file, the vboxmanage utility reports that the operation is STILL not possible, so that operation is PROBABLY on the pipeline.

Would some Innotek moderator mention whether such operation is on the roadmap?
vsridhars
Posts: 5
Joined: 7. Jul 2007, 19:44

RE: Multiple VDI files

Post by vsridhars »

You are right about the snapshots and too many vdi files.

Earlier, I had tried creating a snapshot - similar to System Recovery - at checkpoints like Application install etc. Then I realized that even when there was no explicit "create snapshot", the snapshot file did grow.

Infact once, when I was doing a "defrag" within the guest XP system, it reported a disk full. Turns out the snapshot grew and filled up my HOST home partition. That is somewhat unusual. Why should a snapshot change without my initiation?

This time around, have left aside snapshots.
And the whole thing works like a charm.

And yes - I do not do a Virtualbox shutdown or close. Instead, I do a guest OS shutdown so that it comes back to a proper state. That has been working quite well for the last week.
Post Reply