I created a disk for a NEW VM from scratch and brought the VM into operation Running Debian Linux as the guest. At one point the size got up to 21 Gb due to the copying of some zipped files into the guest from the host. After deleting the zip I expected the actual size in my host (Windows 7) to decrease to more closely match the size of the drive in the VM, but it has never come back down.

Here is the output from df -h to show what the size of the drive is in Linux, confirming size of 13 Gb out of 50 Gb drive.

Boxer-SIM:~# cd /

Boxer-SIM:/# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda1 48G 13G 35G 27% /

tmpfs 3.9G 4.0K 3.9G 1% /dev/shm

But as you can see in my Windows host, more space it being taken up by the Boxer-SIM.vmdk disk. (output is while VM is running, same result as when powered off)

11/14/2016 09:45 AM 22,131,048,448 Boxer-SIM.vmdk <== shouldnt be this large, I am only using 13Gb for my files

11/14/2016 09:45 AM <DIR> Boxer-SIM.vmdk.lck

11/13/2016 01:15 PM 0 Boxer-SIM.vmsd

11/14/2016 09:45 AM 2,920 Boxer-SIM.vmx

11/14/2016 09:45 AM <DIR> Boxer-SIM.vmx.lck

11/13/2016 01:15 PM 264 Boxer-SIM.vmxf

11/14/2016 09:45 AM 395 vmware.log

7 File(s) 30,519,668,711 bytes

5 Dir(s) 59,235,213,312 bytes free

I know the system has the capacity to provide more space up to the 50Gb limit as I need more space, but on the flip side, can't it also decrement the amount of space used as I delete files? (Linux doesnt have any recycle bin that I am aware of where deleted files are kept, does it?)

The question got already answered at another topic of yours, but let me copy the method to reclaim zero space in here to help others bumping into this topic.

Before you try to shrink the virtual disk files, you should try to remove any unneeded files from the virtual machine to free space.

For example, on Debian-based VMs, you can run

apt-get autoremove apt-get clean all

to clear out the local repository of retrieved package files.

Also note that if you run a service on the guest that depends on having a bit of free space (such as database services, eg mySQL/Oracle/postgreSQL) that you should shut down the service before continuing with the next step.

Next, run as root (sudo won't work)

cat /dev/zero > /zero.fill;sync;sleep 1;sync;rm -f /zero.fill

to fill the unused space with zeros.

Then power down the VM and open a command box on your windows host.

Run vmware-vdiskmanager with the -k option to shrink (=reclaim unused space) the virtual disk.

edit: normally Linux does not have a recycle bin. Certainly not when deleting files in the terminal. Deleting a file however does not zero out the blocks, it only removes the file from the directory. In order to reclaim the disk space you need to zero out the data first. Which is what is described above using the zero.fill file. If you have multiple partitions setup then you would run it for each partition.

Failed to shrink the disk 'C:\Users\ddamerji\Documents\_Virtual Machines\VIRL\VIRL-disk1.vmdk' : An error occurred while writing a file; the disk is full. Data has not been saved. Free some disk space and try again (0x8).

then that means you have to free space ON THE HOST machine. And having just done this, it appears that it needs as much free space as the file you are trying to actually compress, since the process itself creates a new file and then deletes the old one. I had to free up over 55 GB. Here it is in the middle of the process of compressing: