Shrink it before you mount it

On January 21, 2010, in Virtualization, by

So I used the Disk2vhd tool to make a copy of an existing XP machine –

And I was thinking that because it was only 40 gigs in use that it would mount just fine.  Silly me forgot the issue where the Virtual PC won’t mount the drive if it’s greater than 127GB.  When you browse to have it set it up, it won’t mount the disk.  So what you do is go into your Windows 7 machine and just mount the vhd as an additional drive and shrink it down.

Note: Virtual PC supports a maximum virtual disk size of 127GB. If you create a VHD from a larger disk it will not be accessible from a Virtual PC VM.

So shrink down that machine drive before you move it to mount it in the virtual PC.



One Response to Shrink it before you mount it

  1. Jake says:

    If you don’t have a windows 7 PC then download

    Microsoft Virtual Server 2005 R2 SP1

    Then run run this batch file in the same folder as the setup.exe

    ===START BATCH===
    mkdir c:\tmp\vhd
    setup.exe /c /t c:\tmp\vhd
    cd /d “c:\tmp\vhd”
    msiexec /i “Virtual Server 2005 Install.msi” /qn ADDLOCAL=VHDMount
    ===END BATCH ===

    Now that the VHD too is installed you can use these shell extensions and compact the VHD easily.