I try to hide PAE and NX support from a guest VM but it doesn't work. More precisely, I want to clear bit 6 from EDX of CPUID 00000001h (hxxp://en.wikipedia. org/wiki/CPUID#EAX.3D1:_Processor_Info_and_Feature_Bits) and bit 6 and 20 from CPUID 80000001h (hxxp://en.wikipedia. org/wiki/CPUID#EAX.3D80000001h:_Extended_Processor_Info_and_Feature_Bits).
First I disabled System -> Processor -> Enable PAE/NX. This cleared the PAE flag of CPUID 80000001h, but its NX flag and the PAE flag of 00000001h were still present. VBoxManage showvminfo VM_without_PAE showed "PAE: off".
The CPUID values were:
. eax ebx ecx edx Gst: 00000001 00020655 00000800 00000209 078bfbff Hst: 00020655 04100800 009ae3bd bfebfbff Gst: 80000001 00000000 00000000 00000001 28100800 Hst: 00000000 00000000 00000001 28100800Next I tried to clear the flags by overriding the CPUID values. The new values should be 078bfbbfh for EDX of 00000001h and 28000800h for EDX of 80000001h. None of the following commands worked:
VBoxManage modifyvm VM_without_PAE --cpuidset 0x00000001 0x00020655 0x00000800 0x00000209 0x078bfbbf VBoxManage modifyvm VM_without_PAE --cpuidset 0x80000001 0x00000000 0x00000000 0x00000001 0x28000800 VBoxManage setextradata VM_without_PAE VBoxInternal/CPUM/CPUID/00000001/edx 0x078bfbbf VBoxManage setextradata VM_without_PAE VBoxInternal/CPUM/CPUID/80000001/edx 0x28000800 VBoxManage setextradata VM_without_PAE VBoxInternal/CPUM/HostCPUID/00000001/edx 0x078bfbbf VBoxManage setextradata VM_without_PAE VBoxInternal/CPUM/HostCPUID/80000001/edx 0x28000800The CPUID values were still the same. I wanted to find out whether the CPUID override commands have any effect at all. So I've tried to override the EDX values of 00000001h and 80000001h with 00000000h. When I started the VM the values were:
Gst: 00000001 00020655 00000800 00000209 00000a40
Gst: 80000001 00000000 00000000 00000001 20100800
Some bits were cleared but some others were still present. The PAE flag of 00000001h and the NX flag of 80000001h were among the present flags.
Does someone know how to remove the remaining PAE flag and the NX flag?
Some information:
- The host has both PAE and NX enabled
- VT-x/AMD-V is supported by the host and is enabled in the VM settings
- Problem occurs in all combinations of host and guest operating systems
Edit:
I found the solution:
If a guest VM should allow 64 bit guests, certain CPUID features have to be set. These will be set even if you override the CPUID values. If you want to find out which features are set, open HWACCM.cpp and search for
#ifdef VBOX_ENABLE_64_BITS_GUESTS64 bit guest support depends on the value of VBoxInternal/HWVirtExt/64bitEnabled (0 = disabled, 1 = enabled). By default, 64bitEnabled is 0 on a 32-bit host and 1 on a 64 bit host. So if you're running a 64 bit host (like me) you have to run
VBoxManage setextradata <VM name> VBoxInternal/HWVirtExt/64bitEnabled 0to disable the unwanted feature bits.