Expand/increase virtual disk size for Hyper-V

Updated on: November 16, 2019

This article introduces how to increase/expand disk size of Hyper-V virtual machine without losing data, and how to increase space of virtual partition after expanding disk.

Applies To: Windows 10, Windows Server 2008, Windows Server 2012, Windows Server 2016 and Windows Server 2019.

Nowadays, many people use virtual machines such as Hyper-V and VMware. Comparing with physical computers, virtual machines have advantages such as creating snapshot or checkpoint, easily add, remove and edit simulated hardware. In addition, you can expand storage capacity fast and easily.

The size of a physical hard disk is fixed, so when it is getting full, you have to clone or back up and restore to another larger disk. It costs such a long time especially when this disk is very large. But to virtual hard disk in Hyper-V or VMware virtual machine, you can increase size of the virtual disk without losing data in several minutes.

After expanding a virtual disk, additional space will be shown as Unallocated on the end of this disk. If you want to increase disk space of the left contiguous partition with the additional Unallocated space, Windows has native Disk Management to help you. However, if you want to add this Unallocated space to any nonadjacent volume, you should run third party software to move Unallocated space.

This article only shows how to increase size of virtual hard disk and partition in Hyper-V.

Common questions regarding expanding Hyper-V disk

Q1. Any difference when increasing disk size of VHD and VHDX?

A: The method to expand either type of virtual disk is the same, but you can't expand VHD disk online, SCSI controller VHDX disks can be increased online.

Q2. Any difference with Hyper-V Generation 1 and 2?

A: No, it doesn't matter if you use Hyper-V Generation 1 or 2, there is no difference while resizing and expanding virtual disk.

Q3. Should I connect virtual disk to virtual machine before expanding?

A: No, it doesn't matter if the virtual disk is connected or not, but you should make sure whether this VHD/VHDX virtual disk is located.

Q4. Can I expand system virtual disk in Hyper-V online (without turning off virtual machine)?

A: Whether Hyper-V virtual disk can be expanded is not depending on with or without Operating System, VHD disk with either IDE or SCSI controller can't be expanded online. VHDX with IDE controller can't be increased online. VHDX with SCSI controller can be expanded online no matter it is system disk or not.

How to check the type and controller of your virtual disk:

Open Hyper-V Manager, select virtual machine, then click Settings on the right Actions panel.

Hyper-V Settings

On the left panel of next window, you'll see the hard drive(s) listed below IDE and (or) SCSI Controller with .vhd or .vhdx

Virtual disk type

How to expand virtual disk size in Hyper-V

There are two common ways to expand Hyper-V virtual hard disk with PowerShell and Hyper-V Manager.

No matter which way, firstly, you should check if the virtual machine is saved or has checkpoints. If yes, none of its disks can be expanded. In that case, delete Saved State and Checkpoint(s) before expanding any types of Hyper-V virtual disk.

Secondly, if the virtual disk that you want to grow capacity is VHD (both IDE and SCSI controller) or VHDX with IDE controller, you should turn off the virtual machine before expanding.

Way 1: How to increase Hyper-V virtual disk size with PowerShell

It is the easiest and fastest way, however, you should locate the position of VHD/VHDX and use absolute path with ''.

Steps to expand VHD/VHDX virtual disk space with PowerShell:

  1. Open PowerShell from Quick Launch bar or Start menu according to your own Operating System.
  2. Type Resize-VHD -Path 'E:\yourown.vhdx' -SizeBytes 200gb

Expand Hyper-V disk

200gb here means the final size after expanding, not adding 200GB.

Way 2: How to expand virtual disk size with Hyper-V Manager

Hyper-V Manager has the option to edit disk no matter the VHD/VHDX disk is connected to this virtual machine or not.

Steps to increase size of Hyper-V virtual disk in Windows 10 or Server 2008/2012/2016/2019:

1. Open Hyper-V Manager, click the host in left panel, then click Edit Disk in Actions panel on the right.

Edit disk

2. Simply click Next in the pop-up Edit Virtual Hard Disk Wizard window.

Edit Wizard

3. Click Browse on the top to locate your VHD/VHDX virtual disk file and the click Next.

Locate disk

4. Select Expand option and click Next. (If you did not turn off virtual machine, there's only Expand option.)

Select Expand

5. Enter an amount of new size and the click Next.

Enter size

6. Review the expanding operation and click Finish to proceed.

Select Expand

In a short while, the system disk in my Hyper-V virtual Server 2012 is increased from 120GB to 160GB, additional 40GB disk space is shown as Unallocated on the end.

Original size

New disk size

How to increase disk space of virtual partition

If you want to extend the left contiguous partition (here is D:) with the additional Unallocated space, you can achieve with Windows native Disk Management tool. However, there are 2 preconditions:

Follow the steps to expand virtual partition D in Disk Management if your partition meets the requirements:

  1. Right this partition in Disk Management and select Extend Volume.
  2. Simply click Next till Finish in the pop-up Extend Volume Wizard window.

If you want to increase disk space of the non-contiguous system partition C, you need third party software to move Unallocated space behind C drive.

Download NIUBI Partition Editor and follow the steps below:

  1. Right click drive D: and select "Resize/Move Volume", drag the middle towards right in the pop-up window.
  2. Right click system C: drive and select "Resize/Move Volume" again, drag right border towards right to combine the Unallocated space.

Follow the steps in the video to increase system partition size after expanding Hyper-V virtual disk:

Video guide

If partition D is Logical or formatted with FAT32, Disk Management can't help you. In that case, simply follow step 2 to merge Unallocated space with NIUBI Partition Editor.

The methods above to increase size of Hyper-V virtual disk partition are valid to Windows 10/8/7, Windows Server 2008, Windows Server 2012, Windows Server 2016 and Windows Server 2019.