Hiding hypervisor from VM guest?

Some programs still don’t like to work when inside of a VM.
I’ve tried a few different solutions like ‘hidden state’ and ‘vendor id spoofing’ but they haven’t helped me.

Task Manager still says “Virtual Machine: Yes” in the CPU tab, is this normal? Is there a fix out there that can allow me to completely hide the virtual machine state from Windows?

I’m on Linux Mint, doing GPU passthrough with qemu

1 Like

Check the CPU settings. I believe windows checks a cpu flag for whether it’s a VM or not which you can avoid by adding

<feature policy="disable" name="hypervisor" /> 

into the cpu section of the xml config. via “virsh edit vmname”

1 Like

Out of interest, which programs are you having issues with?

Also make sure you set your CPU model to host-passthrough.

It depends on how the programs you’re trying to run detect that they’re running in a virtualised environment. There’s a huge number of web pages out there covering the subject, but depending on how tricky these programs are it may be impossible; I suspect that a processor timing detection could be used to detect a virtualised environment no matter what you try.

But I’d start by :-

  1. Making sure the MAC address of the virtual machine is set to something that doesn’t match a hypervisor allocation.

  2. Turn off as many features as possible - a VirtualBox shared clipboard rather gives the game away.

  3. Change as many devices from efficient virtual devices into devices that look like real hardware.

And that’s just the simple stuff.

@BigBlueHouse
It’s mostly games, specifically PUBG, MW2 and some editing programs.

@VeryZ
ah… I didn’t realize there were so many different ways a program could check for it. I always thought it was as simple as flipping a switch to trick windows into thinking it was running on bare metal, but your tips gave me an idea of what phrases to search for to point me in the right directions.

My initial searches all led me to the mainstream hypervisors like VMware and virtualbox which was of no use at all, of course.

Besides the two things I mentioned in the original post, are there any QEMU/KVM specific solutions I can try? like I said, I’ve been lost as to what specific phrases to search for and google hasn’t given me the results I wanted. Maybe more XML file tweaks?

I’m new to this so I don’t quite know the correct terminology.

@garyp

I’d like to say that even though your solution did not fix my issue with the programs, it did however make the VM a lot snappier suddenly. Do you happen to have an explanation on why this is?

and yes… task manager no longer says Virtual Machine: Yes and all CPU information shows up correctly… stuff like:
Sockets, cores, logical processors and caches.

besides trying to find a solution, I’d love to understand more behind why certain code/xml tweaks work as well.

I don’t know specifics, but from what I read elsewhere Windows checks for a specific cpu flag which tells you if the CPU is running in a hypervisor. I guess so the OS can then optimise for that use case.

On Linux you could cat /proc/cpuinfo and you’d see a “hypervisor” flag listed if it’s in a VM.

Beyond that I don’t know what Windows does, if anything, once it knows it’s in a hypervisor, other than display that in the UI.

ty, this helped