VM with a specific CPU

Solution 1:

Sort-of. VMware and VirtualBox do not support emulation, only virtualization. So that means you cannot add features. However, removing features shouldn’t pose a problem.

This article has some details on how to fake the CPUID as reported to the guest. Keep in mind that this doesn’t really disable any features.

Instructions for VMware products (quote):

Use editor (e.g. notepad) open virtual machine configure file (.vmx)
Adding following lines:

cpuid.1.eax = "00000000000000110100011010101001"
cpuid.1.edx = "10111111111010111111101111111011"

If CPUID is still not change or invalid, try adding:

cpuid.1.ebx = "00000000000000110100011010101001"
cpuid.1.ecx = "10111111111010111111101111111011"

Save configure file and start your Virtual Machine.

Instructions for VirtualBox (quote):

Open Command Prompt and switch to VirtualBox working directory.
Run following command to change CPUID.

vboxmanage modifyvm  --cpuidset 1 000306a9 00100800 3d9ae3bf bfebfbff

Start your Virtual Machine.

How you get those CPUID values is up to you, you’ll probably need to consult your CPU vendor’s Instruction Set Architecture manual.

If you want to emulate features, you’ll need to use an emulator. QEMU can do both virtualization and full emulation. It also supports many CPU architectures other than x86/x64.

Solution 2:

VMware documentation mentions a "CPUID Mask", but I don't know how configurable that is.

If you're willing to experiment with other VMMs, QEMU can enable and disable CPUID flags at the command line. For example, qemu-system-i386 -cpu n270,fpu=off leads to a virtual CPU with the features of an n270 but with the fpu flag disabled. There's a full list of supported CPU models and CPUID flags at qemu-system-i386 -cpu help.