Bigger VDI having less content than smaller VDI

This is for discussing general topics about how to use VirtualBox.
Post Reply
AntiMatter
Volunteer
Posts: 176
Joined: 2. Nov 2008, 06:48
Primary OS: Ubuntu 12.04
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: All Windows (x32 & x64), Linux
Location: Canada

Bigger VDI having less content than smaller VDI

Post by AntiMatter »

Hi,

Two VMs almost identical (Guest Windows 2003 x32 + SQL Server 2005 and some Development files)

- VM1: The VM was built from scratch. The VM is 1.5 years old, had gone through some Service packs updates. I may have executed Windows Defrag a few times, but don't remember exactly how many times. The VDI size is 11 GB.

- VM2: rebuilt from scratch recently (one of the reason is that I need to increase the hard disk size for future use). Also applied all system & application service packs. Same content + about 1.5 GB of extra content compared to VM1. The VDI size is 7.5 GB.

I have run Crap Cleaner to reclaim all the HD space that is possible to reclaim. What is the reason for the VDI size of VM2 to be much smaller and yet having more content than VM1?

Thanks in advance for any help.
AntiMatter
Volunteer
Posts: 176
Joined: 2. Nov 2008, 06:48
Primary OS: Ubuntu 12.04
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: All Windows (x32 & x64), Linux
Location: Canada

Re: Bigger VDI having less content than smaller VDI

Post by AntiMatter »

The VDI FAQ http://forums.virtualbox.org/viewtopic.php?p=29271

has these topics which answer to my question

- Q: Why do dynamic VDIs grow far more than the used space?
- Q: How can I reduce the size of a dynamic VDI on disk?

Thanks.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Bigger VDI having less content than smaller VDI

Post by mpack »

Dynamic VDIs dynamically grow. They do not dynamically shrink. For that to be possible VirtualBox would have to be aware that the guest is no longer using some sectors, and that would require a knowledge of the guest filesystem.

"VBoxManage modifyhd" can be used to compact a VDI again. Alternatively, check out the CloneVDI tool sticky in the "Windows Hosts" forum. This is a Windows host GUI alternative to VBoxManage for cloning VDIs, and it too can also compact them. I'm told that CloneVDI works under Wine on Linux hosts, though there's no official support for that.
Post Reply