Virtualbox VDI Actual vs Virtual size

Discussions related to using VirtualBox on Linux hosts.
Post Reply
kmand
Posts: 28
Joined: 16. Nov 2009, 17:20
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: winxp

Virtualbox VDI Actual vs Virtual size

Post by kmand »

I'm running Virtualbox 4.2.12 on Ubuntu 12.10. The Win7 guest has a VDI which shows as

Normal (VDI)
Virtual Size 25.39GB
Actual Size 16.51GB
Dynamically Allocated Storage

Snapshots just shows current.

From the Linux side the vdi file is what the Actual Size says, which is also all the Win7 sees in disk properties. The NFTS filesystem is the whole C disk. I understand about increasing the size of the NTFS filesystem if the disk itself show larger, but it doesn't.

The VBoxManage modifyhd command succeeds and can increase the Virtual Size, but no increase in Actual Size.

I've seen suggestions about cloning the disk to increase size, but finding enough space is an issue, and isn't the whole point of Dynamic Storage to avoid having to do that?

How do I actually get the Actual Size to go up?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Virtualbox VDI Actual vs Virtual size

Post by Perryg »

MamaAppelsap
Posts: 1
Joined: 25. Nov 2014, 14:25

Re: Virtualbox VDI Actual vs Virtual size

Post by MamaAppelsap »

I don't believe that the above post is the correct answer. The referred topic relates to increasing your dynamic hard disk size, but not your actual hard disk size.

I am struggling with the same problem at the moment. I want to install the Oracle DB, but the installation cannot start, because I do not have enough space on my VM. I want to try to create a large dummy file that forces my VM's actual size to grow.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Virtualbox VDI Actual vs Virtual size

Post by socratis »

MamaAppelsap wrote:I don't believe that the above post is the correct answer. The referred topic relates to increasing your dynamic hard disk size, but not your actual hard disk size.
Before making such bold statements, I believe that you should read the manual in order to understand how exactly dynamic images work. From the manual, Chapter 1:
VirtualBox supports two types of image files:
  • A dynamically allocated file will only grow in size when the guest actually stores data on its virtual hard disk. It will therefore initially be small on the host hard drive and only later grow to the size specified as it is filled with data.
  • A fixed-size file will immediately occupy the file specified, even if only a fraction of the virtual hard disk space is actually in use. While occupying much more space, a fixed-size file incurs less overhead and is therefore slightly faster than a dynamically allocated file.
For details about the differences, please refer to Section 5.2, “Disk image files (VDI, VMDK, VHD, HDD)”.
If the Oracle DB installer complains about lack of space in your VM, then nothing can fix it, unless you a) free some disk space from your VM's HD or b) increasing the HD size of your VM as per the article you quoted as incorrect.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtualbox VDI Actual vs Virtual size

Post by mpack »

Hmm. I didn't realise that portion was still there in the introduction. Obviously the wording is poor ("immediately occupy the file") and the part about performance is not correct - or requires caveats. IMHO, section 5.2 is much clearer.

However, I can assure MamaAppelsap that the gist of the resizing FAQ is correct, or we wouldn't preserve it as a FAQ. Let go of your preconceived notion of what "dynamic size" means - in fact it is meaningless. There is no such thing as a drive with dynamic size (if by that you mean dynamic capacity), only dynamic allocation of a fixed capacity vs fixed allocation of a fixed capacity.
Tom7
Posts: 11
Joined: 27. Dec 2013, 21:03

Re: Virtualbox VDI Actual vs Virtual size

Post by Tom7 »

A note for anyone else who lands here: I had the problem described in VirtualBox 5.0.4 on a disk which had a snapshot. I resized the main disk vdi file from 30,000MB to 40,000MB. VirtualBox then reported a virtual size of 40GB but an actual size of 30GB and the Windows guest still showed no unallocated space, just a single 30GB partition taking up the whole disk.

Shutting down the VM, resizing the snapshot files in the same way as the main disk file (VBoxManage modifymedium disk <UUID of snapshot file> --resize 40000) then rebooting the VM resolved the problem.

Perhaps this could be added to the FAQ item?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtualbox VDI Actual vs Virtual size

Post by mpack »

Tom7 wrote:Perhaps this could be added to the FAQ item?
It is already in the FAQ. See note3 of first post of the FAQ, plus the second post.
ALANALYAS
Posts: 1
Joined: 26. May 2020, 06:42

Re: Virtualbox VDI Actual vs Virtual size

Post by ALANALYAS »

This might be already solved some other ways, but just in case someone else is looking. I had the same issue with a Windows Server 2016. Using Diskpart utility helped me fix this problem.

1- In CMD write Diskpart
2- List Volume
3- Select the desired Volume that you want to extend
4- type extend
5- List Volume and see if the the size has been updated.

For me after running list volume I saw that I needed to extend Volume 2 which is my C drive. My next line was select volume 2. Next I typed extend. This solved my problem.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox VDI Actual vs Virtual size

Post by scottgus1 »

Thanks, ALANALYAS, for that info. The linked FAQ mentions the same thought, expanding the main partition in the guest OS, in the first post, Step 2, thought it recommends using "Disk Management" rather than the DiskPart command line.
Post Reply