Compact *.vmdk does not work (for Fedora guestOS) in VmWare Player

I have a Fedora Linux Guest OS in a VmWare Player.
The hard drive on the virtual machine (*.vmdk file) got to big and I was looking for a way to Compact it.
The compact operation from VmWare Player->Virtual Machine->Edit Virtual Machine Settings->Hard Disk->Utilities->Compact did not do the trick.

The solution came from a VmWare forum thread, the 4-th post from the top:

Assuming the VmWare virtual disk is not pre-allocated and the filesystem is ext4 you will have to manually prepare it to be shrunk.

In the VM, in a Terminal become root and then copy and paste the following command, as is, and then press Enter:

dd if=/dev/zero of=wipefile bs=1024x1024; rm wipefile

Wait for the command prompt to return and then shutdown the VM and then from the Virtual Machine Settings for the Hard Disk select the Compact command from the Utilities button.

The solution worked like a charm.

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: