How To increase the size of a VHD or VHDX
Run the below commands is powershell
Shutdown the VM for which you wish to increase the disk space.
- Get-Command -Noun VHD* -Module Hyper-V //This will show the commands that can be used over VHD
- Now use below command to to resize
Resize-VHD -Path "
E.g. Resize-VHD -Path “G:\Hyper-V\21932.simulytics.com\Virtual Hard Disks\21932.new.simulytics.com_8A85FF6F-6D89-4E80-AD71-C483BAFC0C0D.avhdx” -SizeBytes 335GB
In above example command Changes the VHDX's size to 335GB
2. Start the VM.
3. Now it will start merging the disk as shown in below screenshot
The Resize-VHD cmdlet changes the maximum physical size of a virtual hard disk. It can expand both VHD and VHDX files but can shrink only VHDX files.