There is an order of operations to defragment the disks of a (VMware Workstation) VM.
First, use the defragmentation utility in the operating system running on the VM to defrag… just like a real machine.
Use the Utility provided by the VM software to defragment(machine must be powered down). VM->Settings->Hardware->Hard Disk->Utilities(Button).
Use the defragmentation utility in the HOST operating system to defrag the disk files of the virtual machine.