defrag doesn't make sense in these days of ssd's. What Windows actually does is a trim on the ssd. In a vm it's harder to recognize it as an ssd so it would probably fill up the space but what you could do is use sdelete to clean out not-used sectors