Page 1 of 1
[VirtualBox4.3.20]Force Single CPU usage
Posted: 10. Dec 2014, 09:43
by drexennol
I am working with VB 4.3.20 with a WinXP/32bit VM on a Win7/32-bit host.
Running a two-core cpu and I actually want to force the VM to use the secondary core(CPU 1, instead of CPU 0).
Is there any way I can do this?
Re: [VirtualBox4.3.20]Force Single CPU usage
Posted: 10. Dec 2014, 10:40
by socratis
Why do you care? Seriously, do you favor 'odd' numbers for some reason? Your host OS has all sorts of algorithms to figure out how to balance the load and you going in there and messing with the affinity manually, is not the greatest idea in the world.
That being said, you can assign the affinity (this is what's it called when you assign specific processes to specific CPUs) in the Task Manager. Hit 'Ctrl-Shift-Esc' and under the 'Processes' tab, select the VirtualBox process, right-click on it, select 'Set Affinity...' and choose the CPUs that you want. As far as I know, you have to do this every time you launch the VM, i.e. there no permanent way, unless I'm missing something obvious.
Re: [VirtualBox4.3.20]Force Single CPU usage
Posted: 10. Dec 2014, 14:57
by drexennol
socratis wrote:Why do you care? Seriously, do you favor 'odd' numbers for some reason? Your host OS has all sorts of algorithms to figure out how to balance the load and you going in there and messing with the affinity manually, is not the greatest idea in the world.
I have older applications (for the host) that can only use one core and is always on default(CPU 0) so yeah.
socratis wrote:
That being said, you can assign the affinity (this is what's it called when you assign specific processes to specific CPUs) in the Task Manager. Hit 'Ctrl-Shift-Esc' and under the 'Processes' tab, select the VirtualBox process, right-click on it, select 'Set Affinity...' and choose the CPUs that you want. As far as I know, you have to do this every time you launch the VM, i.e. there no permanent way, unless I'm missing something obvious.
I can't. It says access is denied and I already have elevated access. If there is a certain flag/setting for this, I'm all ears.
Re: [VirtualBox4.3.20]Force Single CPU usage
Posted: 14. Dec 2014, 08:13
by drexennol
SHAMELESS BUMP.
Re: [VirtualBox4.3.20]Force Single CPU usage
Posted: 14. Dec 2014, 11:54
by socratis
OK, your problem puzzled me and I had to search quite some time for a solution. What I found is that there are some processes that allow you to set their affinity and some that do not. Still haven't figured out the rules as to why that happens (will look at it some more).
But... I found this little gem called 'CPU-Control' (
http://www.koma-code.de/index.php?optio ... &Itemid=93). It allows you to set the affinity of processes a little bit better and easier compared to the TaskManager. When you launch VirtualBox.exe (just the 'VirtualBox Manager', without any VM running) you get one (1) process. If you launch a VM you get three (3) more processes named VirtualBox.exe. From these, you can set the affinity of
only one. The rest are
not affected.
But (2nd but)... You could leave the untouchable VirtualBox.exe processes alone and change the affinity of your "other" process (the one that you care about), to be bound to a different CPU. Give it a shot.
For example, in the example below, I assigned CPU2 as the system "profile". That's because the untouchable VirtualBox.exe processes would run only on CPU2 and could not be changed. Then I manually chose Firefox to be bound to CPU1.

- CPU-Control.png (30.44 KiB) Viewed 2688 times