15. December 2008 08:35
Technorati Tags: VMWare Server
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:
|Lists all of the disks in the system
|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)!