It is not uncommon that you have to enlarge a partition of a system whether it is physical or virtual. In a Windows environment, the diskpart command can be used but does not work for boot and system partitions. A lot of times however, I have the need to expand the system partition. Here are the steps I follow in an ESX environment but they can also be used in GSX or Workstation (with some other tools) or even old school physical systems.

Step 1: enlarge disk with vmkfstools
Power down the virtual machine and use the service console command vmkfstools with the -X parameter. For example:

vmkfstools -X 12G <path-to-vmdk-file>

Step 2: boot the guest normally
You need to boot the guest normally to let Windows detect the new disk size. If you omit this step, GParted will throw errors after expansion of the partition.

Step 2: use GParted to enlarge the partition on the disk
GParted (Gnome Partition Editor) can be downloaded as a Live CD from here. Just put the iso on your ESX system and connect it to the virtual cd-rom drive of the guest. Then boot the guest and boot from the cd.


When you continue, you get a menu. Select the Xvesa option and then select Done to continue. You will then get a few prompts for language, keyboard layout, screen resolution and so on. The system will continue booting and start GParted. Your disks will be scanned and presented.


Above, you see a disk that has been extended from 5GB to 8GB. Now it is just a matter of expanding the partition. Just right click the partition and select Resize/Move.


Now you can easily resize the partition by typing new values or with the mouse. Click the Resize/Move button when finished. Then click the Apply button and confirm. The partition will be extended and a result dialog is shown.


You can now reset the virtual machine and use the enlarged partition.

There are other tools on the market for this but GParted (for my needs) works well. Best of all, it is free!