Confusing about KVM=off and CPU: hidden=1

Prox815

New Member
Jun 13, 2021
21
0
1
Sorry for my bad english lol


1. What do KVM=off and CPU: hidden=1 stand for?
For KVM=off, I have found some information about it from https://bbs.archlinux.org/viewtopic.php?id=162768, it says​
kvm=off will hide the kvm hypervisor signature, this is required for NVIDIA cards, since its driver will refuse to work on an hypervisor and result in Code 43 on windows (unless you're using a QUADRO)​

Then, for CPU: hidden=1, does it mean the CPU will be hidden from the VM? I cannot find too much information about it.​

2. If KVM=off is enabled, will KVM=off leads to a downgrading of performance?
I have read some info that supports the statement:​
Whole post​
do you really need to add kvm=off ? that kind of kills all performance in the VM​
and some info that against the statement:​
You really don't want to have kvm=off, which disables hardware acceleration completely and slows everything down. Yet, this often yields in a working setup for a lot of stuff because you emulate really everything - including stuff that would normally not be there.​
kvm=off don't touch kvm acceleration, just changes visibility of KVM to guests.
Oh ... you're right. My mistake.
Which of them is true/more accurate? Or the effect of KVM=off depends on different situations?​
3. What does the statement CPU: host, hidden=1 means?
I have read some info here: PCI passthrough via OVMF
Nvidia guest drivers prior to version 465 exhibited a similar behaviour which resulted in a generic error 43 in the card's device manager status. Systems using these older drivers therefore also need the above modification. In addition, they also require hiding the KVM CPU leaf:

$ virsh edit vmname
...
<features>
...
<kvm>
<hidden state='on'/>
</kvm>
...
</features>
...



Note that the above steps do not equate 'hiding' the virtual machine from Windows or any drivers/programs running in the VM.
Also, various other issues not related to any detection mechanism referred to here can also trigger error 43.

By reading Proxmox wiki, I can know that CPU: host is about​
Usually you should select for your VM a processor type which closely matches the CPU of the host system, as it means that the host CPU features (also called CPU flags ) will be available in your VMs. If you want an exact match, you can set the CPU type to host in which case the VM will have exactly the same CPU flags as your host system.​
That means if I do not add "hidden=1", and "CPU=host" is the only statement,​
Proxmox will still let the VM knows it is performing under a virtual environment?​
But "Note that the above steps do not equate 'hiding' the virtual machine from Windows or any drivers/programs running in the VM." really makes me confuse about the meaning of "hidden" in this situation...​
4. What is the difference between "KVM=off" and "hidden=1" ? Is there any relationships?


Many thankss!!
 
PCMark10 - Overall.png
PCMark10 - Performance data 1.pngPCMark10 - Performance data 2.png

PCMark10 - Performance data 3.pngPCMark10 - System info 1.pngPCMark10 - System info 2.png


Not quite sure if it helps.
I used a different GPU Bios for the first one (if i remember correctly)
I think they are more or less the same
 
You can use the command `qm showcmd <vmid>` to confirm that `args: -cpu 'host,kvm=off'` and `cpu: host,hidden=1` in qm.conf(formerly called vmid.conf where `vmid` is the numeric id of the vm) are the same thing in result, that is, adding `kvm=off`.

--

Well, I guessed that you might wonder why the vm behaves differently when you simply adding `hidden=1` to qm.conf and when you add `args: -cpu 'host,kvm=off'`. The latter will take effect and override the former cpu settings. The default cpu settings would be look like this:

Code:
-cpu 'host,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vpindex,kvm=off,+kvm_pv_eoi,+kvm_pv_unhalt'

And that will make the vm still be aware of the hypervisor somehow. It seems `-hypervisor` would work for Windows vms, have a look of:

https://forum.proxmox.com/threads/cant-hide-vm-status-in-windows-guest.96779/
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!