Expand the System Drive of a VMWare Virtual Machine

.NET Musings

Wandering thoughts of a developer, architect, speaker, and trainer


Expand the System Drive of a VMWare Virtual Machine

Technorati Tags:

There are two main steps in expanding a VMWare hard drive for a Windows based Virtual Machine. The first is to expand disk in the VMWare configuration. That is the easy part:

vmware-vdiskmanager.exe -x 15GB TargetDisk.vmdk

Next, Windows needs to expand the partition. The key command to use is DiskPart. However, this only works on non-system drives. So, if your drive is the system drive, remove the drive from the VM (make sure that the VM is shut down (not suspended). If you use multiple hard drives on your VMs (like I do), you will want to remove all of them so when you add them back they will be in the correct order. This is optional, but I am a bit anal sometimes.

Add the disk as an extra disk on another VM as an extra drive. Start this second VM, and run DiskPart. This puts you in the command shell for DiskPart Commands:

Command Description
list disk Lists all of the disks in the system
list volume Lists all of the volums in the system
select disk [x] Makes x the target disk
select volume [x] Makes x the target volume
extend [disk=x] [size=y] Extend disk x by y megabytes
NOTE: y is the size (in MB) to add to th edrive, not the resulting size
If size is left off, disk x is extended to use all available space
If disk is left off, the active disk (via the select command) is extended


After this is completed, power down your auxiliary VM and remove the hard drive. Add all of your hard drives back into your VM, and you are back in business with the larger system drive.


Happy coding (and VMing)!

Comments (2) -

You can do it live on a Windows Server 2008. Only have to set the new disk size on the VM Disk. After that, in the Windows 2008 Disk Management Console, Re-scan disks and Choose Extend on your System Drive et voilà !

Great post, saved my VM!

Comments are closed
Managed Windows Shared Hosting by OrcsWeb