Increase VMware Workstation Virtual Disk Size

You can increase your HDD size of your workstation VMs using vmware-vdiskmanager.  vmware-vdiskmanager is a command line utility that will allow you to manage your virtual disk files.  One of the options allows you to expand your virtual disk.  There are two steps that need to be taken, the first is using the command line utility and the second is changing the formatting within your guest OS to be able to utilize the expanded space.

If you need to increase the size of your os/boot/system drive, you’ll need another working VM to mount the drive in and use DISKPART to extend it.

In this example, I’ll be changing the virtual disk size of a workstation VM from 16GB to 20GB, and it is the OS/BOOT/SYSTEM drive.

001

It would be highly advisable to back up your VM, by making a copy of it’s directory, before attempting to do this.  Just in case something goes wrong, it’s nice to have a copy.  Since I was increasing the size of the BOOT/SYSTEM drive, it was also nice to have the copied VM available to use for partitioning (DISKPART).

After backing up, yes I’m emphasizing that, open a command prompt and navigate to your VMware Workstation installation directory.  Mine is C:\Program Files\VMware\VMware Workstation, so I typed “cd” and the path above to change directories.

Then type the command in the following format:

\>vmware-vdiskmanager –x <new size> <path to vmdk file>

So my command looked like:

\>vmware-vdiskmanager –x 20GB “M:\Virtual Machines\Dev Domain Controller\Dev Domain Controller.vmdk”

Just to be clear, I put the path parameter in quotes due to the fact that it has spaces in the path and cmd.exe typically doesn’t like spaces.  Also of note is the fact that this cannot be done on a VM that has snapshots.  Yet another reason to backup.

002

After the utility completes, start the VM and log in.

As you can see from the screenshots below, the VM now has a 20GB HD but the OS is still only recognizing 16GB of space.

004

003

If you are attempting to extend the OS drive, you’ll need to follow the steps below for attaching it to another VM to handle the partitioning, or using some 3rd party partitioning software.  If you are increasing the size of a “data” drive, not the boot/system drive, you should be able to run the DISKPART commands in your original VM.

OS/BOOT/SYSTEM DRIVE ONLY: Shutdown the VM.  I then attached the vmdk to another VM, I did not have to disconnect it from the original VM to do this.  I connected the virtual drive to the backup copy that I made of my current VM.  After booting the backup VM with the increased-size HD attached, I assigned a drive letter, and I was able to run DISKPART to extend the space.  NOTE:  I HAD to assign a hard drive letter to the new drive before DISKPART would run successfully.

DISKPART Commands: The commands I ran are:

\>diskpart
DISKPART>list volume
DISKPART>select volume [the volume that you want to extend]
DISKPART>extend
DISKPART>list volume
DISKPART>exit
\>exit

I ran list volume a final time to confirm that extending worked properly.

008

OS/BOOT/SYSTEM DRIVE ONLY: After shutting down the backup VM, I removed the drive from that VM and started up the original VM.

As you can see in the following screenshot, the original VMs HD is now seen with its new capacity by the OS.

009

Good luck and keep on truckin’.

Something of note:  Microsoft states that DISKPART may not work on an OS/BOOT/SYSTEM drive in this article http://support.microsoft.com/kb/325590.  I tried multiple methods, including relocating the system page file and still could not get DISKPART to operate correctly.  I also downloaded a hotfix that, from the description, may have addressed the issue.  It did NOT.  The only method I was able to make work for the OS/BOOT/SYSTEM drive was mounting the vmdk in another VM.  If you have another method, using free utilities or DISKPART, please let me know.

About the author

My name is Clement DeLarge and I'm a Practice Team Lead for Application Development with EMC. When I'm not working, I'm raising my son, riding my motorcycle, playing with technology, or just about anything else that's fun that I come across.

Related Posts with Thumbnails

9 Responses to “Increase VMware Workstation Virtual Disk Size”

  1. Pete says:

    Nice, worked great.

  2. Mish says:

    Tried partition logic (free) http://partitionlogic.org.uk/index.html…it seemed to make an XP virtual machine aware of the extra space, but it kept treating the extra space as an extra unallocated partition instead of as a single contiguous primary partition

  3. Koketso says:

    Nice Solution.
    Was in a fix trying to figure out how to extend the boot partition.

  4. Craig Lowen says:

    I’ve never tried DISKPART.
    After you expand the physical size of the disk from 16GB to 20GB, GPARTED from http://gparted.sourceforge.net/ works quite nicely to re-partition the disk. You have to burn gparted to a CD then boot from the CD (the CD boots a LINUX kernel)

  5. Thanks for the heads ups on the freeware / open source products!

  6. sridhar says:

    thanks worked well

  7. Petker says:

    Don’t forget to defrag ……………

  8. kds says:

    Clement … thanks for the excellent post. We took several such posts and automated the extension process into a tool called fatvm @ http://www.gudgud.com/fatvm

    Would love to get your feedback.

  9. Gunther says:

    Found that after expanding the size of my disk (C: drive), the capacity was not increased. Windows only recognized the old size. The ‘Windows Disk Management’ showed Disk Capacity: 12GB, but ‘Disk 0′: 20GB.
    Had to use ‘extend filesystem’ instead of just ‘extend’ within Diskpart to get the additional 8GB

Leave a Response

Spam protection by WP Captcha-Free