0

I read the thread at How to compact VirtualBox's VDI file size? but those solutions didn't work for me. Here's what I tried:

I had used CloneVDI successfully for years without a problem, but it suddenly fails to compact at all. I have (and have always had) 2 partitions on the guest OS (C: 42gb, F: 20gb). After deleting a large database file and shrinking the F: partition from 45gb to 20gb using MiniTool Partition Wizard (and eliminated empty space gaps between the partitions), I ran CloneVDI with the Compact option selected and there was no change in size (it should have reduced the size from 82gb to a maximum size of 62 (the sum of both partition sizes). I also tried sdelete C: -z and sdelete F: -z followed by vboxmanage modifymedium <path to .vdi> --compact with no effect (snapshots had been removed prior to running).

Never ran defrag in the past and can't on either partition since the .vdi is on an SSD (and is marked in Vbox settings as an SSD).

Am I missing something?

BobH
  • 1
  • 4

1 Answers1

0

Finally found a solution, here's what I tried and what eventually worked:

  • tried deleting the snapshots in File Explorer, but that was a mistake - VM fails to boot. Forced to restore from backup
  • try removing 25gb snapshot in VB, got error message 'Failed to delete snapshot...has more than one child hard disk...'
  • had to go to VirtualBox (VB) Virtual Media Manager to find the 'unattached' snapshot and remove
  • now able to remove entire snapshot in VB
  • although due to the merging that takes place when removing snapshots, the .vdi image size got larger (went from 82gb to 87gb). Now able to use the combo of sdelete/VBoxManage to reduce .vdi size from 87gb to 77gb, but still way too large (see original post)
  • Now run CloneVDI on that image - it shrinks from 77gb to 46gb - success!
BobH
  • 1
  • 4