How to Check CPU Cores and Virtual Processors (vCPUs) Assigned to a Virtual Machine in Windows, VMware, Hyper-V, and VirtualBox
Virtualization has become a fundamental technology in modern IT infrastructure. Whether you are using VMware ESXi, VMware Workstation, Microsoft Hyper-V, Vir...
Virtualization has become a fundamental technology in modern IT infrastructure. Whether you are using VMware ESXi, VMware Workstation, Microsoft Hyper-V, VirtualBox, Proxmox VE, or cloud platforms such as Microsoft Azure and Amazon AWS, understanding how many CPU resources are allocated to a Virtual Machine (VM) is essential for performance tuning, troubleshooting, licensing, and capacity planning.
Many users confuse physical CPU cores, logical processors, virtual processors (vCPUs), sockets, and threads. This article explains these concepts in detail and demonstrates multiple methods to determine how many CPU cores are assigned to a virtual machine.
Understanding CPU Terminology
Before checking CPU allocation, it is important to understand the terminology.
Physical CPU (Processor)
A physical CPU is the actual processor installed on the server motherboard.
Example:
Intel Xeon Gold 6248R
A server may have one, two, four or more physical processors.
CPU Socket
A CPU socket is the location on the motherboard where a processor is installed.
Example:
Socket 1
Socket 2
A dual-processor server has two sockets.
Physical Core
Each processor contains multiple independent processing units known as cores.
Example:
Intel Xeon Gold 6248R
24 Physical Cores
Logical Processor
When Hyper-Threading is enabled, each physical core appears as two logical processors.
Example:
24 Physical Cores
48 Logical Processors
Virtual CPU (vCPU)
A Virtual CPU is the processing unit assigned to a virtual machine.
For example:
VM
24 vCPUs
The VM does not necessarily know whether these are physical or logical cores.
Why Check CPU Allocation?
Knowing the number of allocated CPU cores helps in:
- Performance troubleshooting
- Capacity planning
- Licensing compliance
- Application optimization
- SQL Server sizing
- Windows Server licensing
- Virtual infrastructure auditing
- Resource balancing
- Preventing CPU over-allocation
Method 1: Check Using PowerShell
Open Windows PowerShell.
Run:
Get-CimInstance Win32_Processor | Select Name, NumberOfCores, NumberOfLogicalProcessors
Example output:
Name NumberOfCores NumberOfLogicalProcessors
Intel Xeon Gold 6248R CPU 12 12
Intel Xeon Gold 6248R CPU 12 12
Interpretation:
- Two virtual processors
- Twelve cores each
- Total allocated vCPUs = 24
Calculate Total CPU Cores
Run:
(Get-CimInstance Win32_Processor |
Measure-Object NumberOfCores -Sum).Sum
Output
24
Calculate Total Logical Processors
(Get-CimInstance Win32_Processor |
Measure-Object NumberOfLogicalProcessors -Sum).Sum
Output
24
Method 2: Using Command Prompt
Open Command Prompt.
Run:
wmic cpu get Name,NumberOfCores,NumberOfLogicalProcessors
Example
Name
Intel Xeon Gold 6248R
NumberOfCores
12
NumberOfLogicalProcessors
12
If multiple CPUs are present, multiple rows will appear.
Method 3: Using Task Manager
Press
Ctrl + Shift + Esc
Open
Performance
↓
CPU
You will see
Sockets
Cores
Logical Processors
Virtualization
Base Speed
Current Speed
L1 Cache
L2 Cache
L3 Cache
Example
Sockets
2
Cores
24
Logical Processors
24
Method 4: Using System Information
Run
msinfo32
Navigate to
System Summary
Look for
Processor
Installed Physical Memory
System Type
Method 5: VMware ESXi
Login to
vSphere Client
Select
Virtual Machine
↓
Edit Settings
↓
CPU
You will see
Number of Sockets
Cores per Socket
Total vCPUs
Example
2 Sockets
12 Cores per Socket
24 vCPUs
Method 6: VMware Workstation
Shutdown the VM.
Open
VM
↓
Settings
↓
Processors
Displays
Processors
Cores per Processor
Total CPUs
Method 7: Microsoft Hyper-V
Run
Get-VMProcessor -VMName "YourVM"
Example
Count : 24
Meaning
24 Virtual Processors
Method 8: VirtualBox
Open
Settings
↓
System
↓
Processor
The processor slider indicates the allocated vCPUs.
Method 9: Linux Virtual Machine
Run
lscpu
or
cat /proc/cpuinfo
Understanding Your Example
PowerShell Output
Intel Xeon Gold 6248R
12 Cores
12 Logical
Intel Xeon Gold 6248R
12 Cores
12 Logical
Interpretation
Virtual CPU Sockets : 2
Cores per Socket : 12
Total vCPUs : 24
Logical Processors : 24
This means your VM has been assigned 24 virtual CPU cores.
Best Practice for VM CPU Configuration
For general-purpose Windows Server VMs:
Preferred
1 Socket
24 Cores
Instead of
2 Sockets
12 Cores
Advantages include:
- Better Windows scheduling
- Simplified licensing
- Improved NUMA optimization in many environments
- Easier management
- Better compatibility with certain applications
However, always follow the recommendations of your virtualization platform and software vendor, as some enterprise workloads (such as SQL Server or Oracle) may benefit from specific socket/core configurations.
Common Mistakes
❌ Confusing physical cores with virtual cores.
❌ Assuming logical processors equal physical cores.
❌ Allocating more vCPUs than required.
❌ Ignoring NUMA boundaries on large servers.
❌ Believing more CPUs always improve performance.
Useful PowerShell Commands
Display processor details:
Get-CimInstance Win32_Processor
Total cores:
(Get-CimInstance Win32_Processor).NumberOfCores
Total logical processors:
(Get-CimInstance Win32_Processor).NumberOfLogicalProcessors
CPU information:
Get-ComputerInfo | Select CsProcessors
Display complete processor properties:
Get-CimInstance Win32_Processor | Format-List *
Performance Tips
- Allocate only the required number of vCPUs.
- Avoid excessive CPU overcommitment on virtualization hosts.
- Monitor CPU Ready Time (VMware) or Hyper-V Processor Queue Length.
- Keep VMware Tools or Hyper-V Integration Services updated.
- Use balanced NUMA-aware configurations for large VMs.
- Regularly monitor CPU utilization before increasing allocated cores.
Conclusion
Determining the number of CPU cores assigned to a virtual machine is essential for system administration, virtualization management, licensing, and performance optimization. Windows provides several built-in methods such as PowerShell, Command Prompt, Task Manager, and System Information, while virtualization platforms like VMware, Hyper-V, and VirtualBox offer graphical tools to verify CPU allocation. By understanding the relationship between sockets, cores, logical processors, and vCPUs, administrators can optimize VM performance and avoid unnecessary resource allocation.
#VirtualMachine #VMware #HyperV #VirtualBox #WindowsServer #PowerShell #WindowsAdmin #SystemAdministrator #Virtualization #vCPU #CPUCores #IntelXeon #ServerManagement #ITInfrastructure #PerformanceTuning #Windows11 #Windows10 #VMOptimization #DataCenter #VMwareESXi #VMwareWorkstation #CloudComputing #Azure #AWS #GoogleCloud #Proxmox #WindowsTips #SysAdmin #ServerVirtualization #Processor #CPU #WindowsCommands #TaskManager #WMIC #PowerShellScripts #ITSupport #EnterpriseIT #Infrastructure #WindowsServer2019 #WindowsServer2022 #Performance #Troubleshooting #ResourceManagement #Hardware #VirtualServer #Technology #ComputerEngineering #ServerAdmin #WindowsUtilities #TechGuide
Was this guide useful?
Your answer helps us keep BISONKB accurate and practical.