VM Storage size is smaller then set amount

This is for discussing general topics about how to use VirtualBox.
Post Reply
joshuaw
Posts: 4
Joined: 23. Mar 2014, 09:12

VM Storage size is smaller then set amount

Post by joshuaw »

I have a Windows 8.1 host and I created a Fedora 20 guest.

I set the hard disk to fixed and the size to 225 GB. (I had made an earlier one at 65GB and decided I wanted more space to work with for long term use)

When I look at the size of the hard disk while in the fedora guest is says the size is 52GB. At the same time the vbox manager still lists the size at 225GB. I also confirm that 225GB are being used on my host system, so I know that it has allocated the right amount.

When I first tried it with 65GB I noticed that a portion was set aside for recovery and that left me with about 40 or 50 ( I don't remember). I removed that VM and started over. I am concerned that it used some configuration to set my new size limit to the old one, or at least that is the only thing I can think of.

Any ideas what happened?

thanks,
Joshua
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: VM Storage size is smaller then set amount

Post by loukingjr »

It sounds like you have more than one partition aside from the swap partition and the 52GB number is the size of just one partition. I have a Fedora 19 guest with a 20GB dynamic .vdi and the OS, the applications I installed, themes, icons, wallpapers etc. take up just over 5GB leaving about 14GB free. The guest only takes up the 5+ GBs on my host. I have never used a fixed disk and I'm not sure why anyone does.

edit: I forgot to mention you can always resize a dynamic virtual drive if you find yourself running out of space which you can't do with a fixed disk.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
joshuaw
Posts: 4
Joined: 23. Mar 2014, 09:12

Re: VM Storage size is smaller then set amount

Post by joshuaw »

I did indeed find that I have a home partition that has most of the space available. I don't remember it being like that on earlier versions and that is why I was confused.

As to the reason to use a fixed drive size, it takes a bit more resources every time you write to the disk because it needs to expand. So things are just a bit faster with fixed. Since I have a 2 TB hard drive, it was easy for me to just assign 225 GB. Also in the past I had a dynamic drive and when it reached the limit I had to jump through a bunch of hoops to basically copy the contents onto a new and larger virtual drive. Maybe they have added a new feature to allow you to change the ceiling of the drives, I haven't looked.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VM Storage size is smaller then set amount

Post by mpack »

joshuaw wrote:As to the reason to use a fixed drive size, it takes a bit more resources every time you write to the disk because it needs to expand.
Not true. Not even slightly true. It would only be half true if every write caused an expansion, which it clearly doesn't, and if the cost of creating a fixed disk was zero, which it isn't. In fact by creating a large fixed disk you are more than likely congesting either the guest or host disks leading to a far greater performance loss than if you'd stuck with the default.

As to the hoops you previously had to jump through to expand a dynamic disk capacity, what on earth led you to conclude that a fixed size drive would be more convenient in that regard?
joshuaw
Posts: 4
Joined: 23. Mar 2014, 09:12

Re: VM Storage size is smaller then set amount

Post by joshuaw »

Admittedly I still have much to learn. :)

I based my statement on the docs, /manual/ch05.html#vdidetails , specifically this line:

"For more flexible storage management, use a dynamically allocated image. This will initially be very small and not occupy any space for unused virtual disk sectors, but will grow every time a disk sector is written to for the first time, until the drive reaches the maximum capacity chosen when the drive was created. While this format takes less space initially, the fact that VirtualBox needs to expand the image file consumes additional computing resources, so until the disk file size has stabilized, write operations may be slower than with fixed size disks. However, after a time the rate of growth will slow and the average penalty for write operations will be negligible."

Did I misunderstand the docs or are they out of date?
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: VM Storage size is smaller then set amount

Post by loukingjr »

"slower" is a relative term. also, "may be slower" means what it sounds like. this conversation reminds me of people arguing about the speed of browsers. some would argue a browser that boots in 4.5 seconds is faster than one that boots in 4.7 seconds. literally it's true but two tenths of a second is meaningless. I doubt seriously anyone can tell the difference between the speed of write operations between dynamic and fixed virtual drives and most likely would have to be measured. certainly not enough of a difference to make up for the advantages of a dynamic drive.

just my two cents.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
joshuaw
Posts: 4
Joined: 23. Mar 2014, 09:12

Re: VM Storage size is smaller then set amount

Post by joshuaw »

Thanks for the insight. Do both of you think that fixed is a bad enough decision that I should dump my current VM and start over with a dynamic one? My intent is to keep the VM long term.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VM Storage size is smaller then set amount

Post by mpack »

For convenience lets say we have a 1GB dynamic VDI. This consists of 1024 x 1MB blocks, all of which start off as unallocated. An expansion event occurs when the guest writes to one of those 1MB regions of the disk, and it isn't already allocated. So, there can only be a maximum of 1024 expansion events on this disk before it becomes fully allocated, and then no more for the remainder of the life of the disk, so there clearly cannot be one expansion event per disk write. In fact, beyond the very early life of the disk, the number of expansions events per write must pretty closely approximate 0. The cost of these events amortized over the life of the VM simply aren't worth considering. You can multiply this cost by 50 or 100 and it still isn't worth bothering about. And fixed sized disks don't avoid these costs, they have to pay the full cost up front, whether the guest will ever need the space or not.
joshuaw wrote:Do both of you think that fixed is a bad enough decision that I should dump my current VM and start over with a dynamic one? My intent is to keep the VM long term.
No, I would not dump the VM, I would just convert the disk to dynamic :-

Code: Select all

VBoxManage clonehd <infile.vdi> <outfile.vdi> --format VDI --variant Standard
Or you can clone it with CloneVDI, which always converts the output to dynamic VDI.

Don't do either if the VM uses snapshots. Hopefully you weren't one of those guys who go the crazy route of fixed size drives + snapshots.
Post Reply