Resizing A Virtual PC Hard Drive

Holy Diver...

The other day I was working on one of my Virtual PC demo images, when I noticed I was running out of disk space. When I originally created the Virtual Hard Drive (.VHD) I just accepted the default size of 16GB without thinking, but more and more often I find I need to install other products such as SharePoint Server, BizTalk Server, PerformancePoint Server, which inevitably require extra disk space.

After a little "liveling" (what is the equivalent of "googling"?) I found a great utility called VHD Resizer, which does exactly what its name suggests. Once I resized the drive to 32GB, I started up the image but found that my C: drive was still limited to 16GB. Using the Windows Disk Management tool, showed that disk had indeed been resized, leaving me with my original 16GB partition plus 16GB of unallocated space.

I tried to extend the partition using the DISKPART.EXE command line utility, but I quickly found out that you can't extend a boot partition. However, this morning I was chatting with Scott Vessey, a friend who works for a VMWare training partner Magirus, who shared a trick to get this to work.

  1. Use VHD Resizer to create a new .VHD file from the original Virtual Machine .VHD file

  2. Add the new .VHD as a second drive to the Virtual Machine

  3. Start the Virtual Machine, run the Disk Management tool and rescan the drives to enable Windows to see this as an NTFS partition.

    Disk Management 1 

  4. Start a command prompt and run "diskpart.exe". Select the correct volume and extend it.


  5. Refresh the Disk Management tool and you should now see the re-sized partition.

    Disk Management 2 

  6. Shut down the Virtual Machine and re-configure it to use the newly re-sized .VHD file as the primary disk.

This posting is provided "AS IS" with no warranties, and confers no rights.

Laughing Boy

Comments (3)

  1. Top Joel’s Top 100 SharePoint Blogs Office SharePoint Server for Internet Sites Licensing von S. Harbar

  2. Top Joel’s Top 100 SharePoint Blogs Office SharePoint Server for Internet Sites Licensing von S. Harbar

  3. Kevin J Turner says:

    I tried the steps above but they did not work for me. I get the error message when I try to extend:

    The volume you have selected may not be extended.

    Please select another volume and try again.

    My setup is slightly different than this blog entry’s demonstration setup: my VHD has two volumes (drive C and D). After running VHDResize, and adding the VHD to the VM, this is my diskpart list volume output (I am not showing all columns):

    Volume ###  Ltr  Label        Fs     Type

    ———-  —  ———–  —–  ———

    Volume 0     E   VSTFD1       CDFS   DVD-ROM

    Volume 1     C                NTFS   Partition

    Volume 2     D   development  NTFS   Partition

    Volume 3     F                NTFS   Partition

    Volume 4     G   development  NTFS   Partition

    In diskpart I typed ‘select volume 3’ followed by ‘extend’ and I got the error message above.

    Any suggestions?

Skip to main content