With virtual machines running modern server operating systems,
On a physical computer CPU hot-plugging would mean that a CPU can
be added or removed while the machine is running.
CPU hot-plugging works only with guest operating systems that support the feature. So far this applies only to Linux and Windows Server. Windows supports only hot-add, while Linux supports hot-add and hot-remove. To use this feature with more than 8 CPUs, a 64-bit Linux guest is required.
CPU hot-plugging is done using the
$ VBoxManage modifyvmVM-name --cpu-hotplug on
The
$ VBoxManage modifyvmVM-name --cpus 8
When the VM is off, you can then add and remove virtual CPUs with
the
$ VBoxManage modifyvmVM-name --plug-cpu 3 $ VBoxManage modifyvmVM-name --unplug-cpu 3
Note that CPU 0 can never be removed.
While the VM is running, CPUs can be added and removed with the
$ VBoxManage controlvmVM-name plugcpu 3 $ VBoxManage controlvmVM-name unplugcpu 3
See
With Linux guests, the following applies:
To prevent ejection while the CPU is still used it has to be ejected from within the guest before. The Linux Guest Additions contain a service which receives hot-remove events and ejects the CPU. Also, after a CPU is added to the VM it is not automatically used by Linux. The Linux Guest Additions service will take care of that if installed. If not a CPU can be started with the following command:
$ echo 1 > /sys/devices/system/cpu/cpu<id>/online