Need help assigning cpu resources

This is for discussing general topics about how to use VirtualBox.
Post Reply
ipreferanonymity
Posts: 2
Joined: 28. Oct 2021, 17:03

Need help assigning cpu resources

Post by ipreferanonymity »

Hi all. Please humor me here as my knowledge of VB is rather lacking...

I have a minimal UbuntuMATE install set up for running VirtualBox - 1 vm. I want to assign maximum cpu resources to it (without causing issues for UbuntuMATE - which I gather is using very little resources).

The specs for my processor (i5-8259U) is 4 cores and 8 threads. Currently I have the vm configured for 4 cores. Does that sound right? I'm assuming it doesn't mean sockets? Do threads come into play anywhere in the settings (I recall them being asked for in vmware)?

Thanks much!
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Need help assigning cpu resources

Post by scottgus1 »

Only the cores, not the hyperthreads, should be counted. So your CPU has 4 processors for Virtualbox purposes, not 8.

Each "processor" in the VM is really a thread (or set of threads?) on the host CPU. The more "processors", the more threads, the more the host OS has to schedule, so the slower the VM will work.

The VM should have as few processors as possible for the tasks the VM will perform. Modern OS's such as Windows 10 like 2 processors for normal word processing, web browsing & video watching. When 3rd-party multithreaded apps get installed in the VM that can fill up more "processors", then add more processors.

However, one can add too many "processors". Under rare esoteric circumstances such as compiling code, more "processors" in the VM than cores existing on the host CPU can work, but usually it's a bad idea not to give more cores to a VM than the host has, and also leave one for the host.

So a VM on your host shouldn't have more than 3 processors when 3rd-party multithreaded apps are present. If it's a vanilla, unmodified OS in the VM, just 2. If it's an older OS, 1 or 2 depending on needs. (For example, XP came out when 1 core was just about all that there was, but it runs more responsively when there's two).

Of course, experiments are possible, so setting 4 processors in the VM may work OK for your tasks.
ipreferanonymity
Posts: 2
Joined: 28. Oct 2021, 17:03

Re: Need help assigning cpu resources

Post by ipreferanonymity »

Thanks so much, I really appreciate you sharing your wisdom!
Last edited by mpack on 28. Oct 2021, 20:57, edited 1 time in total.
Reason: Delete verbatim quote of previous post.
Post Reply