Page 1 of 1

How to properly use clonehd option?

Posted: 12. May 2009, 13:31
by wl2776
Hi all.

I have the windows XP guest, which I've created long-long time ago, with 1.x version of the VBox.

This guest uses differencing hard disk, which I have set to 50Gb. I have created and deleted several snapshots, and now the virtual machine uses about 30Gb more than it should.

The respective part of the VirtualBox.xml looks like this

Code: Select all

<HardDisks>
   <HardDisk uuid="{02bf0d9b-c958-422c-8d85-f097868f4b57}" location="VDI/windoz.vdi" format="VDI" type="Normal">
       <HardDisk uuid="{bd6e5cba-054d-4d8a-b7a4-1379735ba295}" location="Machines/windows/Snapshots/{bd6e5cba-054d-4d8a-b7a4-1379735ba295}.vdi" format="VDI">
        <HardDisk uuid="{bffa10a7-1898-482d-9e2e-d6fd5405af5b}" location="/home/wl/.VirtualBox/Machines/windows/Snapshots/{bffa10a7-1898-482d-9e2e-d6fd5405af5b}.vdi" format="VDI"/>
        </HardDisk>
   </HardDisk>
</HardDisks>
I am trying to get back these gigabytes without reinstalling windows and all software inside it.
Currently I don't have any saved snapshots.

Code: Select all

VBoxManage modifyhd windoz.vdi --compact
has already saved me several Gb.

However, the Virtual Media Manager shows that the disk bd6e5cba-054d-4d8a-b7a4-1379735ba295 is not attached to any snapshots and doesn't allow to delete it.

I have searched the internet and found that clonehd can help me.

I tried several variants:

Code: Select all

VBoxManage clonehd windoz.vdi windows1.vdi
VBoxManage clonehd bd6e5cba-054d-4d8a-b7a4-1379735ba295 windows1.vdi  # not attached .vdi
VBoxManage clonehd bffa10a7-1898-482d-9e2e-d6fd5405af5b windows1.vdi     # .vdi, attached to the current state
VBoxManage clonehd ~/.VirtualBox/machines/Snapshots/{bffa10a7-1898-482d-9e2e-d6fd5405af5b}.vdi windows1.vdi # again, current state vdi, but with the full path
However, all of them produced unusable image.

OS didn't boot from it. If I attach this newly produced image to the existing windows guest as the primary slave, checkdisk founds many many file system errors, fixes them, but OS doesn't boot anyway.

I am using PUEL VirtualBox, version 2.2.2, my host is Ubuntu 8.10, 32-bit, and by guest is Windows XP SP3.
Of course, I have defragmented the guest's hard drive before the operation.

Re: How to properly use clonehd option?

Posted: 12. May 2009, 14:05
by wl2776
Hm...
I forgot to mention, that I created a new virtual machine and tried to boot this newly created one.
If I replace the hard disk image in my existing VM with the clone, it boots.

Re: How to properly use clonehd option?

Posted: 12. May 2009, 19:18
by baf
If it works with the old machine that was created with an earlier VB and not in a new machine then its probably some machine setting.
One that many misses is type of ide controller. Also check networkcard types all settings under advanced acpi,io apic et.al.

Re: How to properly use clonehd option?

Posted: 13. May 2009, 08:55
by wl2776
Yes, the IDE controller type was the culprit.