You are here: How to increase the size of a .VHD virtual disk (for Microsoft Virtual PC 2007)

How to increase the size of a .VHD virtual disk (for Microsoft Virtual PC 2007)

This is done in two steps.
First you increase the size of the virtual disk.
Then you increase the size of the partition inside the disk.

1) Download VHD Resizer (previously known as VHD expander) from
http://vmtoolkit.com/files/folders/converters/entry87.aspx
This is a free utility.

2) Run it from a computer that has access to the VHD file you want to expand. Select the VHD file and type a new filename for the enlarged VHD. Do not delete the original file you will need for another step.

If you boot the new bigger disk, you will see that the partition size remained the same. There is however additional unpartitioned space in the disk. You will need to expand the partition now.

3) Mount the new image as second disk in a virtual PC that has DiskPart (e.g. win XP) and start the virtual PC.
You will use the DiskPart utility of windows to expand the partition. Exellent illustrated instructions here:
http://kb.dutchalps.com/microsoftvirtualpc.htm

4) Now try to boot the resized VHD image.
You might see the error:
"A disk read error occurred Press Ctrl+Alt+Del to restart"
When disk capacity is changed and crosses one the following boundaries - 528Mb, 1Gb, 2Gb, 4Gb, change in the disk geometry may cause the NTFS boot sector to become invalid.
Fortunately, it can be rebuilt using the Testdisk utility.
http://www.xtralogic.com/testdisk_rebuild_bootsector.shtml

5) After these steps, you will be able to boot the image.
Personally, I arrived at this stage in a new error. As soon as the login screen of windows appeared, I was getting an error that the windows paging file is zero or too small, and I could not start windows. I did not find a way to bypass this error and I reinstalled windows over the previous installation

Comments

Increase the VHD it with acronis

There is a more easy way to do this, that needs less expertise and less thought.

1) Using the new disk wizard of Virtual PC create a new bigger virtual disk.

2) Mount this disk as a 2nd or 3rd disk to the virtual machine that has the small disk you want to expand

3) Mount an acronis ISO bootable image and boot the virtual PC

4) Use acronis to clone the small disk to the large disk

5) Shut down the virtual PC, swap the small disk with the new bigger disk and ....

6) You are done !!

size boundaries

When expanding the VHD file with VHD Resizer, try NOT to cross the size boundaries mentioned. I was not able to fix the problems after crossing the boundaries.