Update: There is a much easier way now to resize a virtual disk: Expand a virtual VMware disk with VMware Converter. Also check out this article about my first impressions of VMware Converter 3.0 final.

Latest posts by Michael Pietroforte (see all)

Today, my Windows XP test system running in a virtual machine under VMware Workstation 5.5 complained that there is not enough space anymore on the system partition. I thought it can't be too complicated to resize a virtual disk. After all, it is only virtual. I hoped to solve this problem within 5 minutes or so. Well, here's how it went:

I was disappointed the first time when I realized that one can't change the size of a virtual disk with the VMware user interface. So I googled this problem, hoping to find an easy-to-use tool. What I found out was that the virtual disk can be resized on the command line using the VMware Virtual Disk Manager Utility. The documentation about this feature on the web is for VMware Workstation 4.5, but it also works with version 5.5 and also for VMware GSX Server.

The command to expand a virtual disk looks like this:

vmware-vdiskmanager -x 10GB myDisk.vmdk

The new size of the virtual Disk will be 10 GB in this example. myDisk.vmdk is the file of the virtual disk on the host system. Usually this file won't be located in the same folder as vmware.exe. Thus, you have to specify the full path to the vmdk file. Don't forget to enclose the path in quotation marks, if the folder names contain spaces. You can find vmware.exe in the VMware installation folder.

My second disappointment was that one can't expand a virtual disk if it contains snapshots. With a heavy heart, I deleted all my snapshots of this virtual machine. I was surprised how much time VMware needed for this. The size of the disk was 4 GB and I had three snapshots. I didn't measure the time, but it must have taken at least 15 minutes. This is amazing considering that it only takes a few seconds to create a snapshot.

Finally, I was able to expand the virtual disk. The virtual disk manager needed several minutes to enlarge the virtual disk to a size of 10 GB. Of course, you can only do this after you shut down the virtual machine. It is recommended that you backup the vmdk file first, just in case something goes wrong.

I was disappointed the third time when the Virtual Disk Management Utility eventually finished its task. Expanding the virtual disk was successful, but the tool suggested using a third-party tool to resize the partitions within the virtual disk. So basically I was back to where I started. I, now, had a bigger virtual disk, but the system partition of my virtual machine still remained the same size.

Luckily, I remembered that I have an old version of Partition Magic. Since my virtual disk was full, I had to create a second virtual disk on this virtual machine first to get some free space for Partition Magic. I suppose, you know that one can add a new virtual disk by changing the virtual machine settings. Partition Magic 7.0 had no problems enlarging the system partition on my VMware virtual disk.

Subscribe to 4sysops newsletter!

All in all, it took me about an hour to resize my virtual disk, including the search for a solution for my problem and the time to find my old Partition Magic. I guess I was a bit too optimistic with my five minutes estimation. I hope that future versions of VMware will offer more comfort here.

0
73 Comments
  1. Slavi 12 years ago

    I am receiving a strange error:
    Diskpart failed to extend the volume.
    Please make sure the volume is valid for extending...

    0

  2. Kevin 12 years ago

    vdv is awesome! I was getting that same error and now I understand why. Now that I understand the reason, I am glad for it. In the past, if you forgot to clean out your snapshots before expanding a disk, you would revert to an earlier snapshot. That was really bad! It would be nice if the error message said 'you must clean out your snap shots' instead of 'general error' - but hay, I will take it!

    0

  3. Petr 12 years ago

    You saved a lot time. Thanks for the nice manual - it went smoothly on my laptop.

    0

  4. R1440_CO 12 years ago

    If you are using Windows 2008, you can simply edit the disk and make it larger in VMWare.

    Start the server, go into disk management, and extend the C volume to the extra disk! Done. One nice thing about 2008 server.

    0

  5. Paul Evans 12 years ago

    Thanks for an insightful post, Michael. Judging by the activity on the comments, you have seeded a lively community around this topic.

    You should download and try fatVM http://www.gudgud.com/fatvm

    fatVM is a reliable, robust, and safe, 1-click solution for extending the C drive of your VMware Fusion or Workstation virtual disk that is becoming full.
    * It provides a simple, intuitive, interface and a reliable process that hides the technical complexity of extending a virtual disk.
    * It is robust because it can extend virtual disks having snapshots and clones.
    * It is safe because it preserves your original disk, which remains available to you for when the need ever arises.

    Thanks

    0

  6. Stefano Frassi 12 years ago

    Thanks for your post, i resolved my disk full problem with these sw: VMware Virtual Disk Manager Utility (resize the vmdk) and partition wizard (resize my OS partition)

    ps: my config:
    vmware Server console 1.0.1 and vmdk os windows 2000 pro

    Thanks

    0

  7. svdb 11 years ago

    Thanks!

    vmware-vdiskmanager works great.

    0

  8. Robert 11 years ago

    After using the vmware script to "Grod" the virtual disks in my GSX environment, I used the built in "Diskpart" utility to extend the non system volumes.

    0

  9. Robert 11 years ago

    sorry for the fat finger, meant to type grow, not grod!

    0

  10. Luis 11 years ago

    Thanks, saved me a lot of time.

    0

  11. Chaan 11 years ago

    the vmware cmd line tool is a joke. The Aomei Partition assistant 3.0 has a disk extender tool that does it in seconds. Tried all sorts of tools before this one did exactly what I wanted it to which was extend the system partition without data loss, just drag the slider to have unallocated extended and et viola!!

    0

  12. Logi 11 years ago

    Guys - This is very simple.

    First shutdown the machine, edit the virtual disk to be larger. Start the machine, go into computer management under administrative tools, right click on the volume you want to extend, press "extend", follow the instructions and you're done in 5 minutes.

    0

  13. Jimi Sweden 10 years ago

    Thanks,

    To clarify the Comment by R1440_CO

    If you edit disksize in ESXi when the windows 2008 server is running you will have to reboot the windows 2008 server before you can extend the volume in "Disk Management"

    //Jimi

    0

  14. vogelbsj 10 years ago

    Logi
    I run virtual machine for XP Pro and have resized virtual disk.
    When I run admin tools I see the extra disk as a separate volume and don't see the extend option on either the whole disk or individual volumes.

    any thoughts?

    +1

  15. Genaro Giangan 10 years ago

    You can't expand system disk on your VM if you have snapshots. It will grayed out the Disk provisioning option. Delete all the snapshots and it all works!

    +1

  16. IVA Advice 9 years ago

    Problem solved, I also removed all snapshots

    +1

Leave a reply

Please enclose code in pre tags

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2021

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account