If you are running Linux in a VM and notice that your VM is getting larger on disk and you aren’t sure why, here are a couple things to try.
1. The simplest thing to try is to see which directories are taking most of the storage. There are tools to analyze your file system and tell you what files and directories are there and how much space they’re taking up. If you don’t have one of these installed, then you can easily do this yourself by su-ing to root, changing to the root of the file system, and then typing “du -sh ./*”, which will tell you how much storage is consumed by files under each of the directories just under the root.
2. It’s pretty common in a VM to see that the /tmp directory is taking up a huge chunk of storage. This directory is used by the OS and VMware for housekeeping storage and should be cleared each time you reboot the VM. However, sometimes that doesn’t happen and you have to figure out which files can be safely deleted from /tmp. It’s usually pretty safe to delete files left over after a reboot. One thing I’ve seen is that there will be a directory under /tmp called VMwareDnD, which is a temporary cache VMware uses for managing file drag and drop operations between the VM and the host OS. Try rebooting your VM to clear this directory and if it’s still there after a reboot, you can safely delete it.