virtualizationvirtual-pcvhd

Defrag a virtual hard disk (.vhd)?


Like any other hard disk, virtual hard discs (*.vhd) will suffer from fragmentation.

So to keep good performance i guess i have to defrag first the virtual hard disc from within the virtual machine and also the (physical) hard disc the .vhd is stored on.

First, are these assumption correct? And second, is there a way to defrag both (virtual and physical hard disc) at once?

Thanks in advance!


Solution

  • Defrag the guest, then the host. You can defrag just the vhd file on the host by using a utility like CONTIG.

    I don't believe you can defrag both at once, since the vhd file likely can't be in use in order to defrag it, requiring the VM to be off.