2

Is there a way to limit the number of logical CPUs that an underlying VM will use (on a Windows 10 host running VMWare Workstation 15 Professional)?

I've tried changing the number of cores per processor but it doesn't have the desired effect. I have 8 cores, but if I set this number to 4, then all 8 cores are still used.

The only solution I know of is to start the VM, get the PID of the VM, and then change the processor affinity (manually) to the logical CPUs I want to limit the VM to use.

I searched the VMWare knowledge base for "limit cpu vmware workstation" (URL is https://kb.vmware.com/s/global-search/%40uri#q=limit%20cpu%20vmware%20workstation&t=Knowledge&sort=relevancy), and get back an error Something went wrong.

This is important because of another question I have, see What VmWare VM is associated with a Process (pid) (on Windows Host)?.

PatS
  • 616

2 Answers2

3

You can manually configure a VM's processor affinity in the vmx file. One line per logical core. For example on an 8 core hyperthreaded cpu:

processor0.use = "TRUE"
processor1.use = "TRUE"
processor2.use = "TRUE"
processor3.use = "TRUE"
processor4.use = "FALSE"
processor5.use = "FALSE"
processor6.use = "FALSE"
processor7.use = "FALSE"
processor8.use = "FALSE"
processor9.use = "FALSE"
processor10.use = "FALSE"
processor11.use = "FALSE"
processor12.use = "FALSE"
processor13.use = "FALSE"
processor14.use = "FALSE"
processor15.use = "FALSE"
Chris
  • 46
2

This is set per VM. To edit the settings for the VM: Select the VM; from the menu choose VM>Settings>Processors and choose "Number of processors" and "Number of cores..." How you allocate between those is less important than the product "Total processor cores'. This is the number of cores allocated to the VM.

Also:

  • Workstation itself will use some CPU power to administrate the VM(s)
  • This will not cap the total amount of cores Workstation will use. If you run two 4-core VMs at the same time, you could be using 8 cores.
User5910
  • 566
  • 1
  • 4
  • 21