CpuIdTree/CpuIdLeaf configuration

Discussions related to using VirtualBox on Windows hosts.
Post Reply
od
Posts: 2
Joined: 13. Sep 2021, 12:08

CpuIdTree/CpuIdLeaf configuration

Post by od »

I'm looking for an explanation for the following lines in a vbox configuration file (and for the strange behavior of the virtual machine on my host system):

Code: Select all

<CpuIdTree>
    <CpuIdLeaf id="1" eax="1764" ebx="371197952" ecx="2143216631" edx="3219913727"/>
</CpuIdTree>
As far as I understand, this specifies a specific CPU, and 1764 = 0x6e4 appears to be an old (32bit) Intel Core Duo T2400/T2500 (from about 2006) - at least according to cpu-world[dot]com.

I have a virtual machine (Linux Debian guest) as part of a larger software package and the lines from above are part of the included vbox configuration file.
Unfortunately, the virtual machine doesn't run; it starts booting, then several warning messages appear such as "invalid opcode"/"illegal instruction", and an automatic reboot is triggered (-> infinite reboot loop).
If I remove these 3 CpuIdTree lines shown above from the vbox file, everything appears to work (the guest system is correctly booting and running).
The Windows 10 host system is old as well (64bit Intel Core2 Quad CPU Q9550 from about 2009), but up to now it's been working ok.
(I've tried this with several VirtualBox version from 6.0.4 to 6.1.x, all showed the same behavior.)

So, what's going on? Why doesn't the virtual machine boot with the CpuIdLeaf configuration? What's happening if I remove these lines - can there be any surprising side effects?

Thanks,
od
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: CpuIdTree/CpuIdLeaf configuration

Post by fth0 »

od wrote:So, what's going on? Why doesn't the virtual machine boot with the CpuIdLeaf configuration? What's happening if I remove these lines - can there be any surprising side effects?
I'd rather ask the opposite question "Why are those lines inside the VM configuration file?" ;)

This part of the VM configuration can be used to deliberately tell the guest OS wrong information about the virtual CPUs. The typical use case is to run an old guest OS or application, which is only capable of running on older CPUs, on a newer host CPU ("downgrading"). If this wrong information tells the guest OS or application that the virtual CPUs are capable of executing instructions that the host CPU is not capable of, problems are to be expected. Another use case is teleporting a VM (moving it from one host to another while running), where it makes sense to emulate a host CPU which is a common ancestor of both host CPUs.
od
Posts: 2
Joined: 13. Sep 2021, 12:08

Re: CpuIdTree/CpuIdLeaf configuration

Post by od »

fth0 wrote:
od wrote:So, what's going on? Why doesn't the virtual machine boot with the CpuIdLeaf configuration? What's happening if I remove these lines - can there be any surprising side effects?
I'd rather ask the opposite question "Why are those lines inside the VM configuration file?" ;)
Agreed. I was hoping that there might be some good reasons (unknown to me) for doing so, but perhaps it's just a historical remnant in this config file.
Thanks for your reply!
Post Reply