Ubuntu 10.04 is installed in the virtual machine, which is a long time ago. Because only the development environment and Oracle 10 Gb are installed, the occupied space is about 8 GB.
I upgraded 12.04.01 a few days ago. The trouble is that the hard disk space of the virtual machine has soared to around 16 GB. I uninstalled unnecessary software such as openoffice, apt-get clean, and apt-get autoremove.
Df-H: OK. The disk occupies about 8 GB, but the size of the virtual machine's hard disk is 16 GB!
After a long time, I checked N more information and finally got it done:
1. Perform Compac first in the hard disk option set by the virtual machine;
2. enable virtual machines
Before we try to shrink the virtual disk files, we shocould try to remove any unneeded files from the virtual machine to free space. For example, on Debian-based VMs, you can run
Apt-get clean
To clear out the local repository of retrieved package files.
Next, run
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 the command window on the Windows host:
3. Host Execute Command: vmware-vdiskmanager.exe-k F: \ ***** \ ubuntu-10.04.4-desktop-i386.vmdk
The message "Shrink: 100% done." is displayed.
Shrink completed successfully.
Complete
Note: It is because there is no cat/dev/zero> zero. fill; sync; sleep 1; sync; rm-f zero. fill, so failed. It may be necessary to use wipe.
Tips
The shrink function cannot be used in the following cases:
★Use the default GSX Server VM.
★A vm that uses the snapshot function.
★A physical disk is used as a virtual machine disk.
★The virtual disk is saved on the CD-ROM or DVD-ROM.
★You cannot shrink the pre-allocated disk.
Before shrinking, You need to delete the created snapshot. Then, log on to the virtual machine and open VmwareTools to shrink the disk.