VM size not dynamically?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Plagrö
Posts: 140
Joined: 27. May 2018, 14:57

VM size not dynamically?

Post by Plagrö »

Hello,

I have a VM of Win7 32bit.
The VM is about 70 GB.
So yesterday I deleted about 14 GB system files like tmp, windows snapshots and so on.
My expectation was, that now the file will be reduced, so that I just have about 56 GB.
But the file has still the same size. Why?

Where do I have the VDI from?
Answer: I made an image from my old system, then converted it into VDI.
But I assume, that this is a dynamically VDI? Isn't it?

Thank you.
VM-1.png
VM-1.png (118.67 KiB) Viewed 926 times
Pernat1y
Posts: 30
Joined: 11. Jun 2018, 11:43
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Windows 10, Kali, Fedora/RHEL

Re: VM size not dynamically?

Post by Pernat1y »

Disc size can only grow, not reduce it's size.
You can try to shrink it manually, but that's not something that works automatically.
Hosts: Arch Linux, Windows 10;
Guests: Windows 10, Kali, Fedora/RHEL.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM size not dynamically?

Post by mpack »

Plagrö wrote: My expectation was, that now the file will be reduced, so that I just have about 56 GB.
But the file has still the same size. Why?
Because deleting a file does not un-write the disk sectors. The data is still there, so the hard drive simulation still has to store it. There are tools you can use to "compact" a disk, i.e. un-write all sectors not currently mapped to a guest file, but this is only really useful if your regular usage patterns won't immediately replace the data.

Disks tend to reach an equilibrium size based on your usage patterns, i.e. it becomes increasingly unlikely that a given sector is being written to for the first time.
Plagrö
Posts: 140
Joined: 27. May 2018, 14:57

Re: VM size not dynamically?

Post by Plagrö »

Thank you.
Post Reply