Is your virtual harddrive running low on free disk space? I have created many 20-30 GB VHD’s (accidentally or was it even some kind of default in Virtual PC 2007?) to contain Windows Server 2008, MOSS 2007 and so on… Sooner or later the hard drive is running out of space just when you’d need to install Infopath or Visio (Insert anything important here that currently stops you from doing your job) or something like that.
There is a small but very usefull program from vmToolkit called VHD Resizer. The tool can be downloaded freely, but requires registration. The tool creates exact copy of your existing VHD-file and at the sametime you can expand your VHD file to maximum of 127GB (VHDResizer seems that it could make it bigger, but Virtual PC said maximum is 127GB).
- Open up VHD Resizer and browse to your VHD-file. Enter folder and filename for the new harddrive. Click Resize to start.

- Fire up the virtual machine with the new larger harddrive and start Disk management tool (either from computer management or WIN+R and Diskmgmt.msc)
- Select the partition that you want to extend and right click on it. Select Extend.

- If you want to use the whole disk for the one partiotion, just click next next next and finish. You are all done!
Notice! This works only for Vista/Windows7/Server2008, with earlier OS’s you need to use Diskpart.exe from the command line. Command line syntax for that can be found here. The basic syntax is like this:
extend [size=n] [disk=n] [noerr]
disk=n : The dynamic disk on which to extend the volume. An amount of space equal to size=n is allocated on the disk. If no disk is specified, the volume is extended on the current disk.
noerr : For scripting only. When an error is encountered, specifies that DiskPart continue to process commands as if the error did not occur. Without the noerr parameter, an error causes DiskPart to exit with an error code.