Page 1 of 1

[Solved] Reduce the size of the .vdi file

Posted: 24. Jun 2018, 22:02
by giannino1995
I installed Ubuntu 18.04 on VirtualBox by assigning dynamic space to the HD 2TB. Working with large files, the .vdi has grown a lot. Are there any methods to permanently remove deleted files?
Thank you

Re: Reduce the size of the .vdi file

Posted: 25. Jun 2018, 01:19
by socratis
User Manual, ch. 8.23 VBoxManage modifymedium, look for the "--compact" option. Also in the User Manual that gets installed with VirtualBox, in PDF format, that you can search.

Re: Reduce the size of the .vdi file

Posted: 29. Jun 2018, 12:31
by giannino1995
Thanks so much. I understood your intervention and documentation. But I do not understand the technical question. Where should I write the string "[--compact]"? In which file should I add the string "VBoxManage modifymedium [--compact]"?

Re: Reduce the size of the .vdi file

Posted: 29. Jun 2018, 14:34
by mpack
I suggest that you forget VBoxManage, as that "--compact" option will do nothing by itself. Instead download CloneVDI and run it under Wine on your Linux host. Tick the "compact" option before cloning. See the release notes for details.

Re: Reduce the size of the .vdi file

Posted: 29. Jun 2018, 15:23
by giannino1995
I solved with this code:

Code: Select all

sudo apt install zerofree
df
zerofree -v /dev/sda1
halt
cd "C:\Program Files\Oracle\VirtualBox"
VBoxManage.exe modifymedium "F:\...\UBUNTU 18.04 LTS.vdi" --compact
With the second system you write I would have spent less time?

Re: Reduce the size of the .vdi file

Posted: 29. Jun 2018, 16:30
by mpack
Much less time, yes. Like, you would have been finished in a few minutes instead of however long it took you to run zerofree.

Re: [Solved] Reduce the size of the .vdi file

Posted: 30. Jun 2018, 16:58
by giannino1995
Where can I find the software for Ubuntu 18.04?
Thank you

Re: [Solved] Reduce the size of the .vdi file

Posted: 30. Jun 2018, 20:28
by ChipMcK

Re: [Solved] Reduce the size of the .vdi file

Posted: 1. Jul 2018, 08:59
by mpack
giannino1995 wrote:Where can I find the software for Ubuntu 18.04?
I assume you mean CloneVDI. CloneVDI is a Windows (Win32) app, it is not available as a native Linux app. However you can run it on Linux under Wine, and I'm told it runs well that way.

I deleted your crosspost of this question.

Re: [Solved] Reduce the size of the .vdi file

Posted: 1. Jul 2018, 14:26
by giannino1995
I'm exhausted. I'm happy with ZeroFree.
thank you