I recently had to resize a VHD, and once again was lost in the many blog posts and vague documentation on the process. It seems that resizing disks is one of those things that sometimes works right out of the chute, and other times takes a dozen attempts using different processes. That said, I'm going to add to the slew of blog posts with this one- the process I used which worked first try on several different environments.

VMWare has a slick little standalone application called vCenter Converter that can help us do this. The converter's primary job is to help you virtualize your environment by converting physical hardware into virtual images; we're going to think a little bit outside the box here. One of the nice things about vCenter Converter is that it's free. You've got no licensing to worry about, so if you're using a lightweight app like the VMWare Player to just run your images and don't have the full blown utility of Workstation or Server behind your tasks, this solution will still work for you. In addition, if you're out in the field or at a client site with limited access to the host boxes, you can also use this method to resize a VHD isolated from the actual environment.We're essentially going to convert our existing VM to itself, and change the configuration along the way.

As we're going to be reading, writing and modifying the active VM along the way, you should power down the VM in question (if you haven't already). Be smart also, take a backup just in case; they're wonderful things to have. At the top of the vCenter Converter UI there's two buttons, "Convert Machine" and "Configure Machine". On a side note, depending on your environment you may be able to just hit "Configure Machine", select the VM and make your changes, but I ran into a lot of inconsistencies here. Sometimes it worked flawlessly, sometimes it errored out, and sometimes it just failed to even correctly load the source VM.

Due to that inconsistency I'm going to take you through the convert process which will see us making a new (modified) version of the existing VM, which we'll replace the old one with at the end. To begin we're going to hit "Convert Machine". On the Specify Source screen, select the appropriate source type and then "Browse" to the .vmx file for your machine. Click the "View source details..." link if you'd like to confirm the current configuration of the VM before continuing, or just hit "Next".

On the Specify Destination screen we're going to tell the converter where we want to put this new version of our VM. Note that the name and location have already been filled in (and should match the name and path of the VM we previously selected). Change the location by specifying a directory (ie: "/resized") at the end of the supplied location; this puts our new VM in a subfolder of the current one. Make sure you don't change the VMName, so we can just overwrite the old version with the new one when we're done. When you're ready, hit "Next".

The View/Edit Options screen will show you the configuration of the VM. This is where we can make our change to the VHD size (by clicking "Edit" in the "Data to copy" section). Set the data copy type to "Select volumes to copy", check the applicable drives, and set the target size to "<Type Size in GB>" so you can specify your own value. This will resize the selected volume to this new size upon conversion. Your NIC settings will match the source VM by default, so avoid playing with them. When you're finished making your changes, hit "Next".

The Ready to Complete screen gives you a summary of the conversion that's about to take place. Verify everything (including your locations) one last time, then hit "Finish" to run the conversion. Depending on the size of your VM and the available resources of the client, this can take a little bit of time. When it's completed, it's not a bad idea to load the image in VMWare Player as a standalone system just to make sure there is no hiccups with the conversion and the machine boots correctly. Once you're happy with that, shut it down again, copy it over your original, then boot it back up in Workstation or Server.