CloneVDI tool - Discussion & Support

Discussions related to using VirtualBox on Windows hosts.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CloneVDI tool - Discussion & Support

Post by Perryg »

I am just waiting for VMDK support :mrgreen:
demoneye
Posts: 7
Joined: 10. Aug 2009, 18:35
Primary OS: MS Windows XP
VBox Version: OSE Fedora
Guest OSses: win xp

Re: CloneVDI tool - Discussion & Support

Post by demoneye »

nice work mpack for bring this software to us , 10x for your time consuming and great support in here for it :)
its work in here like a charm with 0 problem , i just wanna ask something i saw in here that is unclear for me.
if i Del the original *.vdi does it impact the clone i made? if so how can it be , since they are not link together ...
cheers :)
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

nardrish wrote:But the part I dislike most is when I need to increase disk space. I would formerly ghost the partition, delete the .vdi, create a new vdi with a bigger partition and then restore the ghost image. A pretty time consuming task.
Yes. I had been meaning for a long time to write a little GUI just to help with cloning VDI files. Then one day I needed to make more than a clone; I needed a VM with a much bigger hard drive, so I went through the long procedure you describe. It crossed my mind that if you were to tell someone who isn't a VBox user just what is involved in enlarging a VBox drive, he might burst out laughing! That is what finally made me decide to get to work, choosing to write a single tool that was basically intended for cloning, but which could do those other occasional jobs too (enlarging, compacting).
nardrish wrote:What I'd like to see if VirtualBox can take it to the next few levels up to just increase the disk space without having to clone to get the increase, like in VMWare Server free edition where we can just increase the disk space.
I don't know how VMWare does it, but enlarging a VDI drive has to overcome a basic problem of dynamic VDIs: the block table needs to grow, but the block table is at the beginning of the VDI file. That means you need to move blocks around to make space near the beginning of the file. Now you could certainly do this in-place, but you would be taking an awful risk: a crash or a power cut half way through leaves you with a dead VDI. It's much safer to write a new version of the VDI to a separate file.

In fact I can think of another way to easily do dynamic enlargement, and that is with difference images (the snapshot feature): there's no real reason why the drive representing the "current state" can't represent a larger drive than the base VDI. It would make merging snapshots tricky however, plus I dislike snapshots for other reasons.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

Perryg wrote:I am just waiting for VMDK support :mrgreen:
:) nice prod, but... I wasn't planning on adding vmdk support, first because nobody has mentioned it before, second because I don't remember reading lots of issues with VirtualBox's support for vmdk, so why convert? If you meant vmdk for both read and write... well I wasn't planning to ever offer any alternative to VDI output. Is this just a whim Perry, or do you see a significant demand for vmdk conversion?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

demoneye wrote:if i Del the original *.vdi does it impact the clone i made? if so how can it be , since they are not link together ...
cheers :)
Clones are independant, that's one of the things that makes them different from snapshots. Deleting the original has no effect whatever on the clone. Or vice versa.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: CloneVDI tool - Discussion & Support

Post by Perryg »

mpack wrote:
Perryg wrote:I am just waiting for VMDK support :mrgreen:
:) nice prod, but... I wasn't planning on adding vmdk support, first because nobody has mentioned it before, second because I don't remember reading lots of issues with VirtualBox's support for vmdk, so why convert? If you meant vmdk for both read and write... well I wasn't planning to ever offer any alternative to VDI output. Is this just a whim Perry, or do you see a significant demand for vmdk conversion?
Naw just a whim Don. Trying to make some of my OSes multi-platform and being lazy by nature was hoping for a single place to convert, compact, and change disk size, but I have lived without it this far so not big deal. I will continue to do it the longer, harder way. :wink:
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

mpack wrote:I don't know how VMWare does it, but enlarging a VDI drive has to overcome a basic problem of dynamic VDIs: the block table needs to grow, but the block table is at the beginning of the VDI file.
Actually, having glanced at the format spec I can see how they would do it. A vmdk is made up of a series of one or more "extents" (i.e. the disk is split up into pieces, each piece in its own file); and unlike the case of split VHD files, each vmdk extent seems to have its own block table. So, enlarging a vmdk is simply a matter of adding more extents.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

mpack wrote:so I went through the long procedure you describe.
Though I should add however, that while researching how to do that disk enlargment rigmarole I found myself shopping around for disk imaging apps, and that introduced me to Acronis TrueImage, an application I'm now very fond of and use a lot. I would never have realized that an imaging tool had so many uses: backups of course, physical to virtual migration, physical to physical migration, and a superior alternative to Windows Restore!

Create a BartPE CD with Acronis TrueImage on it and you have a really powerful (and user friendly) rescue tool.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: CloneVDI tool - Discussion & Support

Post by vbox4me2 »

Here' an idea, create an empty new VDI and mark/create a spare space between the main block and data area, once the VDI needs to be enlarged you dip into this spare space to enlarge the block without having to move data.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

vbox4me2 wrote:Here' an idea, create an empty new VDI and mark/create a spare space between the main block and data area, once the VDI needs to be enlarged you dip into this spare space to enlarge the block without having to move data.
That would be possible within the existing VDI spec: offset to the first image block is a field stored in the header, so the first image block needn't follow immediately after the block table. However the drive would still have a maximum size... and I'm not sure why you wouldn't just fill that extra space with a bigger table right away...
SecretCode
Posts: 67
Joined: 17. Jul 2009, 10:20
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, XP, other
Location: Finland

Re: CloneVDI tool - Discussion & Support

Post by SecretCode »

mpack wrote:However the drive would still have a maximum size... and I'm not sure why you wouldn't just fill that extra space with a bigger table right away...
If the guest sees a given drive as having a max size of 8GB, but the vdi format has table capacity for 250GB, that would ensure the vdi would not grow unexpectedly and use up all of the host drive it's on (but still to allow intervention to enlarge the virtual drive). This would be important to me and I assume most users.

So the requirement would be to have the vdi file support a larger maximum size than the guest sees as the drive's physical capacity - but to make that apparent physical capacity editable by the user.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

SecretCode wrote:So the requirement would be to have the vdi file support a larger maximum size than the guest sees as the drive's physical capacity - but to make that apparent physical capacity editable by the user.
The guest capacity is determined by the partition size, which can already be much less than the drive size. This is a common trick that VBox users have been using for some time to limit dynamic expansion while providing potential for easy enlargement as needed.
haichen
Posts: 2
Joined: 28. Sep 2009, 13:49
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: WinXP Win7

Re: CloneVDI tool - Discussion & Support

Post by haichen »

mpack wrote:.. Acronis TrueImage, an application I'm now very fond of and use a lot. I would never have realized that an imaging tool had so many uses: backups of course, physical to virtual migration, physical to physical migration, and a superior alternative to Windows Restore!
Would be wonderful if we can convert tib to VDI!
I want to migrate to Win7 next month. Then I want to use my actual XP further in a VDI. I tried it with Acronis TrueImage Home 2010 from physical->tib->vhd ->vdi, but until now without success (last step qemu-img and vboxmanage). Next days I'll try it with your tool.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: CloneVDI tool - Discussion & Support

Post by mpack »

haichen wrote:Would be wonderful if we can convert tib to VDI!
I've thought the very same thing, though I don't know if Acronis publish the tib spec.
haichen wrote:I want to migrate to Win7 next month. Then I want to use my actual XP further in a VDI. I tried it with Acronis TrueImage Home 2010 from physical->tib->vhd ->vdi, but until now without success (last step qemu-img and vboxmanage). Next days I'll try it with your tool.
You seem to have some unnecessary steps in there. The only required steps are imaging the physical host with Acronis to create the .tib file, then running Acronis inside the guest, somehow with access to the same .tib, and restore that into a freshly created VM whose virtual hard disk size is at least as big as the old physical PC had.

I've found that giving an uninitialized VM access to the .tib file is a bit tricky. At the moment my procedure is to create a VDI, attach the new VDI to a previously existing VM, and copy the .tib file from a shared folder onto that VDI. Now disconnect the VDI from that VM, create a new VM with a new VDI, and attach the earlier VDI as the second drive in the new VM. Now I have a VM that has access to the .tib file without requiring working USB or network connections. Mount a BartPE ISO (including Acronis BartPE plugin) into the new VM, and run. 10 minutes you should have "restored" the .tib onto the main HDD of the new VM.

Read up on P2V migration first. In particular, running MergeIDE on the host prior to imaging with Acronis. You may have to experiment to find out what value of the IO APIC setting allows the guest to boot. In the final resort you can always mount a ISO of the XP setup CD to repair the virtual installation.

The guest will need to be reactivated.
haichen
Posts: 2
Joined: 28. Sep 2009, 13:49
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: WinXP Win7

Re: CloneVDI tool - Discussion & Support

Post by haichen »

Thanks for your detailed Answer. I will try it as you described.
Post Reply