Resize a VMWare virtual disk

This post describes how you can resize your VMWare disk in linux using the vmware-vdiskmanager tool, a offline disk manipulation utility.
I’ve been using VMWare Workstation version 6.5 on a Ubuntu 8.10 Intrepid Ibex linux installation.

Shrink a disk image

vmware-vdiskmanager -k diskname.vmdk

Expand the disk to the specified capacity

vmware-vdiskmanager -x <new-capacity> diskimage.vmdk

Example extend a disk to 120GB

vmware-vdiskmanager -x 120GB diskimage.vmdk

You should use a Live-CD or something to resize/expand the filesystem to fill the extended disk. I used gparted on a Ubuntu Live-CD and the operation var quick and painless.

Note
Only local virtual disks may be expanded og shrinked and these features are unavailable if you have used the Snapshot functionality. If you have made a Snapshot, then I recommend creating a clone of the system and then resize the cloned image disk.

Always remember to backup your virtual machine before doing this operation.