Page 1 of 1
How to rename a Differencing Virtual Disk
Posted: 5. Sep 2010, 12:20
by moiztankiwala
I have my setup where I have multiple virtual machines with multiple levels of differencing disks.
I have created the base disk (.vdi) by using the wizard and after it has the OS installed, I mark it as immutable (VBoxManage command). Then when I attach this immutable image to a virtual machine, I check the "Differencing Disk" checkbox and Virtual Box creates a differencing disk.
Q: Is there some means where I can control where and with what name this differencing disk is created? I don't like the {GUID}.vdi name that the vhi file automatically gets, because it is almost impossible to figure out what the disk contains from the GUID name.
Q: Is there some way to rename this {GUID}.vdi files? I don't think simply renaming at the host OS level will work since the media is registered with the GUID file name and dependencies among child-parent is maintained via this GUID name.
Thanks in advance.
-Moiz Tankiwala
Re: How to rename a Differencing Virtual Disk
Posted: 5. Sep 2010, 13:59
by mpack
I think that should be possible - but just in case I'm wrong you should back up your VirtualBox.xml file and this VMs disk image folder before trying anything.
The VirtualBox app should of course be closed for this.
Anyway, links between snapshots and difference images is done using UUID, not filename. Meaning that there are very few places where the filename is important, and in fact the only place I can think of is the Media Registry (i.e. <HardDisks> section) of VirtualBox.xml. You need to search VirtualBox.xml for the <HardDisk> line for your difference image, i.e. the one which maps a UUID value to a filename. You can change the filename there, and then change the filename in the host to match. It must of course be an exact filename match, so be very careful.
When you restart the VirtualBox GUI app you should hopefully see the results of the name change.
Let us know if this works.
Re: How to rename a Differencing Virtual Disk
Posted: 5. Sep 2010, 16:31
by moiztankiwala
Well, there is somewhere else apart from the VirtualBox XML file that Virtual Box is keeping track. See this error message that I get:

- Error.PNG (24.01 KiB) Viewed 4938 times
When I try to attach this file, it is trying to re-register the file even though there exists a matching entry in the XML file for this newly renamed file.
Thanks in advance for looking into this.
Re: How to rename a Differencing Virtual Disk
Posted: 5. Sep 2010, 16:58
by moiztankiwala
Now, after I restored everything to the way it was before I decided to make the change, it does not work. Like the new (renamed) vdi, it wants to re-register the old vdi.
DON'T get me wrong. I am NOT blaming you. I am mentioning this for informational purpose only.
I will try to unregisterimage and see registerimage via command line and see if I can get my differencial disk to work again.
Thanks.
Re: How to rename a Differencing Virtual Disk
Posted: 5. Sep 2010, 19:21
by mpack
moiztankiwala wrote:Now, after I restored everything to the way it was
That's a bit ambiguous. For clarity, you need to restore the VirtualBox.xml file to what it was before, and you need to restore the contents of your VMs folder.
As to the error message, I don't understand the context in which you got this error, nor do I understand your mention of "when I attach the file": the procedure I outlined involved editing one xml file and renaming one vdi file. All done outside of VirtualBox. There was nothing to do inside VBox, certainly no need to "attach" anything, whatever that involves.
Please post your
edited VirtualBox.xml (as an attachment please).
Re: How to rename a Differencing Virtual Disk
Posted: 6. Sep 2010, 00:53
by moiztankiwala
My bad. Before I followed your steps, I had detached the harddisk from the virtual machine. Hence after making the changes, when I was trying to reattach the differencing disk, I was running into this error since virtual box was trying to register it when it was already registered.
After I posted my last comment, I thought about this scenario and retired by modifying the XML files such that the disk is in the attached condition and it worked.
You seem to be an expert - can you provide any pointers on having multiple levels of differencing disks? I am able to create the first differencing disk but don't know how to create the next child differencing disk. The Virtual Box UI is very limited and there is no command line that I found would be able to create a differencing disk with a specified differencing disk its parent.
Thanks again for all your inputs. It was much appreciated.
Regards,
Moiz Tankiwala
Re: How to rename a Differencing Virtual Disk
Posted: 6. Sep 2010, 12:17
by mpack
moiztankiwala wrote:You seem to be an expert - can you provide any pointers on having multiple levels of differencing disks? I am able to create the first differencing disk but don't know how to create the next child differencing disk.
I'm not an expert - I know some theory, but I don't know the practice since I do not trust in the reliability of differencing disks (including the snapshots feature), and therefore do not personally use them.
I suspect that a bit of xml editing would get you further layers of differencing information, but I don't recommend it. Differencing disks are fragile enough already, without you forcing them into structures that VBox does not expect. I helped with your renaming question because I believe it's harmless.
Re: How to rename a Differencing Virtual Disk
Posted: 6. Sep 2010, 22:56
by moiztankiwala
Thank you for your inputs. I appreciate that.
Moiz