How to Shrink large Hyper-V VM

Posted by autrevo on Server Fault See other posts from Server Fault or by autrevo
Published on 2012-09-22T10:05:15Z Indexed on 2012/09/22 21:40 UTC
Read the original article Hit count: 399

Using Disk2VHD utility I converted my bare-metal OS into Hyper-V VHD - http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx

And I could obtain a huge 190GB VHD file. Apart from performance issues, this VHD worked fine as guest when hosted on Windows Server 200 R2, Hyper-V.

Having realized need to keeping only system files and application installations on VHD. I have deleted most of the junk data from this VHD and now it contains only 20-25 GB. But I am not able to shrink the VHD VM. Having done some research, I came to know, this as a limitation of .VHD files.

Subsequently I followed these two step using Edit Virtual Hard Wizard on Windows 2012 Box.

  1. Convert from VHD to VHDX (took close to 3 hrs.)
  2. Compact (Another 4 hrs.)

This did not ever shrink the VHDX either. Does Hyper-V does not provide proper support to handle large VHDs or VHDXs whose size are the range of 200GB.

© Server Fault or respective owner

Related posts about windows-server-2008-r2

Related posts about virtualization