February 6, 2006

Extending a VMWare Partition

I inherited a VMWare Windows 2003 Server image to perform some testing on recently.  Unfortunately the c: drive was only 4GB, and after applying all the hotfixes there was no room for anything else.

After talking with my colleague, Scott, we were able to extend the c: drive to 10GB very quickly.

Here's how:
  1. Shutdown the Virtual OS.
  2. Make a working copy of the VMWare files for the current image that you want to extend.
  3. In the working copy, add an extra Disc to the WMWare profile, by pointing it to the existing disc image used in the original image.  In essence the working copy now had 2 drives, which includes the disc from the original VM.
  4. Open command line on the host, CD to this path: c:\program files\vmware\vmware workstation.
  5. Run this command vmware-vdiskmanager -x 10GB "c:\my virtual machines\Win2003Server\Win2003Server.vmdk"
  6. In the blink of an eye, this will expand the disk.
  7. Now, start up the working copy of the OS you made in step 2.
  8. In Windows, open the Computer Management, and click on Disk Management
  9. You should now see the original space (4GB in my case), plus the extra unallocated (6GB) making a total of 10GB
  10. Open command line and run DISKPART, you now need to select and extend the partition to use the additional space.
  11. Type...
  12.  LIST VOLUME, from the list identify which volume is the one you need to extent (Volume 2 in my case).
  13.  SELECT VOLUME 2, will select your volume.
  14.  EXTEND, will now extend your partition to use the extra space.
  15. Flip back to Computer Management to see that your drive had grown to include the extra space.
  16. Shutdown the working copy.
  17. Start the original VMWare copy back up, and note that your primary partition has now grown!
  18. Windows will perform some updates upon restart, which will required you to restart again.
Posted by Simon Barratt at 04:29:24 PM | Add/View Comments (682)