Reduce max size of dynamic VHD


  • Hi,

    I'm using the XPMode in Windows 7 to create a virtual PC.  I've got a "base" image setup in which I put in all the Windows updates and other "core" programs that are needed, then have created a few variants off from this one, depending on user needs, by using the Differencing option.

    The problem comes about in trying to convert these variants into dynamic/fixed VHDs, as the Base VHD has a HD size of 130 Gb... which my HD no longer has.

    I've read several topics/posts on this and the most promising way I've been able to find so far is using a combination of mounting the VHD into the Windows 7 Disk management console, shrink the volume from there, then use something called VHDResizer tool to finish the job.  Problem is, all links I can find for this tool are dead.

    Can anyone help?

    Tuesday, August 13, 2013 6:46 PM


  • Gotcha.

    Simplest solution for what you want is to get a partition manager and run it inside of the VM.  Set the internal partition  to the size you want.  That will limit the growth without needing to mess with the VHD.

    Tuesday, August 20, 2013 4:44 PM

All replies

  • Hi,

    From your description, I think the ImageX tool may be a best choice for you.

    Mount the VHD, run ImageX to convert the mounted volume to a WIM image, then create a new VHD and use ImageX to apply the image to the right sized VHD.

    If you want to know more detail steps, please refer to the webpages below:


    Resizing a Microsoft Virtual Hard Disk (VHD)

    ImageX Command-Line Options

    NOTE This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.



    Friday, August 16, 2013 12:15 AM
  • If you convert your VHD to dynamic, it really doesn't matter the size since it will start at the size of the data on the disk and grow as necessary.

    If you're running low on disk space, an easy low tech solution is to use NTFS compression on the VHD.  That generally will reduce the size on the disk by 40% or more.

    Friday, August 16, 2013 1:40 AM
  • Yolanda,

    Hmm, I think this might work.  Dunno... I have to merge the VHDs to a separate HD as I'm out of room on my PC.  Once I get one to successfully merge, I'll test.  I think... for some reason I was trying to get the actual merge process to merge into a smaller VHD...?  I'm not sure why I thought that was possible now.  I might've been tired then....  But either way, I want to be able to reduce the final product's size, so I will use this.  Thank you.


    Let me try explain the situation better.... (forgive me, I'm bad at conveying stuff in words... I don't mean the following to come of sounding rude or anything, I'm just trying to be clear).

    Ok, XP Mode has the "Parent" drive located at "C:\Program Files\Windows XP Mode\Windows XP Mode base.vhd".  Best as I can tell, this is a dynamic disk with a max size (in my case) of 130Gb.  If it is at all possible, I'd like to avoid editing this one.

    I then let the system create the "usable" XP Mode VHD for me.  It creates it as a differencing drive based off the one above.  This one I've installed all the Windows updates and the "core" programs that are needed.

    Now, I manually create new VHDs (plural), differencing based on the one above.  These ones get the programs related specific to the user group (ie, HR vs Customer Service).

    Finally, I want to (essentially) "detach" these new VHDs from their parent drive and make them standalone... so I'm not having to transfer multiple VHDs to each client machine.  Problem is, in doing the "Merge" operation available, it's trying to create a fixed sized VHD of... 130Gb.  Which, of course, I no longer have.

    I think I've found a solution here, as I've gotten my hands on an external HD with enough room.  We'll see how that goes.

    Yes, converting that fixed VHD to dynamic will reduce the actual space taken, but I don't want to leave these at the max capacity of 130Gb.  These are ultimately going to be transferred to other PCs and I'd rather leave them as fixed so they are already taking all the space they need and there is absolutely no risk of issues being caused by them filling up their HDs (or for some stupid reason, the VHD).

    • Edited by FotS Friday, August 16, 2013 5:58 PM
    Friday, August 16, 2013 5:56 PM
  • Yolanda,

    Thank you for the suggestion, but it doesn't work.  I just end up with a non-working VHD:

    Tuesday, August 20, 2013 2:35 PM
  • Gotcha.

    Simplest solution for what you want is to get a partition manager and run it inside of the VM.  Set the internal partition  to the size you want.  That will limit the growth without needing to mess with the VHD.

    Tuesday, August 20, 2013 4:44 PM
  • True.  I'll see what I can find and give it a shot.
    Wednesday, August 21, 2013 2:54 PM