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

[ad#Google Adsense-1]

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 FilesVMwareVMware 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 MachinesDev Domain ControllerDev 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.

[ad#Post Block Ad Right]

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.

Advertisements

10 thoughts on “Increase VMware Workstation Virtual Disk Size”

  1. 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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s