To increase the disk capacity of a guest virtual machine in Hyper-V, it is a two step process. The first step is to expand the VHD file and the second step is to expand the disk volume/partition inside the VM guest’s operating system. Before making changes, make sure you have a current backup.
To begin, make sure that the VM guest is turned off and select the hard disk from the VM settings. in the virtual hard disk settings, click on the edit button to edit the VHD file.
Select expand when prompted with a list of editing actions.
Increase the size to the desired value always making sure that the physical disk capacity can accomodate the new VHD file as it expands.
When finished, start the VM guest and log in. You will still see the disk capacity showing the old value.
Open computer manager and in the disk management section you will find the increased capacity as unallocated space.
Right click on the volume you want to extend (increase its size) and select extend volume…
Move the unallocated space from the available box to the selected box if it’s not already there.
Complete the wizard to get the unallocated capacity added to the volume you selected to expand.