Change a VM's settings
It is absolutely safe to increase or decrease the number of CPUs for your already installed virtual machine. In case we use all host CPU cores we may want to consider an execution cap (e.g. 90%) to allow the host OS to operate smoothly while running a virtual machine.
We can also freely assign more or less RAM or VRAM in the machine's settings after installation.
Nearly all settings can be adapted later, including USB support, Networking, Audio cards, and more.
Hotplug CPUs
When running Ubuntu as a guest it is even possible to hotplug a CPU while a virtual machine is running. Provided we had installed the guest additions we enable CPU hotplugging while the VM is not running with these commands:
VBoxManage modifyvm "VM name" --cpuhotplug on
VBoxManage modifyvm "VM name" --cpus 3 ## maximum number of CPUs
After that we can assign (plug
) or remove (unplug
) a CPU of a running instance with one of the following commands:
VBoxManage controlvm "VM name" plugcpu 1 ## number of CPU
VBoxManage controlvm "VM name" unplugcpu 1
Note that we can not unplug CPU 0
for obvious reasons.
It is not possible to change the amount of RAM assigned to the guest during runtime except we use memory ballooning, a technique to move already assigned RAM from one to another running virtual machine.