Compact a Hyper-V VHD


  1. Posts : 13
    Windows 8.1 Pro
       #1

    Compact a Hyper-V VHD


    I have Hyper-V VM with the Windows 10 Pro Technical Preview Build 9926 as the guest, and Windows 8.1 Pro as the host OS. I've been running it for 3 months now, with at least 2 build updates. But I can't compact the VHD. The used drive space on the VM guest is 16.8 GB, while the size of the .vhdx is 24.8 GB. That is 8 GB space that could be removed.

    I've tried doing the compact within Hyper-V Manager. But I can't get the .vhdx file to shrink any more. I don't want to defrag the virtual drive from the guest OS because my host OS is running from a solid state drive.

    So how do I recover those 8 GB on my host machine?
      My Computer


  2. Posts : 3,257
    Windows 10 Pro
       #2

    You will probably have to defrag it. One defrag isn't going to kill your SSD.
      My Computer


  3. Posts : 11,247
    Windows / Linux : Arch Linux
       #3

    Hi there

    You could do it "The brute force way"

    1) From the VM run an image backup (Acronis etc). Backup to an external HDD.
    2) delete the original Vhd files
    3) Re-create a NEW VM but don't install the OS. Define disk size to what you want now.
    4) Recover the old image via Acronis - your VM should be able to boot from an ISO initially so no probs running a recovery. Use Macrium or similar if you don't have Acronis.

    Cheers
    jimbo
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 07:29.
Find Us




Windows 10 Forums