Freigeben über


Compacting Virtual Hard Disks in Windows 8 / Windows Server 2012

Recently the “Ask the Core Team” blog did a great post about compacting a dynamically expanding virtual hard disk in Windows 8 / Windows Server 2012.  You should check out their full post for the details, but the summary is that you now need to manually mount the virtual hard disks in the management operating system prior to trying to compact it.

This is something that we used to do automatically for you – but we had reports of problems when we were attaching and removing virtual hard disks when the system administrator was not expecting it – so we have changed this to a more manual process.

Cheers,
Ben

Comments

  • Anonymous
    October 11, 2012
    Hi What is the difference between PowerShell Optimize-VHD and Diskpart compact vdisk ? Luciano

  • Anonymous
    October 13, 2012
    I have a windows 8 installed in my computer and I am not able to install a virtual machine on it.  I have no clue how to do it. I've already tried to download virtual PC 2007 and I did't work at all, Can anybody help me, please? Thanks a lot!

  • Anonymous
    October 25, 2012
    Daniella,            have you enabled the HyperV role on the Windows 8 pc? Thanks Echerontiusxp

  • Anonymous
    November 18, 2012
    Thank you for the link. I'm not seeing this documented anywhere in the technet library in the server 2012 -> hyper-v role section. Is this documented anywhere officially? The Server 2008 R2 -> Hyper-V documentation has a section on the edit disk wizard and what the different options do as expected. In Server 2012, as you point out, choosing the option "Compact" does nothing which is not expected and needs to be noted.

  • Anonymous
    April 18, 2013
    So... you're telling me I have to click and type and attach and detach something that I just used to right click and compact. Horse Poop. What a waste of administrator time.

  • Anonymous
    September 18, 2014
    This makes no sense. Just warn the user prior to doing it? Currently the "Compact" command just silently does nothing. Do you realise how much time everyone wastes to google for this?

  • Anonymous
    October 22, 2014
    I have to agree, this is non-intuitive.   I've just gone through the same process of trying to work out why the operation appears to be successful, leaves no errors in the logs, and yet..... does nothing that you'd expect. At the very least, I would expect the wizard to notify you of any pre-work that needs to be performed to enable the process to have an impact or to throw an error when the pre-work hasn't been done.