I run a number of virtual machines using VMWare Player on top of host Windows 7 OS. Let's say I am using the VMs for everything from web browsing to actual work, file transfer, etc. for a long period. Will this cause fragmentation within the host Windows 7 OS?

  • 1
    No; The virtual HDD file for virtual machine is either a single file or multiple files on the actual physical storage device. The only actual file fragmentation that exists would be the fragmentation of those files.
    – Ramhound
    Nov 23 '15 at 15:23
  • 1
    @op, note that virtual filesystem fragmentation is not the same as fragmentation on the physical disk, so you will get less value from defraging a virtual file system. The disks SCAN and SEEK operations will not be reduced as a result of the defrag, since the whole virtual volume is in a single file. There may be some reduction in scanning and seeking, but not nearly what you would see on a highly fragmented physical disk. Nov 23 '15 at 15:55
  • @FrankThomas The VMs I create have the file system distributed into several files, there's an option for this when creating a VM with VMWare software. However I am more interested in keeping the host healthy and whenever a guest gets fragmented I'm thinking of saving the contents and restoring an earlier snapshot with the virtual disk in better shape.
    – Vee6
    Nov 23 '15 at 23:09
  • It doesn't really matter whether the virtual filesystem is one file or a dozen, so I'm not really sure what you are trying to accomplish. I have no idea why you would want to do as you suggest. Virtual fragmentation is NOT the same as physical fragmentation, so I recommend you just defrag the host drives occasionally, and leave it be. Nov 24 '15 at 12:41

There are three types of fragmentation that can occur:

  1. Fragmentation of the guest file system. This would occur if you perform activities in the guest that would normally lead to fragmentation on a physical machine. You would defragment this by running a defragmentation utility from within the guest.
  2. Fragmentation within the VM's .vmdk file. This occurs if you use a sparse virtual disk and the virtual disk grows out of order. If, for example, the guest writes to blocks in a non-consecutive order (e.g. block 100, then block 50, then block 75), if those are newly added blocks, they might be added to the end of the .vmdk file in that same non-consecutive order. You would defragment this by asking VMware Workstation to defragment the virtual disk file (in VMware Workstation 12, this is under VM > Settings > Hardware > Hard Disk > Disk utilities > Defragment).
  3. Fragmentation of the host file system. You would defragment this by running a defragmentation utility on the host OS.

It's not necessarily true that fragmentation in one type would cause fragmentation in another type. For example:

  • The .vmdk file could grow and be internally fragmented (type 2), but the host file system could be sufficiently empty to allow the .vmdk file to grow without fragmentation.
  • If most of the .vmdk file is already allocated (i.e., it is not likely to grow any more), then fragmentation types 2 and 3 would not get any worse, but it would still be possible for the guest to increase fragmentation of its own file system (type 1).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.