Questions about Guest memory allocaton

This is for discussing general topics about how to use VirtualBox.
Post Reply
factor3
Posts: 7
Joined: 17. May 2011, 23:40
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows 7, Windows XP SP2, Fedora 10 - 14, Other Linux's

Questions about Guest memory allocaton

Post by factor3 »

Greetings:

I am very new to VirtualBox and somewhat new to virtualization in general (though I am somewhat familiar with Hypervisor and VMWare). Please bear with me...

I understand that when one creates a virtual machine on VirtualBox, the memory allocated to that machine becomes unavailable to the host. My concern, however, is with the number of VMs that you can run at the same time.

Suppose you have a machine that has 8 Gigs of memory. If I was to decide to keep a Gig for the VM, that leaves 7 Gigs for VMs. If I was to allocate 4 Gigs for a Windows VM and 3 Gigs for a Linux VM (these sound weird, but this is for thought experiment purposes!) then wouldn't I have used up all available memory for running VMs? In other words, wouldn't that mean that I can only run these two VMs simultaneously within VirtualBox???

If it does, then this would be a serious limitation. The virtualization products I mentioned previously can not only specify multiple VMs (more than two using the same scenario) on that same 8 Gig machine, but they can actually simultaneously run all of those VMs on that machine despite the fact that the multiple VMs have memory allocated that, when added together, exceeds the physical memory! This is because VMWare and Hypervisor have some kind of memory sharing scheme that enables the different VMs to share memory resources (within reason, of course! They don't work so well if there is heavy usage on all of the running VMs).

Does VirtualBox have a mechanism like that? Or are we limited to running only the number of VMs constrained by the amount of physical memory available?

Someone please advise.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Questions about Guest memory allocaton

Post by BillG »

No. You cannot over-commit memory in VirtualBox (or in Microsoft VPC or Hyper-V). If sufficient memory is not available, you cannot start the vm.
Bill
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Questions about Guest memory allocaton

Post by Perryg »

VirtualBox does allow for page fusion and memory ballooning which does allow for this (over commit) of sorts. Personally I don't use it as I don't want to take chances with loosing my guests, but some swear by it. Read up on it in your VirtualBox users guide. Certain restrictions do apply. Not available without VT-x/AMD-v.
factor3
Posts: 7
Joined: 17. May 2011, 23:40
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows 7, Windows XP SP2, Fedora 10 - 14, Other Linux's

Re: Questions about Guest memory allocaton

Post by factor3 »

Bill:
No. You cannot over-commit memory in VirtualBox (or in Microsoft VPC or Hyper-V).
I do not quite know about VirtualBox, but what you say about Hyper-V appears to be incorrect. I say this because I have a co- worker who is doing exactly that on his home machine: running several VMs simultaneously on a machine with Hyper-V. He showed me his setup, the VMs he is running, and his host memory is seriously overcommitted. Several of his VMs, however, are not being used to their fullest capability (they are set up to accommodate the classes he is teaching and they are offering services that aren't being taxed at all), and they ate sharing memory with each other. It was him showing me his extremely good setup that prompted my question here in the first place.

Perry:

I looked over the chapter in the user manual on memory ballooning, and part of it raised some concern: according to the documentation, once you allocate memory for ballooning, the ballooned memory is taken from a VM and never returned to it. This bothers me, because doesn't that mean that if I have a VM allocated for 4 Gigs of memory, and I "balloon" 1 Gig, isn't that the same as allocating 3 Gigs to the VM? Or does VirtualBox provide that ballooned 1 Gig (briefly) to *any* VM that needs it including the one that gave it up in the first place?
Post Reply