Another option that I have been using is to use JkDefrag which is free. There is also a whole process on defragging a virtual PC, but since I can't find the "official" link in the JkDefrag forum, it goes something like this for command line parameters:
- Defrag the guest drive from within
the virtual machine.
- Exit the
virtual machine.
On the host
machine, run JkDefrag with these
command lines (you can also put them
in a batch file):
jkDefrag -q -a2
jkDefrag -q -a6 C:\PathToVirtualDisks\VDiskToDefrag.vhd
jkDefrag -q -a3 -e C:\PathToVirtualDisks\VDiskToDefrag.vhd
Here's what the parameters do:
- -q = Quit the program when finished.
- -a2 = Defragment, don't optimize.
- -a6 = Move to end of disk
- -a3 = Defragment, fast optimize.
The process can take a long time depending on the size of your virtual disk. As an example, on my PC with a 56GB vdisk it takes about 16-18 hours to complete this process on really badly fragmented days. As a matter of fact, as I write this I have 150+ fragments of that file being defragmented and it's been running for about 30 minutes and it's only about 10% done with just that file.