Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Limit CPU Usage of created Virtual Boxes #625

Closed
dwt opened this Issue · 8 comments

3 participants

@dwt
dwt commented

If the box does something really heavy sometimes that can bring down the host system. While this is principally a bug in VirtualBox it seems they cannot easily fix it for now.

One really great workaround to the problem is to limit the created boxes to 99% cpu max, so there is always enough left to kill the box if need be.

So here's the request: Make that a default setting so I can be sure I still retain control of my computer, even if the box should misbehave. Then later when VirtualBox has finally fixed the issue (sorry, no bug number right now) remove it again.

@mitchellh
Owner

Hm, I'm not sure if this should be a default, but with the current git-version of Vagrant (to be version 0.9.0) you can just do the following in your Vagrantfile to achieve this result:

config.vm.customize ["modifyvm", :id, "--cpuexecutioncap", "90"]

Where "90" is whatever percentage of the host CPU you'd like to cap it at.

@mitchellh mitchellh closed this
@dwt
dwt commented
@dwt
dwt commented
@leth

Thanks! This tip is useful to me as there appears to be a bug in the OSX version of virtualbox.
Heavy disk i/o can lock the host os at 100% cpu in kernel_task. I've seen it mostly when chef is installing stuff via apt.

@mitchellh
Owner

@leth Does the cpuexectuioncap fix this issue?

@leth

It didn't happen every time, for some reason.
Since adding it I've also only provisioned a box once (which went ok), so I can't really be sure.
I'll let you know if it happens again.

Another symptom was commands on the guest erroring out with 'read-only filesystem' errors, but mount claimed they were all mounted "rw".

@dwt
dwt commented

I'd like to add that despite the cpu usage limits the box would completely block my machine and in one instance even crash it. So sadly this doesn't seem to help anymore or helped out of accident the first instance.

@leth

A college of mine had to lower the limit to 75% to develop on his MacBook air, so perhaps there's not a default which will help for all systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.