Hello,
Please implement an option to "compact" the virtual hard drive images in order to reduce the size.
Thank you
Compacting Virtual Hard Disks
Re: Compacting Virtual Hard Disks
That option already exists, but is only available using VBoxManage command line.chmichael wrote:Hello,
Please implement an option to "compact" the virtual hard drive images in order to reduce the size.
Thank you
Take a look at "VBoxManage modifyvdi".
-
- Volunteer
- Posts: 7639
- Joined: 7. Jun 2007, 21:53
-
- 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
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).
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).