[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More


How to Increase VMWare Hard Disk Size?

Published on
7,014 Points
1 Endorsement
Last Modified:
How to Increase VMWare Hard Disk Size?
(Taken from my web log: http://blog.mrt-web.com)

I've been playing with virtual machines and testing some odd things that can not be easily tested on a real computer, suddenly I come across to a situation that my virtual machine's hard disk size needed to be increased.

It is one simple command! You just need to go where you installed VMWare WorkStation, there is a file named: vmware-vdiskmanager.exe

You just need to open a command window and run:

vmware-vdiskmanager.exe -x sizeGB virtualDiskFile.vmdk

That's all.

Expert Comment

Some considerations worthy of mention here is that if this is the system disk or a MFT Based disk then you will still need to increase the partition sizes to enable the extra space for usability.

Partition Magic / Diskpart / Easus Partition Manager
for example.

If the disk is dynamic then you can extend the volume however this is not a solution viable on boot disks.

If you do not have any of the above and you want to do it for free, you can download vmconverter and do a V2V conversion and resize the disks in the advanced settings for the hard disks.  These geometric changes will get transferred over into the FAT/MFT Tables and you can just convert and go with no additional steps.


Expert Comment

I see this is WorkStation that is used here, but just adding some  info about vSphere if it has any value:

In VMWare Sphere, after expanding the disk via the vSphere Client on the virtual machine, you can expan the disk inside the operating system with extpart.exe if the operatig system is Windows 2003(any version):

This goes for system partitions, dynamic disks, or basic disks.

If you are dealing with a Windows 2008 or Windows 2012 server, you simply use disk manager that comes standard with the operating system and expand the partition in need by right clicking it and choose expand/extend. If any error occurs, or you are not seeing the newly available disk space, rightclick diskmanager and choose to rescan to see if that resolves the problem.

If you are automating extending  of disk drives in a large vSphere environment, you can use the following powershell script function that needs PowerCli installed where it is run from:

function ExtendVMWareDisk {
	param([Parameter(Mandatory=$True)] [string] $vCenterHost, 
		[Parameter(Mandatory=$True)] [string] $vCenterUser, 
		[Parameter(Mandatory=$True)] [string] $vCenterPass,		
		[Parameter(Mandatory=$True)] [string] $localUser,
		[Parameter(Mandatory=$True)] [string] $localPassword,
		[Parameter(Mandatory=$True)] [string] $vmname,
		[Parameter(Mandatory=$True)] [int] $diskNo,
		[Parameter(Mandatory=$True)] [int] $sizeGB
	if(-not (Get-PSSnapin VMware.VimAutomation.Core 2> $NULL)) { 
		if ($host.Name -eq "ConsoleHost") {Write-Host -ForeGroundColor Yellow "Adding VMWare Snapin"}
		Add-PSSnapin VMware.VimAutomation.Core 
	function ConnectVIServer([string]$vCenterHost, [string]$vCenterUser, [string]$vCenterPass) {
		#The Following is compatible with version 5.1 of powercli: 
		if ($host.Name -eq "ConsoleHost") {Write-Host -ForeGroundColor Yellow "Connecting to vCenter: $vCenterHost"}
		Set-PowerCLIConfiguration -DefaultVIServerMode Single -InvalidCertificateAction Ignore -WebOperationTimeoutSeconds -1 -confirm:$false
		Connect-VIServer -Server $vCenterHost -User $vCenterUser -Password $vCenterPass

	ConnectVIServer $vCenterHost $vCenterUser $vCenterPass
	if ($host.Name -eq "ConsoleHost") {Write-Host -ForeGroundColor Yellow "Creating local logon credentials.."}
	$password = ConvertTo-SecureString -String $localPassword -AsPlainText -Force
	$credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $localUser, $password
	$props = @{
		errorID = 0;
	$diskName = "Hard disk {0}" -f $diskNo
	if ($host.Name -eq "ConsoleHost") {Write-Host -ForeGroundColor Yellow "Extending '$diskName' to $sizeGB GB on '$vmname'"}
	try {
		if($sizeGB -gt (Get-HardDisk $vmname | where {$_.Name -eq $diskName}).CapacityGB) {
			Get-HardDisk $vmname | where {$_.Name -eq $diskName} | Set-HardDisk -CapacityGB $sizeGB -ResizeGuestPartition -GuestCredential $credentials -Confirm:$false
	} catch {
		$props["errorID"] = 1;
		$props.Add("failedItem", $_.Exception.ItemName);
		$props.Add("errorMessage", @("ERROR: 1 Could not extend '$diskName' to $sizeGB GB on '$vmname': " + $_.Exception.Message));
		return $props
	return $props

Open in new window


Featured Post

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Join & Write a Comment

Teach the user how to install ESXi 5.5 and configure the management network System Requirements: ESXi Installation:  Management Network Configuration: Management Network Testing:
This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month