snapshot: grows by "VBoxManage modifyhd xy.vdi --compact"

This is for discussing general topics about how to use VirtualBox.
Post Reply
tagore
Posts: 11
Joined: 14. Oct 2009, 09:15
Primary OS: Other
VBox Version: OSE Fedora
Guest OSses: WinXP

snapshot: grows by "VBoxManage modifyhd xy.vdi --compact"

Post by tagore »

I use an immutable image plus persistant snapshot (--autoreset off)

After some time the size this persistent snapshot keeps increasing over the size of the immutable masterimage
as well as over the Diskusage shown in the guest. And what is worse: It even grows with "VBoxManage modifyhd xy.vdi compact"

The state of the guest should only differ by the installation of 3 or 4 small applications. No Updates. User Data are removed or on the network.

Any help ?

- Immutable image: 4,8GB
- Disk Usage shown by guest: (total: 10 GB, used: 4 GB, free 6 GB
- Snapshot
before compact: 5.87 GB
after compact: 6.28 GB

Virtualbox 3.1.2 r56127
Host: Knoppix /Debian Lenny, networkboot
Guest WinXP SP3

Thanks
Last edited by tagore on 8. Jun 2010, 13:11, edited 2 times in total.
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Re: snapshot: grows by "VBoxManage hdmodify xy.vdi compact"

Post by baf »

What is the max allowed size of the base vdi?

I wonder because a guest os may have an allocation strategy where it avoids overwriting previous data. So every time disk is used it tries to use previously unused disk area.

If you want to make it smaller try using SDelete before doing compact this zeroes out unused space.
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
tagore
Posts: 11
Joined: 14. Oct 2009, 09:15
Primary OS: Other
VBox Version: OSE Fedora
Guest OSses: WinXP

Re: snapshot: grows by "VBoxManage modifyhd xy.vdi --compact"

Post by tagore »

Thanks for your reply, baf. Max size of the base vdi is 10 GB.

I tried SDelete -z before "VBoxManage modifyhd xy.vdi --compact" without success.
Having moved base- and differential from NFS to local ext3 would not make a difference either.
Differential disk has grown to 8.4 GB now.
Leak
Posts: 242
Joined: 31. Mar 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian Testing, Windows XP, Windows Server 2003/2008 R2

Re: snapshot: grows by "VBoxManage modifyhd xy.vdi --compact"

Post by Leak »

tagore wrote:I tried SDelete -z before "VBoxManage modifyhd xy.vdi --compact" without success.
Just checking here - you did run SDelete inside the guest and not on the host, right?
tagore
Posts: 11
Joined: 14. Oct 2009, 09:15
Primary OS: Other
VBox Version: OSE Fedora
Guest OSses: WinXP

Re: snapshot: grows by "VBoxManage modifyhd xy.vdi --compact"

Post by tagore »

yes: SDelete on the WInXP-Guest. Then shutdown the Guest and run VBoxManage on the Debian-Host.
tagore
Posts: 11
Joined: 14. Oct 2009, 09:15
Primary OS: Other
VBox Version: OSE Fedora
Guest OSses: WinXP

[SOLVED] Re: snapshot: grows by "VBoxManage ... --compact"

Post by tagore »

It was helpful to defrag NTFS before using VBoxMangage modifyhd xy.vdi compact.
( see also http://forums.virtualbox.org/viewtopic.php?f=1&t=8046)
bobpaul
Posts: 15
Joined: 19. Dec 2007, 08:30
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux, Other

Re: snapshot: grows by "VBoxManage modifyhd xy.vdi --compact"

Post by bobpaul »

As of May 2007 compact was known not to work on disks with snapshots. I haven't seen anything to indicate this has changed.
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: snapshot: grows by "VBoxManage modifyhd xy.vdi --compact"

Post by mpack »

bobpaul wrote:As of May 2007 compact was known not to work on disks with snapshots. I haven't seen anything to indicate this has changed.
I would expect it to work in a technical sense of not crashing - but it wouldn't be very effective since I expect it only discards zero blocks from the current state.
Post Reply