记录日常工作关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题。

How to fake a VMs guest OS CPUID

For the most software products the license verification is done with license keys. During my time in the IT I have also seen some products, where the license is tied to the underlying hardware of your server. Mostly this is realized with license files, which include the ID of your CPU. The application checks if the ID within this file matches to the actual CPU ID to complete this mechanism.

I have virtualized some servers with applications, which used this kind of license checks. The normal and probably easiest way is to request / generate a new license file for your new (virtual) hardware. Some weeks ago a customer had the special situation that the software vendor didn´t exists anymore and his physical old server was crashing all the time, which was hosting this special application. He already created a new VM and installed the application but didn´t get any further, because the license file wasn´t accepted. Without a valid license the application didn´t even started.

It took me a while to figure out how to fake the CPUID as I didn´t find anything helpful on the web.


Step 1:
Find out the CPUID you actual need. To do this on a Windows server or desktop open the powershell and run the command Get-WmiObject Win32_Processor. Below you see an example output from my notebook.

cpuid_1

Step 2:
The ID I figured out consists out of two register parts of the assembly instructions of a CPU. For more details check out this wiki article. The picture bellows shows how to spilt this ID into the two required parts.

cpuid_2

This parts you now need to convert form hexadecimal into binary. In my example this looks like this:

cpuid_3

Step 3:
Put the following code to your vmx file of your VM:

cpuid.1.eax = “00000000000000110000011010101001″
cpuid.1.edx = “10111111111010111111101111111111″

Power up your VM and verify the current CPUID with the command shown in step 1. You should now see your desired ID.



Note: The 32-bits of the edx register includes information about specific features the CPU presents to a guest OS. A list of all this features is included in the wiki article I already mentioned above. Some of this features are for sure not available or at least don’t make sense for a virtual CPU. If your new ID includes some of this features, this doesn´t mean that it doesn’t work, but you should verify that your VMs still runs correctly. Also I don´t know if this is supported by VMware. In my case it worked like a charm and the VM runs without any problems.

Special thanks to Jim Mattson from VMware to point me into the right direction.

转载请标明出处【How to fake a VMs guest OS CPUID】。

《www.micoder.cc》 虚拟化云计算,系统运维,安全技术服务.

网站已经关闭评论