I have domain controller in my lab running on Virtual PC 2007 whose boot disk was running out of space. It was originally formatted as a dynamic expanding disk with a maximum size of 16 Gb, and had reached its capacity. The virtual machine is also running OpsMgr and SQL 2005.
I tried using VHDresizer available at http://vmtoolkit.com/files/folders/converters/entry87.aspx but could not get it to work.
VHDresizer is slightly annoying for two reasons:
- You have to register to download the product
- It took hours, then error’ed out at the very end
Here is how I cloned the boot partition to a larger VHD:
- Created a new VHD with a maximum size of 36 Gb using the VHD wizard in Virtual PC 2007 and made note of the location of the file.
- Shut down the virtual PC that was running out of space.
- Back up the original boot VHD
- In ANOTHER virtual PC running server 2003, I assigned the 16Gb boot drive as the second hard drive (I will refer to this drive as the source)
- Assigned the new 36Gb drive as the third drive on the second VPC (I will refer to this drive as the destination)
- Using Disk Management, I assigned letter X: to the source drive
- Using Disk Management I assigned letter Y: to the destination drive
- I formatted the destination drive Y: with NTFS (quick). Make sure you don’t format the source.
- I downloaded the Windows 2003 Resource Kit, which contains robocopy, and installed it on the second VPC http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
- I copied the source to the destination with the following command, which took about an hour
robocopy X:\ Y:\ /E /COPYALL /R:5
- There were 3 copy errors that I ignored (it didnt seems to cause problems–but don’t quote me).
- In Disk Management, I marked the destination drive as Active
- Shut down the second VPC
- Removed the vhd’s from the second VPC
- I edited the original VPC .vmc file in notepad and replaced references of the source_drive.vhd with references to the destination_drive.vhd
- I started the original VPC and everything worked (much to my surprise) I thought there would be issues with the MBR, or with the server being a Domain Controller, but everything worked fine.