Page 1 of 1

Processor option grayed out

Posted: 8. Jun 2017, 20:21
by DMR
Hi,
Just installed VirtualBox VM on iMac Dual core - El Capitan.
Installed OK.

However, only using 1 Processor.
Going into Machine/Settings/System/Processor - the Processor(s) option is greyed out - so can't increase no. of processors to use.

Advice welcome.

David

Re: Processor option grayed out

Posted: 8. Jun 2017, 20:28
by socratis
Did you shutdown the VM before you tried to change the # of vCPUs? And I mean completely shutdown, not saved state, nor paused.

Re: Processor option grayed out

Posted: 8. Jun 2017, 22:32
by erdeslawe
@DMR

You said: "Just installed VirtualBox VM on iMac Dual core"

If you have only 2 Cores; and do give more than one Core to any Guest, what's the Host supposed to use?

Re: Processor option grayed out

Posted: 9. Jun 2017, 20:44
by DMR
Socratis - thanks - now that you mention it, it seems obvious. I'll do that when I can.
I now remember I had to do that when I used VNMWare Fusion.

erdeslawe
That's what multi-tasking's for. A virtual process is just a task on a core. At least, that's how it works in Fusion. I've no reason to think Virtualbox is different.

Re: Processor option grayed out

Posted: 9. Jun 2017, 20:59
by scottgus1
Unexpectedly, Virtualbox is different. If you give all your host cores to the guest, you may not have trouble all the time. But there will be times the gust OS will go full-throttle down the trench to keep those fighters off its tail, then your host is going to start wondering, who's got their hand round my throat and choking me out of existence? Thusly the recommendation to never have the same or more number of cores in your guest as the host has.

Re: Processor option grayed out

Posted: 10. Jun 2017, 00:00
by DMR
scottgus1 Thanks - well we live and learn. That's quite surprising. Presumably that will not happen if the host is only requesting small resources???

Re: Processor option grayed out

Posted: 10. Jun 2017, 00:14
by socratis
I have an excerpt that I use for question like this:
Ramshankar in a [url=https://forums.virtualbox.org/viewtopic.php?f=1&t=79734#p373129]recent post[/url] wrote:
Why is it a bad idea to allocate as many VCPUs as there are physical CPUs?

You cannot have the best of both worlds. Most modern Intel CPUs have VT-x preemption timers, which VirtualBox has been using for years now. This lets us run chunks of guest code and still get interrupted to run host code depending on how we program the preemption timer. However, the question is not whether we can or cannot interrupt guest code, we normally can. The problem is that there are tasks that require to be run in reasonable frequency & amount of time both on the host *and* the guest. If you starve the host or guest of interrupts or introduce latency because there simply isn't enough compute power available, you will be creating bottlenecks.

Getting in and out of executing guest code via VT-x is still quite an expensive operation. We call it a world-switch or world round-trip, (i.e. VM-entry, execute guest, VM-exit). This is done in ring-0 (kernel) on the host, sometimes (especially on Windows hosts) we are forced to return all the way to ring-3 sometimes in order to satisfy DPC (Deferred Procedure Call) latency. Overall, you're going to have strange latencies introduced in unexpected places if you "overcommit". It is totally possible to run 4 VCPU VM on a 4 CPU host (I do it on my own my Linux dev box sometimes) but it is not something you should be doing if you care about reasonable performance; in extreme cases of overcommitment you may encounter program misbehavior (like when disk requests times out) which the programs are never designed to handle. In the not so severe case you may end up with some strange timeouts but not fatal errors.

Re: Processor option grayed out

Posted: 10. Jun 2017, 12:24
by DMR
socratis - Thanks, that's useful, I understand that completely. When I'm running tasks in VB I don't use the host for very much else.

On occasions, using Fusion, I ran intensive tasks on both the host and VB without problems. Perhaps OSX has better interupt handling?

Re: Processor option grayed out

Posted: 10. Jun 2017, 12:32
by DMR
Should have said "host and guest without problems".

Re: Processor option grayed out

Posted: 10. Jun 2017, 12:42
by socratis
It's all relativeā„¢. I've run a guest (on several occasions) with 8 vCPUs when my host has 4 CPUs, 8 with hyperthreading. I knew what I was doing (math calculations only, Handbrake encoding) and I left the guest running without touching my host. It worked. But if it didn't, that would be the first place to look into and/or change.