Hi, I'm finding this difficult to understand. The disk space in the VM (Win10) is showing around 20GB used. The vdi file in the host is showing 14GB. I could understand it if it was the other way round as the vdi does not contract, even if the guest disk usage is reduced. But I don't understand the vdi being smaller than the guest's. Does Vb use compression with its vdi? If not, can anyone explain this?
Matt
Guest Disk Space to Host File Space Mismatch
-
- Site Moderator
- Posts: 20965
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Guest Disk Space to Host File Space Mismatch
I don't think Virtualbox uses compression in VDI, but Windows compresses some things in its installation.
Please use Upload Attachment to show a screenshot inside the VM of the disk's Properties tab. Also, please run these commands in the host's Command Prompt or Terminal Window:
(this one if it's a Windows host:)
CD C:\Program Files\Oracle\Virtualbox
vboxmanage showmediuminfo "path\to\\drive\file.vdi"
Please use Upload Attachment to show a screenshot inside the VM of the disk's Properties tab. Also, please run these commands in the host's Command Prompt or Terminal Window:
(this one if it's a Windows host:)
CD C:\Program Files\Oracle\Virtualbox
vboxmanage showmediuminfo "path\to\\drive\file.vdi"
-
- Volunteer
- Posts: 5668
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Guest Disk Space to Host File Space Mismatch
Windows cannot count!MattC13 wrote:If not, can anyone explain this?
Seriously, Windows 10 uses hardlinks for many of its own installed files (e.g. *.exe, *.dll). Open a command prompt and enter the following command:
Code: Select all
fsutil hardlink list c:\windows\notepad.exe
Code: Select all
\Windows\System32\notepad.exe
\Windows\notepad.exe
\Windows\WinSxS\amd64_microsoft-windows-notepad_31bf3856ad364e35_10.0.19041.1081_none_e3f87355251e8c43\notepad.exe
In addition to that, Windows 10 uses file compression (e.g. in C:\Program Files\WindowsApps) and sparse files, and VirtualBox will not allocate VDI blocks for 1 MB blocks containing only zeroed bytes.