I installed Windows XP in Virtualbox under Ubuntu.
After installing XP I want to change the VM to have two cpus.
How to do that without reinstalling XP?
Actually, just change the number of CPUs and the uni-processor HAL should be able to recognize the added cores and trigger new hardware detection and thus changing the HAL.
To actually use 2 cores, you need to enable other options, like "Enable I/O APIC", to use more than one core. See manual.
HAL or hardware abstraction layer is some code that allow the windows kernel to run on different architectures. Normally the installer will detect your hardware configuration and install the correct hal.dll file to your system32 directory. If you "upgrade" your CPU, due to the wonderful compatibility in the X86 family, your old HAL should still work. According to the KB article above, the old HAL should also detect changes in the hardware and trigger the hardware detection process to install a new HAL. If that did not happen, you should be able to do it manually by following the instructions in the KB.
According to this blog post all you have to do is