Compacting Virtual Hard Disks

Here you can provide suggestions on how to improve the product, website, etc.
Post Reply
chmichael
Posts: 6
Joined: 7. Oct 2007, 03:33

Compacting Virtual Hard Disks

Post by chmichael »

Hello,
Please implement an option to "compact" the virtual hard drive images in order to reduce the size.

Thank you
nvivo
Posts: 57
Joined: 4. Aug 2007, 17:08

Re: Compacting Virtual Hard Disks

Post by nvivo »

chmichael wrote:Hello,
Please implement an option to "compact" the virtual hard drive images in order to reduce the size.

Thank you
That option already exists, but is only available using VBoxManage command line.

Take a look at "VBoxManage modifyvdi".
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Post by stefan.becker »

This does not help much alone. First use Defrag in the guest and then call "sdelete" in the Guest. At last call the Vbox command. So you get the best result.
over_clox
Volunteer
Posts: 167
Joined: 5. Apr 2008, 22:43
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP, Ubuntu 10.04, Legacy Testing

Post by over_clox »

Hmmm . . . the way I do it takes a while, but I have to so I can compress a 20GB VDI half full down to 3.5GB.

1. I recommend defragmenting the VDI before doing this, it's worth it.
2. Make sure you don't have any savestates and the system is shut down.
3. Create a new VDI the same size or more as the original VDI to compact. *
4. Mount the 2 VDIs in another guest OS with a ghost copy utility installed.
5. Configure: don't copy unused space, copy the MBR, and make bootable.
6. Start the copy, then hurry up and wait . . . your new VDI is done. **

* Note: The new VDI will be detected by some copy protection software, so you may have to reactivate some programs before they'll work again. Windows will also detect new hardware the next time you start it up. I recommend a reboot after this process to be on the safe side. If you kept a copy of the VDI when it was blank, you could avoid reactivating software, but you'll have to ghost copy to another new VDI first, since VBox will not allow 2 VDIs with the same UUIDs to be used at the same time. This, along with a lengthy RAR compression (and a few other neat tricks), is how I fit 20GB on a 4GB flash drive with room to spare. Yes, it takes a while, but it's worth it.

** Caution: Don't delete the original VDI until you've tested the end result. Every time I've done this, the first boot always checks the disk and finds file system errors in the mirror MFT. So far I haven't had any problems with it; it finds and fixes the problems. I'm not entirely sure if it's a problem with VBox or Norton Ghost, but I suspect VBox because every time I check an NTFS VDI for errors, it always finds a couple of the security descriptors damaged. (Win2K & XP guests, no ghosting done).
simrn
Posts: 3
Joined: 8. Dec 2008, 14:09
Contact:

Post by simrn »

I got deleted my original original VDI while doing the same thing :( . Any solution? would really appreciate help
Post Reply