Error migrating virtual machines with snapshots

Discussions related to using VirtualBox on Windows hosts.
Post Reply
gliddle
Posts: 2
Joined: 2. Nov 2009, 03:37
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu, Windows7

Error migrating virtual machines with snapshots

Post by gliddle »

Hi,

I have been having a little bit of trouble migrating my virtual machines (not virtual hard disks) with snapshots over to a different partition. I originally created 2 virtual machines with the default location in C:\Document and Settings\<user>\.VirtualBox\Machines.

However, I wanted to migrate it to another partition and found the following post in the forums that appeared to be exactly what I was looking for:
http://forums.virtualbox.org/viewtopic.php?p=34609

This worked great for the first virtual machine I migrated over with a couple of minor edits.
The post recommends modifying the virtualmachine.xml file to remove all entries with the <HardDiskAttachments> tag. I didn't find this tag in my virtualmachine.xml file, but I did notice the tags <AttachedDevice> and when I removed those entries as instructed in the forum post, I was able to migrate and re-register the VM successfully.
However, when I tried to migrate my second VM, I received some UI errors when viewing the snapshots through the Virtual Media Manager. I did delete the VM from VBox, then copy the Machines directory to the new location and then successfuly register the virtual machine back with VBox. The difference between the 1st and the 2nd VM is that the 2nd one (the one that I encountered errors) had 2 snapshots associated with it. The 1st (the one that worked successfully) had no snapshots.
The error that I get from the Virtual Media Manager when I hover the cursor over the snapshot entry within the virtual hard disk (.vdi) is the following:
Could not open the hard disk "C:\Documents and Settings\<user>\.VirtualBox\Machines\<Name of VM>\Snapshots\<UUID>.vdi"
VD: error opening image file "C:\Documents and Settings\<user>\.VirtualBox\Machines\<Name of VM>\Snapshots\<UUID>.vdi" (VERR_PATH_NOT_FOUND)


I checked the virtualmachine.xml file for any direct paths but they all look to be relative paths. Yet, the Virtual Media Manager will still list the snapshot location back to the C:\Documents and Setting directory.

Here's my setup:
VBox version: 3.0.6
Host OS: MS WindowsXP SP3

Any help or advice is greatly appreciated.
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: Error migrating virtual machines with snapshots

Post by MarkCranness »

Check inside your C:\Documents and Settings\<user>\.VirtualBox\VirtualBox.xml file also; it is in there that the differencing disks used by the snapshots are linked up to the base hard disks.
To move VirtualBox.xml, set an environment variable: VBOX_USER_HOME=... (see section 9.1 of the manual).
gliddle
Posts: 2
Joined: 2. Nov 2009, 03:37
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu, Windows7

Re: Error migrating virtual machines with snapshots

Post by gliddle »

Thank you, it worked like a charm.

I changed the path in the VirtualBox.xml file to the new location for the snapshots, moved the VirtualBox.xml file to my new location and created an env variable for VBOX_USER_HOME to point to this new location.

Everything works great!
Post Reply