Will its size extend by itself

Discussions related to using VirtualBox on Windows hosts.
Locked
HuaMin
Posts: 239
Joined: 17. Jan 2012, 07:01
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Oracle linux

Will its size extend by itself

Post by HuaMin »

Hi,
Further to this
viewtopic.php?f=6&t=54748

as the newly cloned Vbox is having its "real" size which is for instance 40GB when I view its Vdi file inside the host OS, but actually inside it, (I mean inside the guest OS), it is still having the original size like 200 GB which is the one I originally set up. Does it mean this new Vdi file will just "grow" by itself gradually?
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Will its size extend by itself

Post by noteirak »

That's the only possible answer, yes.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Rootman
Posts: 251
Joined: 1. Oct 2012, 18:29

Re: Will its size extend by itself

Post by Rootman »

Not to repeat the previous brief answer, but yes it will grow in size as new data is written to it. It can only grow automatically though, there is no automatic mechanism to shrink the size if the volumes data decreases. The up side is the disks are created very quickly and take up little space till the data grows, the downside is that it takes a bit of performance while it grows and should you write a few huge files to the VDI the size stays that way till it is compacted with the vboxmanage command line utility or a third party tool like clone VDI.
HuaMin
Posts: 239
Joined: 17. Jan 2012, 07:01
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Oracle linux

Re: Will its size extend by itself

Post by HuaMin »

Thanks Rootman. After the clone using CloneVDI, the vdi file of the VBox is just with the exact "size" for its inside stored OS; this means for instance, if I I originally had 200 GB fixed size for the VBox, from which the current Vbox is copied, and the current Vbox is having 160 GB of space inside, now the vdi file would be only 40 GB in its size (reported by the host machine).

Do you mean, if I create huge file (like the one that is 1 or 2 GB in size) inside the current Vbox, it will lead to bad performance of this Vbox?
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Will its size extend by itself

Post by noteirak »

There are no evidence of any difference of performance between fixed and dynamic.
So it doesn't matter which one you take, you will have the same performance.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
jorgensen
Posts: 589
Joined: 20. Oct 2009, 01:22
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Will its size extend by itself

Post by jorgensen »

HuaMin wrote:Do you mean, if I create huge file (like the one that is 1 or 2 GB in size) inside the current Vbox, it will lead to bad performance of this Vbox?
Not 'bad' performance, but you may experience a decrease in performance.

When files are added in the guest, a dynamic vdi file will expand on the host and become more or less fragmented depending on the use of the host partition. To get performance back, you need to defragment both the guest and host partition.
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: Will its size extend by itself

Post by mpack »

No, there is no difference in performance. If anything the dynamic format favors better performance.

Dynamic and fixed VDI use precisely the same file format. The only difference is in when the 1MB blocks, which make up the disk image, are allocated. That allocation costs a write to disk, so you either pay all of those costs up front (fixed), or you pay them only as needed (dynamic). Of course in the dynamic case you may never allocate the complete disk image, so there's a saving right there. For both cases there will be a bigger performance hit early on, but that pretty soon disappears below the measureable threshold.

Dynamic disks tend to be smaller than their fixed size counterparts. People who use "Fixed" tend to make one of two mistakes: worried about the size of the host file they tend to make the guest disk too small, leading to filesystem congestion inside the guest and poor performance. The other mistake is made by noobs who don't really understand the concept of disk space, so they go for a huge fixed size drive, and then wonder about the congestion and poor performance of the host.

If you want good all round performance then dynamic is the only way, with occasional tidy-ups using CloneVDI if you really care.
HuaMin
Posts: 239
Joined: 17. Jan 2012, 07:01
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Oracle linux

Re: Will its size extend by itself

Post by HuaMin »

Thanks a lot to all.
If the host is Win 7 machine, is it enough for that we use Disk Defragmenter to resolve any fragmentation inside either host or guest?
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: Will its size extend by itself

Post by mpack »

A defragmenter running on the host will only defragment the host filesystem. Nice to do every now and then (I do it once every 6-8 months) but not a complete solution.

Two other things can become fragmented:

1. The order of the 1MB image blocks in the VDI can be non-linear in a dynamic VDI.
To fix this you can run CloneVDI (with keep-uuid option) when the VDI has reached a stable size. It isn't worth doing before then.

2. The guest filesystem can also become fragmented.
Fix that by running a defragmenter inside the guest.
HuaMin
Posts: 239
Joined: 17. Jan 2012, 07:01
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Oracle linux

Re: Will its size extend by itself

Post by HuaMin »

Thanks. Where is "keep-uuid" option?
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: Will its size extend by itself

Post by mpack »

Read the CloneVDI release notes.
HuaMin
Posts: 239
Joined: 17. Jan 2012, 07:01
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Oracle linux

Re: Will its size extend by itself

Post by HuaMin »

Sorry, I cannot find out the details of it, from this
viewtopic.php?f=6&t=22422
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: Will its size extend by itself

Post by mpack »

You have already read the CloneVDI release notes - or you should have since you've been asked to do so in previous threads - so I think we're done here. Topic locked.
Locked