xxbbcc
xxbbcc

Reputation: 17347

Get number of physical processors inside virtual machine

I'd like to know if there's a way to learn the number of physical CPU-s of a host computer when my code is running inside a VM.

I'm looking for C++/assembly solutions that run in Windows and under VmWare (workstation/esxi) and HyperV. Sorry for the very vague question but after several searches, I'm not sure if this is possible to do inside the virtual machine.

Upvotes: 3

Views: 401

Answers (1)

SJuan76
SJuan76

Reputation: 24885

The very concept of VM is that your code (even your OS) do not know that they are sharing resources.

So in first intance, no. The only possible workaround would be if the VM provided it explicity (I am thinking of VMWare Tools, yet I do not know if they offer an API for you).

Upvotes: 5

Related Questions