Adding additional CPU fails without error

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Mitchellmitchellmitchell
Posts: 11
Joined: 9. Aug 2019, 11:25

Adding additional CPU fails without error

Post by Mitchellmitchellmitchell »

I have a headless Ubuntu host running a headless Ubuntu guest.

The guest was initially configured with 1 CPU. I tried to add CPU's using the following commands

Code: Select all

VBoxManage modifyvm "VM name" --cpuhotplug on
VBoxManage modifyvm "VM name" --cpus 4
VBoxManage modifyvm "VM name" --plugcpu 1
VBoxManage modifyvm "VM name" --plugcpu 2
VBoxManage modifyvm "VM name" --plugcpu 3
None of this returned any errors. Then, loggin into my host I see nothing has changed. top, htop and lshw all show only one cpu. I'm not sure what I'm doing wrong and how to debug this issue.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Adding additional CPU fails without error

Post by socratis »

Does your Ubuntu guest even support CPU hot-plugging? And which Ubuntu are we talking about, 8.04, 16.10, 19.04? You got to give some more details about the setup.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Mitchellmitchellmitchell
Posts: 11
Joined: 9. Aug 2019, 11:25

Re: Adding additional CPU fails without error

Post by Mitchellmitchellmitchell »

Let it be said I am entirely unfamiliar with hardware and understand next to nothing about CPUs and computers. I'll try to add all required information, but a lot will probably be missing. Please bear with me.

The HOST is an Ubuntu 14.04.6 system, with 4 Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz cores. According to HTOP the system has 16gb of memory.
I am using virtualboxmanage 4.3.40, which is (as I understand it) the last version for this old Ubuntu 14 system.

The guest is running Ubuntu 12. It's all really old but upgrading it is outside of my control. Below is the showvminfo for this VM

Code: Select all

name:            Ubuntu 12
Groups:          /
Guest OS:        Other/Unknown
UUID:            c48af8ae-6058-463e-a671-f1f567e83d6e
Config file:     /data_nfs/VM/Ubuntu 12/Ubuntu 12.vbox
Snapshot folder: /data_nfs/VM/Ubuntu 12/Snapshots
Log folder:      /data_nfs/VM/Ubuntu 12/Logs
Hardware UUID:   c48af8ae-6058-463e-a671-f1f567e83d6e
Memory size:     8192MB
Page Fusion:     off
VRAM size:       8MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  4
PAE:             on
Long Mode:       on
Synthetic CPU:   off
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          off
Time offset:     0ms
RTC:             local time
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
VT-x unr. exec.: on
State:           running (since 2019-09-23T09:34:43.084000000)
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_12
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
IDE_12 (0, 0): /data_nfs/VM/Ubuntu 12/Snapshots/{5f697831-a8a8-4e8b-8f06-c3e57365ea71}.vdi (UUID: 5f697831-a8a8-4e8b-8f06-c3e57365ea71)
IDE_12 (0, 1): /usr/share/virtualbox/VBoxGuestAdditions.iso (UUID: 959664fb-b1f2-4991-b241-6a71d282f5c4)
IDE_12 (1, 0): /data_nfs/VM/Ubuntu 12/Snapshots/{a9626dfd-6ea5-4859-b761-bda84f3913a6}.vdi (UUID: a9626dfd-6ea5-4859-b761-bda84f3913a6)
NIC 1:           MAC: 080027DF6EA8, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: Am79C973, 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 1 Rule(0):   name = guest4433, protocol = tcp, host ip = , host port = 4433, guest ip = , guest port = 443
NIC 1 Rule(1):   name = guest80, protocol = tcp, host ip = , host port = 8080, guest ip = , guest port = 80
NIC 1 Rule(2):   name = guestftp, protocol = tcp, host ip = , host port = 2233, guest ip = , guest port = 2200
NIC 1 Rule(3):   name = guestssh, protocol = tcp, host ip = , host port = 2222, guest ip = , guest port = 22
NIC 1 Rule(4):   name = jupyterhost, protocol = tcp, host ip = , host port = 8889, guest ip = , guest port = 8889
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           disabled
Clipboard Mode:  disabled
Drag'n'drop Mode: disabled
Video mode:      640x480x32 at 0,0
VRDE:            disabled
USB:             disabled
EHCI:            disabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

VRDE Connection:    not active
Clients so far:     0

Video capturing:    not active
Capture screens:    0
Capture file:       /data_nfs/VM/Ubuntu 12/Ubuntu 12.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB
OS type:                             Linux26_64
Additions run level:                 2
Additions version:                   4.3.40 r110317


Guest Facilities:

Facility "VirtualBox Base Driver": active/running (last update: 2019/09/23 09:34:56 UTC)
Facility "VirtualBox System Service": active/running (last update: 2019/09/24 08:14:48 UTC)
Facility "Seamless Mode": not active (last update: 2019/09/24 08:14:48 UTC)
Facility "Graphics Mode": not active (last update: 2019/09/23 09:34:56 UTC)

Snapshots: increasing size (UUID: 472e5451-60a9-4ed4-8e59-f40b839b814c) *
As can be seen the number of CPUs is set to 4. As far as I understand the documentation (which I barely understand. Most of it is explained at a level I don't understand (i.e. I don't know anything about computers).

When running the guest however, if I open /proc/cpuinfo, it shows me only one time Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz. I'm not sure if I'm doing something wrong with virtualbox, or if I need to somehow let the guest know it has more CPU now?

I'm unsure how to proceed.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Adding additional CPU fails without error

Post by socratis »

Why exactly do you want to hot-plug a CPU? This is really advanced operations, not a lot of people have attempted it. What are you trying to "solve"?

We need to see a complete VBox.log, from a complete VM run, where the problem occurs:
  • Start the VM from cold-boot (not from a paused or saved state) / Observe or recreate the problem / 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.
Image
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Mitchellmitchellmitchell
Posts: 11
Joined: 9. Aug 2019, 11:25

Re: Adding additional CPU fails without error

Post by Mitchellmitchellmitchell »

My intention is simply to increase the CPU power (?) of the guest.

The guest can be switched on/off. I only have access to the host (and guest) over the command line.

I have attached a zip of the VBox.log.

There is not real error anywhere, since the guest just runs normally (but without the increased CPU that I'm trying to accomplish)
As such, the log is starting the vm, me opening /proc/cpuinfo and then shutting down the vm again.

I believe this is what you requested. I hope it helps :)
Attachments
VBox.rar
(16.98 KiB) Downloaded 11 times
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Adding additional CPU fails without error

Post by socratis »

Mitchellmitchellmitchell wrote:My intention is simply to increase the CPU power (?) of the guest.
By ... hotplugging the CPUS? :shock:
How about shutting down the guest and making the changes? Especially when you say:
Mitchellmitchellmitchell wrote:The guest can be switched on/off
Then, just simply shutdown the guest, increase the numbers of CPUs at will, restart the guest. It's much easier to change the hardware, while the computer is not running! And even though you say that you don't know too much about hardware, that part should be more than obvious; you don't add more wheels to a car while you're moving, it has to be a really special crafted car...
Mitchellmitchellmitchell wrote:I only have access to the host (and guest) over the command line
That's OK, that's the idea...
Mitchellmitchellmitchell wrote:I am using virtualboxmanage 4.3.40, which is (as I understand it) the last version for this old Ubuntu 14 system.
Wrong I'm afraid. Did you see the Linux Downloads page? There's a specific Ubuntu 14.04 package there. Download it and install it so that we're on the same page; the page of "today"... ;)


PS. I actually downgraded to 4.3.40 without even checking, I took your word for it. And I installed a 12.04 guest so that we're on the same page. I'm planning to "restoring order" and switch to 6.0.14. Do the same...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Mitchellmitchellmitchell
Posts: 11
Joined: 9. Aug 2019, 11:25

Re: Adding additional CPU fails without error

Post by Mitchellmitchellmitchell »

Hey,

I updated to virtualbox-6.0. I think I mistook it for the last one, because it was given to me by upgrading virtual box via apt-get. At first it didn't work, but after re-installing I can run my guest again.

Based on this line in the docs, I though I would require hotplugging. "--cpus Sets the number of virtual CPUs for the virtual machine, see Section 3.5.2, “Processor Tab”. If CPU hot-plugging is enabled, this then sets the maximum number of virtual CPUs that can be plugged into the virtual machines." What's more, I can only find this about adding CPUs (https://www.virtualbox.org/manual/ch09.html#cpuhotplug) I know there must be more, but I can't find anything. In the end, I don't really care about hot-plugging. I just can't find any alternative way of doing it.

Now, with the virtualbox6.0, I tried to increase the cpus.

Originally showvminfo said "Number of CPUs: 4". To see if I can get it to change I tried

Code: Select all

VBoxManage modifyvm "Ubuntu 12" --cpus 2
This indeeds changes it too: "Number of CPUs: 2"

Then when turning on my guest, I still only see one cpu in /proc/cpuinfo
Mitchellmitchellmitchell
Posts: 11
Joined: 9. Aug 2019, 11:25

Re: Adding additional CPU fails without error

Post by Mitchellmitchellmitchell »

Mitchellmitchellmitchell wrote:I updated to virtualbox-6.0. I think I mistook it for the last one, because it was given to me by upgrading virtual box via apt-get. At first it didn't work, but after re-installing I can run my guest again.
Turns out that the 'reinstall' I did was actually implicitly reverting to the older version.

I updated to version 6.0.14 again. I can run commands using VBoxManage. However, VBoxHeadless appears to no longer be worker.

I try to start my guest using the commands I would use before

Code: Select all

(venv) rootadmin@annotatie01:/data_nfs$ VBoxHeadless --startvm "Ubuntu 12" --vrde off &                                                      [1] 24724
(venv) rootadmin@annotatie01:/data_nfs$ VBoxHeadless: Error -1912 in supR3HardenedMainInitRuntime!
VBoxHeadless: RTR3InitEx failed with rc=-1912

VBoxHeadless: Tip! It may help to reinstall VirtualBox.
I tried the re-install, but that did not change anything. I figured it might be because the architecture is different (the linux download page mentions this). But my system appears to be 64x and I have installed this one according to dpkg.

Code: Select all

 ii  virtualbox-6.0                         6.0.14-133895~Ubuntu~trusty                amd64        Oracle VM VirtualBox
So that (appears) to be good to me. What should I do next?

EDIT: Any VBoxHeadless command returns the same error.

(venv) rootadmin@annotatie01:/data_nfs$ VBoxHeadless --help
VBoxHeadless: Error -1912 in supR3HardenedMainInitRuntime!
VBoxHeadless: RTR3InitEx failed with rc=-1912

VBoxHeadless: Tip! It may help to reinstall VirtualBox.
Post Reply