In VMware ESX 4.x the default disk type for Windows XP 32bit virtual machine is IDE. If you did not size your drive correctly, you will be unable to expand this virtual disk later using the VMware management client. But if you had selected SCSI adapter instead of IDE, then expanding the disk after the installation of the OS is a non-issue.
There are ways to expand the virtual IDE disk, you can use VMware Converter to V2V the virtual machine specifying the new disk size. This process take time to complete. But if you are not afraid of using the command line you can use vmkfstools, this method is much quicker.
Here is how to expand the VMware virtual IDE disk using vmkfstools. The first thing you need to do is to turn on SSH so you can connect to the ESX/ESXi command line console. This procedure works for ESXi 5.0 and I am sure it is the same steps for ESX 4.x. You also need to shutdown the guest OS.
Using Putty or any similar tool I connected to the SSH port of the ESXi host. Navigate to the directory where VMDK file of the guest machine is.
cd /vmfs/volumes/5057492d-0e786a86-c8e6-842b2b02f0b7/my_guest_machine
List the files and note the size of my_guest_machine-flat.vmdk is 32226647040 (30G).
/vmfs/volumes/5057492d-0e786a86-c8e6-842b2b02f0b7/my_guest_machine # ls -l
-rw-r–r– 1 root root 78 Sep 17 16:14 my_guest_machine-46305ea2.hlog
-rw——- 1 root root 32226647040 Nov 30 16:00 my_guest_machine-flat.vmdk
-rw——- 1 root root 8684 Nov 30 16:00 my_guest_machine.nvram
-rw——- 1 root root 611 Nov 30 16:07 my_guest_machine.vmdk
-rw-r–r– 1 root root 43 Nov 30 16:00 my_guest_machine.vmsd
-rwxr-xr-x 1 root root 2984 Nov 30 16:00 my_guest_machine.vmx
-rw-r–r– 1 root root 2910 Sep 28 21:03 my_guest_machine.vmxf
-rw-r–r– 1 root root 115989 Sep 17 16:14 vmware-0.log
-rw——- 1 root root 87347 Sep 17 16:04 vmware-25.log
-rw——- 1 root root 108863 Sep 17 16:04 vmware-26.log
-rw——- 1 root root 169596 Sep 17 16:04 vmware-27.log
-rw——- 1 root root 36856 Sep 17 16:04 vmware-28.log
-rw——- 1 root root 87768 Sep 17 16:04 vmware-29.log
-rw——- 1 root root 87342 Sep 17 16:04 vmware-30.log
-rw-r–r– 1 root root 912393 Nov 30 16:00 vmware.log
I am going to double the disk size to a total of 60G using the tool vmkfstools. Note that you specify the total disk size with this tool. Also you
must specify the file without the word flat in the name, this in turn will increase the flat file.
# vmkfstools -X 60G ./my_guest_machine.vmdk
Grow: 100% done.
List the files again and note the size increment for my_guest_machine-flat.vmdk 64424509440 (60G).
/vmfs/volumes/5057492d-0e786a86-c8e6-842b2b02f0b7/my_guest_machine # ls -l
-rw-r–r– 1 root root 78 Sep 17 16:14 my_guest_machine-46305ea2.hlog
-rw——- 1 root root 64424509440 Nov 30 16:00 my_guest_machine-flat.vmdk
-rw——- 1 root root 8684 Nov 30 16:00 my_guest_machine.nvram
-rw——- 1 root root 613 Nov 30 16:11 my_guest_machine.vmdk
-rw-r–r– 1 root root 43 Nov 30 16:00 my_guest_machine.vmsd
-rwxr-xr-x 1 root root 2984 Nov 30 16:00 my_guest_machine.vmx
-rw-r–r– 1 root root 2910 Sep 28 21:03 my_guest_machine.vmxf
-rw-r–r– 1 root root 115989 Sep 17 16:14 vmware-0.log
-rw——- 1 root root 87347 Sep 17 16:04 vmware-25.log
-rw——- 1 root root 108863 Sep 17 16:04 vmware-26.log
-rw——- 1 root root 169596 Sep 17 16:04 vmware-27.log
-rw——- 1 root root 36856 Sep 17 16:04 vmware-28.log
-rw——- 1 root root 87768 Sep 17 16:04 vmware-29.log
-rw——- 1 root root 87342 Sep 17 16:04 vmware-30.log
-rw-r–r– 1 root root 912393 Nov 30 16:00 vmware.log
Now power on the guest machine, you need to download the Extpart.exe utility from Dell, www.dell.com/support/drivers/us/en/19/DriverDetails?driverId=R64398. Using extpart you can perform an online volume expansion of NTFS formatted basic disc.
Open a command promt windows and navigate to the directory where the extpart.exe utility is.
Execute the below command, c: is the drive you wish to expand, 29696 is the size increment in megabytes. It will only accept megabytes not gigabytes.
extpart c: 29696
You are done, reboot the machine.