vb disk size

Discussions related to using VirtualBox on Linux hosts.
Post Reply
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

vb disk size

Post by neuronetv »

I have a vm running in linux VB 4.3 and the amount of data on the vm disk reached 44Gb, I deleted loads of stuff in the vm and now webmin shows the disk space used to be about 7Gb which is correct. However when i did an export of the vm the ovf file created was 44Gb in size and the backup took ages.
I take it VB will keep increasing the disk size up to the set limit but when stuff is deleted it will not reduce the disk size back down again. Is this correct? is there a way to configure VB to automatically increase and reduce the disk size as the vm OS needs?
ps: my vm's run on a server, they are all headless and work on command line only.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vb disk size

Post by Perryg »

Assuming that the VDI was created as normal (dynamic) you need to compact the guest. See the manual section below.
http://www.virtualbox.org/manual/ch08.h ... -modifyvdi
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

Re: vb disk size

Post by neuronetv »

Perryg thanks for your response. After wrestling for hours I finally was able to run zerofree on the vm however when it came to compacting I got an error:
VBoxManage: error: Could not find file for the medium '/root/<vm>' (VERR_FILE_NOT_FOUND)
my vm file ends in '-disk1.vmdk', does this mean I have a fixed size disk and not a dynamic one? if so is there anything I can do about it?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vb disk size

Post by Perryg »

You need to first convert it to a VDI as stated in the manual.
Post Reply