2012 R2 with Hyper-V and VHDX Disk. How do you Shrink.

I have a 2012R2 server with 2 VMs.  I would like to shrink the size of the VHDX files for one of the VMs.  I shrank the size of the partition in the VM with Disk Management by 100GB.  I now have 100GB unallocated.  When I edit this VHDX from Hyper-V Manager, I can't shrink the VHDX.
howmad2Asked:
Who is Participating?
 
Manojkumar RaneCommented:
If VM is above windows 2008 then follow below steps :
Shutdown the VM.
Detach VHDX file from VM.
Attach VHDX file to host using disk management -- attach VHD.
Defrag the vhd file and shrink the vhd file.
Detach vhdx file from disk management.
Open Hyper-V manager and select edit disk.
Select the vhdx file and perform shrinking operation.
0
 
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
What is the guest OS? If earlier than 2012 R2 shut the VM down before running the VHDX Edit again.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.