Page 1 of 1

VirtualBox can't use all cores on Macbook Pro

Posted: 6. May 2018, 08:48
by XGhosT192
Good afternoon.

I install VirtualBox on Macbook Pro 2016 (13" retina).
CPU is 2.7 GHz Intel Core i5, 2 core / 4 logical cores.

Activity Monitor can see all (4) core
cpu activity.png
cpu activity.png (28.98 KiB) Viewed 2141 times

Code: Select all

bash-3.2$ sysctl -n hw.ncpu
4
bash-3.2$ sysctl -n hw.physicalcpu
2
bash-3.2$ sysctl -n hw.logicalcpu
4
But VirtualBox can not see more than 2 core!

How i can fix this?
And VirtualBox can see on my hardware all of logical cores

Re: VirtualBox can't use all cores on Macbook Pro

Posted: 6. May 2018, 09:04
by socratis
VirtualBox cares about physical processors (cores), not logical ones (threads). So, the number to look at would be:
XGhosT192 wrote:

Code: Select all

bash-3.2$ sysctl -n hw.physicalcpu
2
not
XGhosT192 wrote:

Code: Select all

bash-3.2$ sysctl -n hw.logicalcpu
4
If you want a more detailed analysis, we're going to need a complete VBox.log, from a complete VM run:
  • Gathering the necessary information:
    1. Start the VM from cold-boot (not from a paused or saved state).
    2. Observe the error, i.e. check out the Activity Monitor in the host, in parallel with the Task Manager in the guest.
    3. Shutdown the VM (force close it if you have to).
  • With the VM completely shut down (not paused or saved), right-click on the VM in the VirtualBox Manager and select "Show Log".
  • Save only the first "VBox.log", ZIP it and attach it to your response. See the "Upload attachment" tab below the reply form.

Re: VirtualBox can't use all cores on Macbook Pro

Posted: 6. May 2018, 09:11
by XGhosT192
Thanks a lot.

I collect logs of VM (in attach).
Host OS is Mac OS High Sierra, guest os is Cent OS 7.

VirtualBox give me a warning about incorrect CPU number
CO-VBox-CPU.png
CO-VBox-CPU.png (78.53 KiB) Viewed 2132 times
And tis is what i see in guest OS (4CPU) and Host OS via Activity monitor.
CentOS-4-cpu.png
CentOS-4-cpu.png (45.2 KiB) Viewed 2132 times
But i think some cores in guest os are malfunction...


P.S.
socratis wrote:VirtualBox cares about physical processors (cores), not logical ones (threads). So, the number to look at would be:
Hmm... on another platform (AMD APU) i have also 2 phisical cores and 4 logical.
But VirtualBox see all of them.

Re: VirtualBox can't use all cores on Macbook Pro

Posted: 6. May 2018, 09:54
by XGhosT192
And another strange thing is 100% disk busy on Linux under mac os
disk busy.png
disk busy.png (28.95 KiB) Viewed 2131 times

Re: VirtualBox can't use all cores on Macbook Pro

Posted: 6. May 2018, 10:04
by socratis
00:00:02.325720 CPUM: Logical host processors: 4 present, 4 max, 4 online, online mask: 000000000000000f
00:00:02.325724 CPUM: Physical host cores: 2
00:00:02.233851 NumCPUs <integer> = 0x0000000000000004 (4)
00:00:02.326043 Full Name: "Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz"
As I mentioned, you have assigned all your CPUs to the VM. The host is going to run low on resources, since VirtualBox cares about physical processors (cores), not logical ones (threads). See "CPU Cores versus threads" and "Why is it a bad idea to allocate as many VCPUs as there are physical CPUs?".

Also, take a look at Intel's specifications about your i5-5257U CPU. Click on the "?" next to the "Cores" and the "Threads"...
  • A Core is a hardware term that describes the number of independent central processing units in a single computing component (die or chip).
  • A Thread, or thread of execution (or logical CPU), is a software term for the basic ordered sequence of instructions that can be passed through or processed by a single CPU core.
Source: http://ark.intel.com
XGhosT192 wrote:Hmm... on another platform (AMD APU) i have also 2 phisical cores and 4 logical. But VirtualBox see all of them.
I need to see a VBox.log from that, I can't be making assumptions, it's dangerous to assume without knowing what the heck I'm talking about... ;)