Microsoft’s Hyper V has really shaken the virtual machine industry up with it’s free virtualisation technology. The Hyper V/Virtual Server/Virtual PC product line is many things to many people, but as it is a growing technology, there are some things that the product can not do: Downsizing a VHD is one of those things – But there is an easy solution.
I use the Hyper V product line on a daily basis, and can say that while there are some differences between the products, that Hyper V is a great technology. Yes, Microsoft does have an innate ability to copy its competitors, play catch up and overtake – however i believe that the Hyper V technology you see today is only the beginning of great things.
Hyper V makes it really easy to scale up the size of a VHD – this is a common, everyday occurrence for a virtual machine, but sometimes the opposite is needed as well: Downsizing. Maybe you want to split your partitions, and shrink a VHD/drive, who knows?
You mean Microsoft forgot to add a pretty obvious feature? Wow… I’m blown away, is this the first time?
As usual, if the closed source community doesn’t do something, the open source community steps in and fills the gap. In this case, the gap is filled by VHD Resizer. Developed by the vmToolkit team, this is a great multi-purpose tool for VHD file/partition operations.
It allows you to:
- Downsize/Upsize a VHD partition
- Convert a VHD from Dynamic to Fixed disks and back again (the second part is another thing that the default Hyper V installation doesn’t seem to allow… yep i know…
All for free, “as in beer”…
Steps to downsize your VHD:
- Use partition software inside the virtual machine to downsize the partition without losing data (I used Easus Partition Manager, but there are plenty out there - http://www.easeus.com/)
- Shut down your virtual machine
- Consolidate all your snapshots (This has to be done, otherwise your VM won’t be stored in a single VHD)
- Load up VHD resizer and point it at your VHD
- Set the new size if your VHD (this has to be at least 1mb bigger than the partition sizes inside) and new filename for your VHD
- Let her rip! (this may take a long time depending on your VHD sizes, have patience…)