Increase the size of a virtual machine disk on VMware Server and Workstation
If you have a VM running on the free VMware Server or VMware Workstation that is running out of disk space then you can use the command line tool vmware-vdiskmanager to grow the virtual disk. Then use the Gparted LiveCD to grow the existing partition to the new disk size. Here are the steps:
- Download the Gparted LiveCD ISO. You will need to save it to a location you can use it to boot the VM.
- Shutdown the virtual machine you want to resize
- Open a command prompt or a terminal on the VMware Server.
- Browse to the folder containing the .vmdk you need to grow
- Use vmware-vdiskmanager to increase the size of the .vmdk.
For example if you had a VM named “MyOS” with a virtual disk named “MyOS.vmdk” and you wanted to increase it from 20GB to 24GB you would type (it is case sensitive):
vmware-vdiskmanager -x 24Gb MyOS.vmd
On a Windows hosted VMware Server or Workstation you will have to specify the path to the tool
c:\program files\vmware\vmware server\vmware-vdiskmanager -x 24Gb MyOS.vmdk - Boot the VM to the Gparted ISO
- Once the Gparted partition editor loads, click your disk in the partition list
- Click the Resize/Move button
- Drag the arrow to extend the size of the partition. Be sure to work out the free space before and/or after the partition by sliding the whole partition either left or right.
- Next click the Apply button to start the resizing process.
- After it completes click the Close button
- Reboot the VM without the Gparted ISO to the VM’s OS.
- If your VM’s OS is Windows you will have to wait for a chkdsk on the reboot. Then Windows will reboot again.
- Check your new disk size in My Computer and Disk Manager!
For those who want to see all the functionality of the tool, the following is the output of “vmware-vdiskmanager –help” on my Linux VMware Server.
vmware-vdiskmanager –help
VMware Virtual Disk Manager – build 56528.Usage: vmware-vdiskmanager OPTIONS diskName
Offline disk manipulation utility
Options:
-c : create disk; need to specify other create options
-d : defragment the specified virtual disk
-n <source-disk> : rename the specified virtual disk; need to
specify destination disk-name
-q : do not log messages
-r <source-disk> : convert the specified disk; need to specify
destination disk-type
-x <new-capacity> : expand the disk to the specified capacityAdditional options for create and convert:
-a <adapter> : (for use with -c only) adapter type (ide, buslogic or lsilogic)
-s <size> : capacity of the virtual disk
-t <disk-type> : disk type idDisk types:
0 : single growable virtual disk
1 : growable virtual disk split in 2Gb files
2 : preallocated virtual disk
3 : preallocated virtual disk split in 2Gb filesThe capacity can be specified in sectors, Kb, Mb or Gb.
The acceptable ranges:
ide adapter : [100.0Mb, 950.0Gb]
scsi adapter: [100.0Mb, 950.0Gb]
ex 1: vmware-vdiskmanager -c -s 850Mb -a ide -t 0 myIdeDisk.vmdk
ex 2: vmware-vdiskmanager -d myDisk.vmdk
ex 3: vmware-vdiskmanager -r sourceDisk.vmdk -t 0 destinationDisk.vmdk
ex 4: vmware-vdiskmanager -x 36Gb myDisk.vmdk
ex 5: vmware-vdiskmanager -n sourceName.vmdk destinationName.vmdk









