Expand VHD, then extend the volume
Play with a quite old virtual disk image, after a couple Windows update, the operating system starts complaining. I have to expand the disk, it’s 4GB at the time, but how?
First, I found this tool on the Internet –VHD Resizer. Here is the website http://vmtoolkit.com/, and you have to sign up to download the tool. But it’s free, which is better than other tools I found on the Internet.
Install and run the VHD Resizer is pretty straight forward. What you need to do is just locate the old VHD file and give a name of new VHD file. After the resizing, you get bigger virtual hard disk. This VHD includes your original partition and an expanded un-allocated partition. Next step, you need to use diskpart or other tools to extend the original partition.
Since the system volume cannot extend itself, I put the new VHD under another VM as secondary disk and extended it from there (or you can use vhdmount command line). Now I connected it back and got a 10GB VHD.
Here are some useful articles: