Is it possible to shrink a VirtualBox dynamic image?

2

1

When you create a Virtual Box image you can choose to create a dynamic one, which will grow as needed so that even if your image is for 20GB, if you used only 4GB, only 4GB is taken from your hard disk.

If you copy a lot of stuff, and the remove it, is it possible to have the image shrink again? Maybe it requires defragmenting?

The image would have a Windows 7 NTFS.

pupeno

Posted 2009-09-27T16:20:44.110

Reputation: 8 223

Answers

2

There is tutorial at VirtualBox forums which has this question,

Q: How can I reduce the size of a dynamic VDI on disk?
There are two approaches to cleaning up and reducing the size of the file system stored on a dynamic VDI. The first is what I call in-place and the second is by doing a file system copy.
This answer addresses the first of these.

One more reference: howto resize / expand a vdi disk (linux guest)

nik

Posted 2009-09-27T16:20:44.110

Reputation: 50 788