Guest info shows 2 CPUs, but inside there is only one

Discussions related to using VirtualBox on Linux hosts.
Post Reply
ralthor
Posts: 4
Joined: 8. Mar 2020, 02:55

Guest info shows 2 CPUs, but inside there is only one

Post by ralthor »

I have installed VirtualBox 5.2.34_Ubuntur133883 on an Ubuntu 18.04 dedicated server, without GUI. I have had around 20 guest machines for more than a month, each had one CPU.

I changed the number of CPUs for one of them, to 2, and then 8. The change is shown in the vminfo, but inside the guest it is only one CPU. Of course I have restarted the guest several times. I used this command:

Code: Select all

vboxmanage modifyvm worker3-4x-1 --cpus 8
This is the worker info (the number of CPUs is shown 8 here):

Code: Select all

Name:            worker3-4x-1
Groups:          /                                                                                                                                                                   [57/1923]
Guest OS:        Ubuntu (64-bit)
UUID:            c2d9a0d1-35d2-4ccf-8940-cabdd83a8081
Config file:     /home/robert/VirtualBox VMs/worker3-4x-1/worker3-4x-1.vbox
Snapshot folder: /home/robert/VirtualBox VMs/worker3-4x-1/Snapshots
Log folder:      /home/robert/VirtualBox VMs/worker3-4x-1/Logs
Hardware UUID:   c2d9a0d1-35d2-4ccf-8940-cabdd83a8081
Memory size:     8192MB
Page Fusion:     off
VRAM size:       16MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  8
PAE:             on
Long Mode:       on
Triple Fault Reset: off
APIC:            on
X2APIC:          on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): HardDisk
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          off
BIOS APIC mode:  APIC
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     on
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
Effective Paravirt. Provider: KVM
State:           powered off (since 2020-04-23T08:20:42.300000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration:
Autostart Enabled: off
Autostart Delay: 0
Default Frontend:
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (1, 0): Empty
SATA (0, 0): /home/robert/VirtualBox VMs/worker3-4x-1/worker3-4x-1-disk1.vmdk (UUID: 67595f5b-0c80-4b68-8c96-def7c7bc5657)
NIC 1:           MAC: 08002715527C, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 2:           MAC: 0800273EA49B, Attachment: Host-only Interface 'vboxnet1', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
UART 3:          disabled
UART 4:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: ALSA, Controller: AC97, Codec: AD1980)
Audio playback:  enabled
Audio capture:   disabled
Clipboard Mode:  disabled
Drag and drop Mode: disabled
VRDE:            disabled
USB:             enabled
EHCI:            disabled
XHCI:            disabled

USB Device Filters:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

Capturing:          not active
Capture audio:      not active
Capture screens:    0
Capture file:       /home/robert/VirtualBox VMs/worker3-4x-1
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25
Capture options:

Guest:

Configured memory balloon size:      0 MB

The host machine has 56 CPUs. It is the information for the 1st CPU of the host machine (using cat /proc/cpuinfo command):

Code: Select all

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz
stepping        : 4
microcode       : 0x2000064
cpu MHz         : 1000.032
cache size      : 19712 KB
physical id     : 0
siblings        : 28
core id         : 0
cpu cores       : 14
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 5200.00
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

I don't know if it is usable, but the result of running dmesg | grep "smp" in the guest is as follows:

Code: Select all

[    0.000000] smpboot: Boot CPU (id 0) not listed by BIOS
[    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.018517] smpboot: SMP disabled
[    0.021123] smp: Bringing up secondary CPUs ...
[    0.021292] smp: Brought up 1 node, 1 CPU
[    0.021446] smpboot: Max logical packages: 1
[    0.021606] smpboot: Total of 1 processors activated (5199.94 BogoMIPS)
And the CPU information for guest machine:

Code: Select all

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz
stepping        : 4
cpu MHz         : 2599.972
cache size      : 19712 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase avx2 invpcid rdseed clflushopt md_clear flush_l1d
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips        : 5199.94
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

I guessed if it is something with Ubuntu, so I tested it on a Windows host I have and changed the number of CPUs to 2 for an Ubuntu 16.04 guest. It is shown correctly inside the guest machine.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Guest info shows 2 CPUs, but inside there is only one

Post by scottgus1 »

ralthor wrote:I have installed VirtualBox 5.2.34_Ubuntur133883
If this download came from Ubuntu's repository instead of https://www.virtualbox.org/wiki/Linux_Downloads, then that is Ubuntu's fork of Virtualbox, and we don't support it here on the forum. If it was Ubuntu's fork, please rplace it with the official Virtualbox then see what happens.

According to Intel, the Xeon® Gold 6132 has 14 cores, 28 threads. So it's a 14-core hyperthreaded processor. If you have 4 of those monsters in your computer, then you have 56 cores. If only 2 Xeons, then you have 28 cores. Hyperthreads don't count for Virtualbox.

Some OS's, like XP, don't recognize CPU count changes if the install was done with one CPU, since the HAL needs to be replaced. Other OS's might see the increase. You will have to research what, if anything, might need to be done to get the guest OS to see the increased core count. Does the same guest OS see the change in core count if it is freshly installed in a new guest with the core count set more than 1 from the beginning?

If you see the same issue after confirming/changing so you are running the official Virtualbox, then try this:

1. Make a new guest with one CPU, install the guest OS. Start from full power off, log in, then shut down. Save and properly title a guest vbox.log.

2. Increase the core count to 2. Start from full power off, log in, then shut down. Save and properly title another guest vbox.log.

3. Now make a second new guest with two CPU, install the same guest OS. Start from full power off, log in, then shut down. Save and properly title another guest vbox.log.

4. Increase the core count on the second guest to 3. Start from full power off, log in, then shut down. Save and properly title another guest vbox.log.

5. Decrease the core count on the second guest to 1. Start from full power off, log in, then shut down. Save and properly title another guest vbox.log.

Zip all of these guest vbox.logs and post the zip, using the forum's Upload Attachment tab. Please be sure to doublecheck the official Virtualbox first. There's no telling what to do if you run all these tests on the Ubuntu fork.
ralthor
Posts: 4
Joined: 8. Mar 2020, 02:55

Re: Guest info shows 2 CPUs, but inside there is only one

Post by ralthor »

Thank you for your reply.

I had another Linux machine with the same operating system, so I installed VirtualBox from https://www.virtualbox.org/wiki/Linux_Downloads there, then imported my guest there, though the issue still persisted.

I also imported the guest to my local machine, in which I have installed VirtualBox with GUI. Here, when I tried to increase the number of the CPUs, it warned me about an "Invalid setting" in Motherboard section. There was "I/O APIC" disabled. Therefore, I made this change in Linux and the case is resolved:

:idea: This solved the issue:

Code: Select all

vboxmanage modifyvm worker1-2x --cpus 2 --ioapic on
Maybe such warning was also written in a log somewhere in the command line version, but since in the GUI version there was an obvious warning, I noticed what caused the issue.
Last edited by ralthor on 27. Apr 2020, 04:02, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Guest info shows 2 CPUs, but inside there is only one

Post by scottgus1 »

Good! Glad you found a solution!
Post Reply