In a nutshell, in order to shrink or compact virtual hard disks, you should do the following:

  1. Open Hyper-V Manager.
  2. Launch the Edit Virtual Hard Disk Wizard.
  3. Specify the virtual hard disk whose size you want to reduce.
  4. Select the action you want to perform (Shrink or Compact).
  5. Click Finish to accept the changes.

How do I resize a VHD file?

In order to resize the system drive on the new VHD file, you use the Windows tool, Diskpart. Within Diskpart, set the disk (usually disk 1) and respective partition (usually there is only one) and then issue the ‘extend’ command.

Can a VHD file be modified?

Can you modify an existing virtual hard disk (VHD) file? No, once created, a VHD file is fixed. Yes, but you can modify it only through Windows PowerShell.

How do I shrink a VMDK file?

Press Control-Alt-Delete to login to the virtual machine. Select Disk Management, and select the partition you need to shrink. Right Click the Volume/Partition to shrink, and select Shrink. The above dialogue will briefly appear whilst the file system is queried.

How do I make a VHDX file smaller?

The Shrink option is available on Windows Server 2012 VHDX format files.

  1. Right-click on the volume in Disk Management and select Shrink Volume.
  2. Enter the amount of space to shrink and press the Shrink button.

Why is vhd file so big?

When you create a VHD in a New Virtual Machine Wizard, the resulting VHD is by default a dynamically expanding VHD, meaning it only uses as much space on your host (Hyper-V server) HDD as needed, expanding when it needs more space. The Maximum Disk Space shows how large you allow a dynamically expanding VHD to grow.

What is the difference between vhd and VHDX?

The VHD (Virtual Hard Disk) file format, originally introduced with Connectix Virtual PC, can store the contents of a hard disk drive. VHDX (Virtual Hard Disk v2) images are functionally equivalent to VHD images, but they include more modern features, such as support for larger sizes and disk resizing.

Is there a way to shrink a VHDX file?

It can expand both VHD and VHDX files but can shrink only VHDX files. The shrink operation fails if it would shrink the virtual disk to less than its minimum size (available through the VHDX object’s MinimumSize property).

Is it possible to shrink a Hyper-V virtual disk?

The most difficult resource to remove from a Hyper-V virtual machine is drive space. If need to remove an entire disk, you can do that easily. Making a virtual hard disk smaller requires a significant level of effort. Lots of people confuse “shrink” with “compact” for virtual hard disks.

Is there a way to resize a virtual hard disk?

Resizes a virtual hard disk. 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. The shrink operation fails if it would shrink the virtual disk to less than its minimum size (available through the VHDX object’s MinimumSize property).

Can you change the size of a VHD file?

While you can set the VHD to be a fixed or dynamically sized file, the total size the VHD is determined at the time you create it. Over time, however, you may want to increase the total size of the VHD file as requirements for the system change to allow more space for installed programs and data files.