Page 1 of 1

Force vbox Host to use Swap?

Posted: 28. Jan 2009, 23:41
by vboxcamel
I'm running vbox on a system with 3GB of memory, but I would like to concurrently run guests that add up to about 4GB of memory. I've configured a USB flash drive as swap for my linux host for faster swap access, but it seems vbox won't use it. Every time I launch enough hosts to fill up my physical ram, guests crash without my hosts swap being used.

I've checked to make sure swap is configured properly and other apps use it, just not vbox.

After doing some forum reading, it seems vbox won't use swap. Is there a way to force vbox to use swap for guests? I don't care much about the performance, I only use one guest at a time, but I need them all up and running.

I know I can configure swap within each guest to point to .vdi files on my flash drive, but that seems like a lot more hassle than just having my host manage it.

How does vbox run in such a way that prevents it from using swap while other programs will. I'm hoping there is just a quick setting somewhere...

Any help would be greatly appreciated!

Posted: 29. Jan 2009, 00:28
by Sasquatch
VB forces the OS to use RAM itself, because it can't rely on swap space. Some people don't have it, some have it misconfigured, other do have it. And it's also a performance thing. Letting it use the swap will slow down the Guest pretty much.
The allocation algorithm locks only physical memory.

You can make it use swap, but that would mean you download the source, modify it and compile it yourself. But you will lose some functionality too, like USB and RAW Disk Access. See the website for the differences between versions.