Just like physical servers, Virtual Machines created with VMWare Virtual Server, may eventually run out of available disk space. With physical servers, the solution is to add more hard disks and move data or use third party tools to resize the partition. With Virtual Machines, you could also add virtual disks, but if you need to resize the partition, one solution is to use VMWare Server built-in command line utility called vmware-vdiskmanager, that can create, rename, defragment, shrink and expand virtual disks.

To expand an existing partition, the Virtual Machine must be shutdown and powered off. The vmware-vdiskmanager utility resides in the directory that VMWare server was installed. On my install, it is located at C:\Program Files\VMware\VMware Server.

Open a command prompt and navigate to the directory of the virtual disk you want to expand, and execute a directory listing by typing dir at the command prompt.

C:\OTHER\Virtual Machines\WTN1>dir

Volume in drive C is System

Volume Serial Number is E40F-D10A

Directory of C:\OTHER\Virtual Machines\WTN1

05/18/2007 05:30 PM <DIR> .

05/18/2007 05:30 PM <DIR> ..

05/18/2007 04:24 PM 8,664 nvram

05/14/2007 11:57 AM 21,751 vmware-0.log

05/14/2007 08:37 AM 20,180 vmware-1.log

05/12/2007 09:52 PM 22,807 vmware-2.log

05/18/2007 04:24 PM 19,519 vmware.log

04/02/2007 12:41 PM 850 Windows XP Professional.vmsd

05/18/2007 02:28 PM 856 Windows XP Professional.vmx

05/18/2007 04:24 PM 8,589,934,592 WTN1C.vmdk



On my Computer, the Virtual Machine is located at C:\OTHER\Virtual Machines\WTN1 and the Operating System is Windows XP Professional named WTN1. The virtual disk that needs to be expanded is WTN1C.vmdk.

The command to expand a virtual disk follows:

vmware-vdiskmanager -x <new-capacity> diskname

Where:

-x is the option to expand

<new-capacity> is the new size of the virtual disk you want to expand

diskname is the virtual disk name

(NOTE: enter the full path to the vmware-vdiskmanager executable. Use quotes if the path includes spaces)

C:\OTHER\Virtual Machines\WTN1>"C:\Program Files\VMware\VMware Server\vmware-vdiskmanager" -x 10GB WTN1C.vmdk

Using log file C:\Users\Owner\AppData\Local\Temp\vmware-Owner\vdiskmanager.log

Grow: 100% done.

The old geometry C/H/S of the disk is: 16383/16/63

The new geometry C/H/S of the disk is: 16383/16/63

Disk expansion completed successfully.

WARNING: If the virtual disk is partitioned, you must use a third-party

utility in the virtual machine to expand the size of the

partitions. For more information, see:

http://www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1647

Next, execute a directory listing to verify the virtual disk was expanded.

C:\OTHER\Virtual Machines\WTN1>dir

Volume in drive C is System

Volume Serial Number is E40F-D10A



Directory of C:\OTHER\Virtual Machines\WTN1

05/21/2007 11:31 AM <DIR> .

05/21/2007 11:31 AM <DIR> ..

05/21/2007 11:31 AM 8,664 nvram

05/21/2007 11:29 AM 19,549 vmware-0.log

05/18/2007 04:24 PM 19,519 vmware-1.log

05/14/2007 11:57 AM 21,751 vmware-2.log

05/21/2007 11:31 AM 17,724 vmware.log

04/02/2007 12:41 PM 850 Windows XP Professional.vmsd

05/21/2007 11:30 AM 936 Windows XP Professional.vmx

05/21/2007 11:31 AM 10,737,418,240 WTN1C.vmdk

You should now see the new size of the virtul disk. Also, notice the Warning message above. You will need to use a third party tool such as Partition Magic or Acronis Disk Director to resize the partition inside the Virtual Machine Operating System.

To list all available options for vmware-vdiskmanager, just enter the following at a command prompt:

vmware-vdiskmanager.exe /?