Changing cpu details via --cpuidset causing critical crashes

Discussions about using Windows guests in VirtualBox.

Changing cpu details via --cpuidset causing critical crashes

Postby frost101 » 23. Jun 2019, 14:06

I'm relatively new to VirtualBox editing so excuse me if I don't know all the details. I am trying to change my cpu details on my VM to stop applications identifying my regular cpu.

After a bit of searching around, I managed to find a few commands that allowed me to alter things, but I can't really find any more information on how to change the details I want, nor can I find any explanation as to what these arguments are.

I found this command
Code: Select all   Expand viewCollapse view
vboxmanage modifyvm  --cpuidset 1 000306a9 00100800 3d9ae3bf bfebfbff


Which seemed to work as it changed a couple of numbers when printing out the cpu details on the VM, however it did not change much and I would like to continue changing data until my real processor is unidentifiable.

After I got the initial command working, I tried to find a few examples of how to change more data and stumbled across this on someones github to mimic an AMD-Ryzen processor

Code: Select all   Expand viewCollapse view
%vboxman% modifyvm "Win10-copy" --cpuidset 00000000 0000000d 68747541 444d4163 69746e65
%vboxman% modifyvm "Win10-copy" --cpuidset 00000001 00610f01 01040800 3e98320b 178bfbff
%vboxman% modifyvm "Win10-copy" --cpuidset 00000002 00000000 00000000 00000000 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 00000003 00000000 00000000 00000000 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 00000004 00000000 00000000 00000000 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 00000005 00000040 00000040 00000003 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 00000006 00000000 00000000 00000001 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 00000007 00000000 00000008 00000000 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 00000008 00000000 00000000 00000000 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 00000009 00000000 00000000 00000000 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 0000000a 00000000 00000000 00000000 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 80000000 8000001e 68747541 444d4163 69746e65
%vboxman% modifyvm "Win10-copy" --cpuidset 80000001 00610f01 20000000 01ebbfff 2fd3fbff
%vboxman% modifyvm "Win10-copy" --cpuidset 80000002 20444d41 352d3841 4b303036 55504120
%vboxman% modifyvm "Win10-copy" --cpuidset 80000003 74697720 61522068 6e6f6564 296d7428
%vboxman% modifyvm "Win10-copy" --cpuidset 80000004 20444820 70617247 73636968 00202020
%vboxman% modifyvm "Win10-copy" --cpuidset 80000005 ff40ff18 ff40ff30 10040140 40020140
%vboxman% modifyvm "Win10-copy" --cpuidset 80000006 64006400 64004200 08008140 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 80000007 00000000 00000000 00000000 000007d9
%vboxman% modifyvm "Win10-copy" --cpuidset 80000008 00003030 00000000 00004003 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 80000009 00000000 00000000 00000000 00000000
%vboxman% modifyvm "Win10-copy" --cpuidset 8000000a 00000001 00010000 00000000 00001cff


I ran this and the VM started to boot, and then gave me a critical crash with a log file and a png image. I can only guess here that because it is in AMD processor I'm trying to mimic, I am trying to set cpu leaves that don't exist, or the architecture is much different from an intel cpu?

I have a few questions...

1. What do the last 4 arguments represent in the command, and if I wanted to alter these values to manipulate the processor information, what am I actually looking at editing?
2. I believe that the "1" value is the leaf. What is a leaf? How do I know how many leaves my cpuidset has and which ones can I edit safely?
3. How can I find which leaf I want to change. For example, processor name could be leaf 4, but how do I find this out?

Hopefully no further clarification is needed, but feel free to ask any questions and I will answer them.

Thanks in advance.


EDIT

I found these

Table 3-13. Processor Brand String Returned with Pentium 4 Processor
Code: Select all   Expand viewCollapse view
80000002H EAX = 20202020H      “ ”
          EBX = 20202020H      “ ”
          ECX = 20202020H      “ ”
          EDX = 6E492020H      “nI ”

80000003H EAX = 286C6574H      “(let”
          EBX = 50202952H      “P )R”
          ECX = 69746E65H      “itne”
          EDX = 52286D75H      “R(mu”

80000004H EAX = 20342029H      “ 4 )”
          EBX = 20555043H      “ UPC”
          ECX = 30303531H      “0051”
          EDX = 007A484DH      “\0zHM”


In some intel architecture document which is the processor name/brand name. Perhaps these are the leaves I need to edit, but a little confused on how to know what values to set.

I have also tried the command
Code: Select all   Expand viewCollapse view
VBoxManage modifyvm "Win10-copy" --cpu-profile "Intel Core"

Which also crashed the VM on booting intto Windows
frost101
 
Posts: 1
Joined: 23. Jun 2019, 13:54

Re: Changing cpu details via --cpuidset causing critical crashes

Postby scottgus1 » 23. Jun 2019, 20:19

I can't answer your actual questions about CPU leaves, etc. Virtualbox allows changing these things, but I don't think there is an explanation besides what's in the manual. CPU leaves are a CPU thing that Virtualbox uses, not an invention of Virtualbox. You might try removing Virtualbox from your research terms and just see what the internet says about CPU leaves on their own merits.

The physical CPU is the only piece of host hardware that the guest specifically sees. It is not emulated by Virtualbox, so your computer's CPU will be seen by the guest OS.

The 'cpuid' commands were designed for 'teleporting', (see the Virtualbox manual) where the guest could be moved to a different host, in a datacenter perhaps, while the guest is still running. These commands restrict capabilities of the CPU the guest OS sees so the guest can be moved 'hot' to a different host and not have to recalculate itself and reboot. As I read the manual, one would determine the capabilities and command extensions common to all of the CPUs in each of the possible hosts the guest might have to teleport to, then set the cpuid leaves in the guest settings so the guest would only see the common commands and extensions. Then one would install the guest OS. The OS would only use the common commands and not try to use a command or extension that one of its possible hosts doesn't have.

If you happen to be trying to keep a guest program that licenses based on, among other things, a CPU signature, so you could move the guest to a different host without having to re-license, the scuttlebutt on the forum that I've read over the years is that it won't work.
Human government is like that crazy uncle who hides a quarter in his fist behind his back, then asks you to guess which fist the quarter is in...
No matter which side you choose, Left or Right, both Sides are empty.
scottgus1
 
Posts: 3757
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Win7

Re: Changing cpu details via --cpuidset causing critical crashes

Postby socratis » 24. Jun 2019, 00:57

frost101 wrote:I found this command
Code: Select all   Expand viewCollapse view
vboxmanage modifyvm  --cpuidset 1 000306a9 00100800 3d9ae3bf bfebfbff
That's not a command, that's an example of the older, deprecated command. The proper command has the following syntax:

    VBoxManage modifyvm <uuid|vmname> --cpuid-set <leaf[:subleaf]> <eax> <ebx> <ecx> <edx>
frost101 wrote:nor can I find any explanation as to what these arguments are
Maybe you shouldn't be messing with low-level things you don't understand then, like I do? ;)

Here's what I know... the <e#x> arguments are the general purpose registers of an x86 CPU. By modifying them you're modifying what capabilities and properties the CPU "possesses". Obviously, you can only go lower, decreasing your CPU's capabilities, not higher. You should really be a CompSci major if you want to start messing with them, or you may be in for a very unpleasant situation; instabilities, crashes, name it.

Imagine that for us commoners that want to modify what capabilities the CPU presents, VirtualBox has another command if you want to change your CPU family, that's definitely safer:

    VBoxManage modifyvm <uuid|vmname> --cpu-profile <profile>
And just to give you an idea of how complicated this looks like, take a look at the profile for the "i7-6700K CPU @ 4.00GHz". At the first part of that file you'll see how the CPU leaves are being set. Do you still want to start messing with that?

frost101 wrote:How do I know how many leaves my cpuidset has and which ones can I edit safely?
If you have to ask, then it's definitely not a safe operation. ;)

frost101 wrote:How can I find which leaf I want to change. For example, processor name could be leaf 4, but how do I find this out?
Intel documentation on what each leaf/register should look like and what's expected for each CPU they've released. I don't have the exact links, a shovel for some digging is definitely required.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 24208
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5


Return to Windows Guests

Who is online

Users browsing this forum: No registered users and 13 guests