How to shrink image files of our VirtualBox virtual machines on Linux and Windows systems
VirtualBox allows you to run virtual machines on your computer that share the computer's hardware resources with the host operating system. VirtualBox also provides the ability to use dynamically growing storage, which allows you to create drives that are (virtually) the same fixed size inside, but the physical image files themselves are only a few megabytes in size when created and grow depending on the amount of data loaded. This is unfortunately not true backwards, so if you delete something from the virtual machine, for example, the size of the physical image file on the virtual storage device will unfortunately not be reduced. In this description, we will look at how to manually shrink the dynamically growing image files of our VirtualBox virtual machines to the size actually used on Linux and Windows systems.