Page 1 of 1
Using WinXp Guest in Another vbox with Different # of CPU
Posted: 11. Feb 2015, 13:06
by AsusUser
I installed my guest Winxp Sp3 in a 2 cores machine. Can I use the VDI in another virtual box machine exposing a different # of cores? Sometimes, I'm running vbox on a PC with its hardware virtualization disabled by the password protected BIOS (and I'm not authorized to change the BIOS setting), hence there is a single core only. Sometimes, I can access another quad core machine with hw virtualization enabled, hence I can have quad cores.
Not sure if there are any issues in changing the # of CPU exposed to WinXp since I'm having an impression that different version of the Windowa kernel is used for different # of cores.
(my host is Win7, but this shouldn't relevant)
Re: Using WinXp Guest in Another vbox with Different # of CP
Posted: 11. Feb 2015, 13:15
by mpack
As far as VirtualBox is concerned, yes you can change the number of cores assigned to the VM, provided the host supports VT-x or AMD-v.
As far as your XP guest is concerned, that depends on what version of XP was installed. You need to have installed the multiprocessor HAL before XP will recognize multiple processors. If you know what you're doing (or you do some research) then it is also possible to change the HAL of an existing XP installation.
In addition, the CPU type counts heavily in XP activation. If your XP installation is of a type that requires activation (i.e. retail XP) then it will most likely need to be reactivated after a CPU change.
Finally: I would try to dissuade you from providing more cores to a VM than it needs. Users often naively assume that performance is proportional to the number of cores, when quite often the opposite is true (i.e. performances goes down).
Re: Using WinXp Guest in Another vbox with Different # of CP
Posted: 11. Feb 2015, 13:36
by AsusUser
mpack wrote:Finally: I would try to dissuade you from providing more cores to a VM than it needs. Users often naively assume that performance is proportional to the number of cores, when quite often the opposite is true (i.e. performances goes down).
why is it so?
Re: Using WinXp Guest in Another vbox with Different # of CP
Posted: 11. Feb 2015, 13:41
by mpack
Because every core added to the VM creates extra overhead which is not compensated by extra performance unless the guest application is specifically designed to use additional CPUs. Applications have to be written to use X CPUs: the programmer has to decide to run this function on that core, this other function on that other core, etc. For most apps X is 1, because that makes them compatible with all PCs plus is easier for the programmer to think about. The notion that you can automatically get extra performance by adding CPUs is a mostly a marketing scam aimed at unsuspecting users in order to sell this years PCs: which for most people will perform no better than last years.
The analogy I like to use is: plonking a second engine in the boot of your car (not connected to anything) conceptually doubles the horsepower available. Does it double the car's speed? The PC manufacturer lets you believe that the answer is yes.
Re: Using WinXp Guest in Another vbox with Different # of CP
Posted: 12. Feb 2015, 12:29
by noteirak
I would like a note to what mpack said: While he is totally right in saying a single application has to be designed to use multi core, it might use a framework that does it directly.
Another note is that the guest OS WILLtake advantage of several CPUs to run the different processes (if it was installed when the VM was configured with more than one CPU that is)
So having more than one CPUs tends to give some breathing rooms for modern OS with their douzens background processes doing coffee and what not.
Mpack is also right in the activation bit - don't mess with CPU settings for a Windows guest, it's usually not a good idea.
At the end of the day, it all depends what you will run in the guest OS : if you plan on running a single regular non-cpu intensive application (like a browser), single cpu is enough for the guest.
To answer the technical part of your question: There is no problem changing the number of CPUs in the VM config prior running it in the different hosts, from VirtualBox point of view.
The guest OS might complain. Linux-based will be fine, Windows should be fine if you put the activation bit aside.
All this with the condition that the guest OS was installed when the VM was configured to use more than one CPU.
Re: Using WinXp Guest in Another vbox with Different # of CP
Posted: 12. Feb 2015, 14:04
by mpack
noteirak wrote:So having more than one CPUs tends to give some breathing rooms for modern OS with their douzens background processes
That's true. A modern OS will make use of multiple cores, e.g. a good use might be one core for background processes (though in fact it probably only uses a fraction of that core), and then one core per app.
What I was countering was the assumption (no caveats) that throwing
more CPUs at a problem inevitably improves performance. In the common case of a single CPU bound app running in a VM, in most cases there will be no additional benefit for X>2, in fact for a VM this will result in a loss of performance. If the VM is not CPU bound then extra cores doesn't help at all, and always causes a loss of performance in a VM.
Re: Using WinXp Guest in Another vbox with Different # of CP
Posted: 12. Feb 2015, 15:11
by noteirak
As I said earlier, fully agree with you.
Re: Using WinXp Guest in Another vbox with Different # of CP
Posted: 17. Feb 2015, 16:49
by martyscholes
AsusUser wrote:mpack wrote:Finally: I would try to dissuade you from providing more cores to a VM than it needs. Users often naively assume that performance is proportional to the number of cores, when quite often the opposite is true (i.e. performances goes down).
why is it so?
This is especially true when there are multiple sockets.
viewtopic.php?f=3&t=64268&p=304695