Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Ubuntu image VMware disk has grown to 5GB physical file size. It's a dynamically growing disk with the maximum capacity of 8GB. I cleaned some stuff inside Linux distro and now inside it occupies 3GB. Obviously the physical file size didn't shrink back automatically. Is there a way (if possible free of charge) to shrink this disk back to ~3GB?

I need this to fit the image on the DVD.

share|improve this question
up vote 11 down vote accepted

I've found the solution – you have to compact your hard drive:

Virtual Machine - Settings - General - Clean Up Virtual Machine

share|improve this answer
Wow. Finally I found this answer. But... why compacting the virtual disk doesn't actually reclaim the free space? – Wizard79 Feb 12 '14 at 16:19
You need to do this from within the guest Ubuntu OS (assuming you have VMware Tools installed): "vmware-toolbox-cmd disk shrink /" which should do the job. – DH4 Jun 12 '14 at 17:06

Open VMware Toolbox in the guest (as root) and shrink the disk. (Documentation)

If you don't have VMware Tools, you can shrink the disk manually in two steps. First, clear the free space on the virtual disk using a tool like zerofree. Zerofree is available in Ubuntu, but since it requires the guest OS filesystem to be mounted read-only you may want to run it off a live CD. Parted Magic reportedly includes zerofree.

After zeroing the free space, open Virtual Machine Settings and compact the virtual disk.

share|improve this answer
The vmware toolbox UI is no more, but you can still use: "vmware-toolbox-cmd disk shrink /" which should do the job. – DH4 Jun 12 '14 at 16:52

VMWare harddisk resizing:

Expanding the dynamic virtual harddisk in VMWare is easy and does no longer require the command line tool vmware-vdiskmanager.exe located by default in C:\Program Files\VMware\VMware Workstation\ .

For resizing use the following command (Open a command prompt by pressing WIN+R and enter cmd): "C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager.exe" -x NEWSIZE "diskname.vmdk"


The following steps are:

  • Download here
  • Install
  • Open
  • Choose the partition, Click Resize/Move, Drag the handle to its full width
  • Click Apply
  • Agree to reboot
  • During startup, do not press any key whatsoever
  • Let the boot-up module perform its task
  • Check that your Windows system partition size increased.

For a visual rundown of the steps and additional info, see here.

share|improve this answer


sudo vmware-toolbox-cmd disk shrinkonly

from the command prompt in your Ubuntu guest.

(Tested on Ubuntu 14.04 LTS guest + Windows 10 Host + VMWare Workstation 12.1.1 )

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .