r/HyperV • • Jul 17 '24

Help please!

Post image

I cant shrink this VHDX. This VM was created by this VHDX but cant shink the size of this disk. Already try to convert, shrink the disk in VM layer but nothing ived seen in internet works, only these 3 options appears. Please help đŸ™đŸ»

0 Upvotes

29 comments sorted by

5

u/Goethe101010 Jul 17 '24

Like others have said, make sure you have room on the disk to shrink. Log into the running VM, make space. Open disk management and shrink there. Then shut down the VM and try again through Hyper-v manager.

0

u/Powerful-Bunch-3782 Jul 18 '24

Already did it, but still doesnt work :/

1

u/Goethe101010 Jul 18 '24

So the disk size inside the vm is smaller than the vm itself? And you tried to compact it? It should compact down to the size of the disk inside the vm, that you see in disk management when logged into the VM? Is it running Windows and is it a basic or dynamic disk?

1

u/Initial_Pay_980 Jul 17 '24

You need to shrink the partition inside the vhdx. Once you have free space then you can compact

-1

u/Powerful-Bunch-3782 Jul 17 '24

Already did it, still doesnt works

1

u/Initial_Pay_980 Jul 17 '24

You have an unformatted raw partition Inside the VM. Not just free space at the end.of the drive.

1

u/Powerful-Bunch-3782 Jul 17 '24

I shrink the partition of HDD in this VM, so 100GB was unlocated, but after format as another partition and already expand the HDD size, still not work

1

u/Lusankya Jul 17 '24

Please show a screenshot of diskmgmt.msc running inside the guest, or on the host with the VHDX mounted.

1

u/Powerful-Bunch-3782 Jul 18 '24

1

u/Lusankya Jul 18 '24

You need to move the 519 MB partition. The unallocated space needs to be at the end of the drive with no partitions after it.

Diskmgmt can't do this for you. I recommend mounting the disk in a Linux guest and using gparted. There are commercial tools for Windows that can do this too, like Macrium Reflect.

1

u/OpacusVenatori Jul 17 '24

What do you mean “only these three options”?

Compact will reduce the size of the VHDx file on the host; but the VM will maintain the original, allocated size within the guest OS. Just reduce the size of the partition within the guest OS.

1

u/Powerful-Bunch-3782 Jul 17 '24

I want the "Shrink" option, to minimize the VHDX size to export to an ESXI environment

4

u/kabanossi Jul 19 '24

Can suggest using Starwind V2V converter to make a growable virtual disk while moving the VM from Hyper-V to the ESXi host. It shrinks the disk during migration. https://www.starwindsoftware.com/starwind-v2v-converter

1

u/Powerful-Bunch-3782 Jul 19 '24

i am using Starwind to migrate the VM, but the software doesnt shrink the disk, have no this option

1

u/Powerful-Bunch-3782 Jul 19 '24

maybe i have found this feature, im doing the migration, but its by internet, so maybe monday will be finish

1

u/OpacusVenatori Jul 17 '24

There is no such option

8

u/OpacusVenatori Jul 17 '24

It’s irrelevant anyways. When you convert the guest, select a Thin-Provisioned VMDK target disk and it’ll create the appropriately sized disk.

1

u/Powerful-Bunch-3782 Jul 17 '24

Thanks!!! I will try it, really appreciate your help

1

u/Powerful-Bunch-3782 Jul 17 '24

Lol i see a lot of content in internet showing this way to do it

1

u/Lots_of_schooners Jul 18 '24

Just export as dynamic vhdx. This process will create the smallest possible vhdx.

1

u/Powerful-Bunch-3782 Jul 18 '24

I thought this would solve it, it would be the kind of solution that's like, "Wow, this has to be it." But it didn't work either :(

1

u/fedesoundsystem Jul 17 '24

You first inside the guest vm reduce the partition and leave free space tp the left of the disk, towards the end. Then on the host you use the compact option and you can retrieve the free space, and the vhdx size decreases

1

u/Powerful-Bunch-3782 Jul 18 '24

yes, i already did it, but doesnt work too

1

u/Tigeruppercut36 Jul 17 '24

Shut down the VM first before you try to shrink

1

u/Powerful-Bunch-3782 Jul 18 '24

in my most dreamed dreams, i would like to be just this, buddy :(

1

u/Exact-Improvement-22 Jul 18 '24

Convert to thin provisioned and move it where you want.

1

u/Powerful-Bunch-3782 Jul 18 '24

Sorry, i dont get it, can you explain me better?