I had an office PC converted into a VMWare image and wanted to reduce the image file after cleaning up unwanted files and applications. The compact command for the HDD will not totally reduce the image file size in the HOST OS.
VM Image OS is Windows XP. For linux, I will assume a different process.
To literally reduce file size in the host OS, what I did…
- Free up disk space.
- Zero fill freed up space, I used CCleaner
- Shutdown the VM
- Run again VMWare Player and right click on the VM
- Go to Hard Disk and under Utilities -> Compact
- Finish the compact phase and start the VM again.
- Install any Partitioning software, I used EaseUS.
- After completing the installation, re-size the Hard Disk that has the freed up space to a smaller space that you want
- Apply the re-reize
- Shutdown the VM, the actual size on the Host OS will now have the reduced file size.
You can expand the size again of the partition/hard disk using the partitioning software and it will not affect the actual VM image file size in the host OS until you start adding new files/data into it.