We can extend .vmdk file size of vm by following below procedure. You have to check the integrity of your .vmdk (virtual machine disk) file. You can do this check within the vm. Right click on the drive which you want to check integrity, Click on properties, select Tools, Then click on check now. You have to reboot the vm, The check will be automatically launched in the first start of the vm after assigning check disk utility.
After completion of the chkdsk on vm is completed without any errors, you can assume that the integrity of .vmdk is consistent then you can start following steps for extending .vmdk file.
Power off the vm.
Run the following command in your host computer
C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager -x 40Gb “C:\Users\yourusername\Documents\Virtual Machines\Windows Server 2003 Enterprise Edition\xxxx.vmdk”
In the above command 40Gb is the new size of the .vmdk file
xxxx is the .vmdk file name
vmware-vdiskmanager is the command to expand the .vmdk file
C:\Program Files\VMware\VMware Workstation\ is the path of the installation files of your VMware workstation software
C:\Users\yourusername\Documents\Virtual Machines\ is the path of the actual VMware machine
This will take some time, and once complete the application will give you some sizing messages.
Now you need to expand the capacity of the disk to take advantage of its new size. If the disk is the system volume you will need to mount the disk in a second VM and expand it from there. If its not a system volume do it within the virtual machine it belongs to.
Once you’ve mounted the disk in a different VM or booted up the VM it belongs to if its not the system volume, do the following.
Go to the command line and start the diskpart utility. By issuing the following command.
Once you’ve started diskpart, list the drives using the following command:
This will show you the disks assigned to your machine. Now the important command
This will show you the drives, their volume number, capacity etc. You now need to select the volume you are about to expand, using the following command. Where n is equal to the number of the volume.
Once selected, you can now expand it using the extend command. You can optionally specify the amount extend it by.
Once you have extended the disk, it’s wise to defrag the drive. To speed up the process of defragmentation, use the tool available in VMWare workstation settings.