Changing snapshot VDI path / Adding HDD to manager

Discussions related to using VirtualBox on Windows hosts.
Post Reply
StefanRo
Posts: 3
Joined: 26. Jan 2015, 17:47

Changing snapshot VDI path / Adding HDD to manager

Post by StefanRo »

Hello, I have 2 Problems originating from my attempt to move two VBox Machines to a different drive.

What I did
I have a VM which is build as a linked clone.
I moved the entire folder of this linked clone to its new location, changed the .virtualbox\virtualbox.xml to point to the new location, started the VM but got an Error. The error is that the VM cant find it's snapshot .vdi (which was moved, and is available at the new location). I couldn't find a config to set this path, the virtual machine manager reports the old path (with a yellow warning) but has no option to change the path. vboxmanage showhddinfo also diplays the old path. I event tried to update it using "vboxmanage modifyhd --property location=" but got an error, I tried adding a location="..." to the <StorageController .. <AttachedDevice .. <Image .." inside the .vbox config file of the VM but it was ignored/overwritten. I couldn't locate any VBox config file containing this VDI path information and I even scanned the windows registry!

Finally I decided to try the suggested move-methode by removing my VM entry from the Manager and trying to add it from it's new location, but it complains that it's missing its harddisk (displaying the UUID of the .vdi inside the snapshot folder, the one whos path I couldn't change in the first place)

My two questions are: how do I add this .VDI so that the import of VM 1 will succeed and how do I change the VDI path of my second VM, which I havent deleted from the manager yet.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Changing snapshot VDI path / Adding HDD to manager

Post by mpack »

Linked clones are difficult to move. Currently the vbox file contains absolute paths for reasons that aren't entirely clear to me - I suspect that it's an oversight in a relatively new feature, and this oversight will no doubt be corrected in time.

For now, the best solution IMHO is to create a full clone of the linked clone. The default machine folder can be assigned to the new location first, and the full clone will be created there; no need to do the move as a separate step.
StefanRo
Posts: 3
Joined: 26. Jan 2015, 17:47

Re: Changing snapshot VDI path / Adding HDD to manager

Post by StefanRo »

Hello mpack, thanks for the fast reply.

So, the VM I deleted from the Manager is lost in that case? As I am unable to add it again (even after copying it back to ist's original location) to create a full clone (it's still complaining that it's harddisk is missing).
I was able to create a full clone from the second VM which I didn't delete from the manager. But to add the VM1 I need to somehow reattach the snapshot-VDI to the VBox manager... is there some known hack to achieve this? Some hidden registry/config setting ? If I recall correctly older versions of the disk manager were able to attach VDI files. For some unknown reasons this feature seems to be removed from the current versions of VBox.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Changing snapshot VDI path / Adding HDD to manager

Post by mpack »

Your options are (1) Put all files back where the were then apply my previous suggestion, (2) Manually edit the paths in the .vbox file, (3) Put the complete VDI chain in one folder, clone the snapshot using CloneVDI, then build a new VM around the (now merged) clone VDI.
StefanRo
Posts: 3
Joined: 26. Jan 2015, 17:47

Re: Changing snapshot VDI path / Adding HDD to manager

Post by StefanRo »

Hey mpack,

sadly, your proposed solution does not work.
I did (1), moved everything back to its original location, but adding this VM back to VB is impossible. Remember that I deleted the VM from the manager as suggested in the FAQ. This removed the metadata about the snapshot.vdi of this VM from the disk manager. Because this is a linked VM, this snapshot is essential, as it does contain everything this VM represents. So, when adding this VM back VB hast to add this snapshot.VDI back or the VM can't work. The snapshot.vdi is in its default path, the snapshot folder inside the VM folder, but VB doesn't recognice it when trying to import the VM.
As a consequence, to successfully import this VM we have to somehow first add the snapshot.vdi back to the disk manager, or the import process will fail otherwise. And here it falls apart: there is no way to achieve just that. Neither the VM.vbox nor the virtualbox.xml config files contain the snapshot-path and there is no other known way (to me, that is) to somehow hack this VDI back into the disk manager. And whithout this, we are back at step one.
I tried CloneVDI, but that tool is unable to clone a difference image (linked-VM)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Changing snapshot VDI path / Adding HDD to manager

Post by mpack »

StefanRo wrote:I tried CloneVDI, but that tool is unable to clone a difference image (linked-VM)
Read the release notes that come with the tool.
Post Reply