Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
One of the new features in Windows Server 2012 R2 and Windows 8.1 is the ability to resize a virtual machines virtual hard disk while it is running. In order to pull this off – all you need is a virtual machine with a .VHDX file attached to a SCSI controller (this functionality is not supported with .VHD files or IDE controllers).
Once you have done this you simply need to open the Edit Virtual Hard Disk wizard. Then you should:
Once you have done this, we will increase the size of the virtual hard disk. However, we will not do anything with the partitioning on the virtual hard disk. So at this point in time you will have a bunch of extra, unused space at the end of the virtual hard disk. To take advantage of it you will need to login to the guest operating system and do something with it. You can either create a new partition – or extend an existing one. Extending a partition under Windows is simple enough. You just need to:
You can also use PowerShell in the parent partition to expand a virtual hard disk, like this:
Get-VM "Windows Server - Resize" | Get-VMHardDiskDrive -ControllerType SCSI | Resize-VHD -SizeBytes 200GB
Note, this is the same command that you use whether the virtual machine is running or not. Also note that you still need to login to the guest operating system to take advantage of the extra space.
Cheers,
Ben
Anonymous
January 28, 2014
Ben, shrinking is not possible in this way? The virtual machine has to be turned off?
Anonymous
April 05, 2014
The comment has been removed
Anonymous
July 23, 2015
Thanks so much. This is the only article (that I found so far, and I searched...) that mention to use the Disk Management in the guest O.S to claim this new space, otherwise the current file size capacity stays the same.
Anonymous
March 07, 2017
There's no need to login to the guest OS, just typeGet-Volume E -cimsession GuestHostname | Resize-Partition -size (200gb)
Anonymous
August 18, 2017
The comment has been removed
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in