Hiding Virtualization From Other Software

The Kernel-based Virtual Machine (KVM) allows Linux systems to function as hypervisors without needing any extra software, but VMs created with it don’t behave exactly like real hardware does. Sometimes that’s important, though, so [sandwich] built a tool called vfio-native that obscures the fact that software might be running in a virtual machine.

There are plenty of the ways that virtual hardware differs from bare metal. The VM may behave slightly differently for obscure instructions in ways that are measurable, it may take slightly longer to perform some tasks, or the hypervisor may simply announce itself directly. vfio-native includes some kernel patches that solve some bugs which address the different behaviors, changes the way that the kernel identifies itself, and attempts to force the CPUs to behave in ways that real hardware would behave. With all of this applied to the virtual machine, it scores a 1/85 against a VM detection tool, with a standard KVM virtual machine scoring 10/85.

For anyone looking to test this out, it’s available in the AUR for Arch Linux. Also, it’s probably worth mentioning that there are more reasons to use this than cheating at Counter-Strike. For example, security researchers testing malware need to know how that software behaves when it thinks its on real hardware, and some may behave in benign ways when confined to virtual machines. Some licensed software also may disable itself when it detects its running in a VM, which can be a nuisance for things like software controlling industrial tools which only run on operating systems that are no longer maintained or hardware that can’t be found anymore. Some other tools we’ve seen before perform similar tasks as well.

18 thoughts on “Hiding Virtualization From Other Software”

  1. Schools are now implementing exams on computers with a bring-your-own-laptop policy, using some downloadable app as the test environment. People have been cheating by installing LLMs that can read the clipboard, so you can ctrl+c the question and ctrl+v the answer without leaving the app, which would trigger a warning. It’s a cat and mouse game with the developers trying to secure the exam environment without having to provide completely locked down computers to every student, because nobody has the budget for that.

    Next step up would be to insert the text directly into the keyboard driver, so the system looks exactly like a standard laptop but the LLM is writing the answers as if they were coming from the real keyboard.

    1. I find this … Distasteful. People shouldn’t be cheating at toschool because they are cheating themselves. And it makes training people harder. “Your resume says you know this. Now I have to teach you the basics, wasting my time and yours.”

        1. Where people typically cheat is on the entry exams, to get into the school in the first place. Especially in countries with free/subsidized higher education, cheating gets you 3-5 years of free money and time to figure out what you want to do – and the worst thing they can do is to kick you out of school.

          1. WTF are you talking about? Free tuition does not mean free food and board anywhere. Especially since these past 30 years a worldwide wave of replacement of any subsidies for students with loans is ongoing.

            Name a specific country where this is true or forever stop spewing such bullshit.

          2. Free tuition does not mean free food and board anywhere.

            Nor did I say so. What you typically get is access to cheap rental housing and substantially reduced living expenses, including meal subsidies, transportation subsidies, low interest loans, etc. which is “free money”. It’s also a path for immigrants to get a residence permit or extend their stay at least.

            The main point for the cheater is to be able to live on part-time jobs and look for other opportunities for a few more years by pretending to go to school, and if they manage to cheat their way to a diploma and finish their degree then that’s an added bonus.

      1. “Your resume says you know this. Now I have to teach you the basics, wasting my time and yours.”

        That’s been the case way before.

        Every industry whines to the government that there aren’t enough qualified people to hire, so the government demands the education system to train more. The education system responds to the demand by lowering standards both at the entry and the exit – taking in dumber people and giving them easier courses to increase the count. That means the diplomas aren’t worth s**t and you have to train people for the job anyway. Passing exams becomes just a formality to get that piece of paper that no longer means anything.

      2. there is an easy solution. paper exams. my Uni went that route after covid. of course then you get basically meaningless non-exam grades, and a lower pass rate at the exam…

    2. School is so worthless these days, at least they’re learning adversarial computing techniques. It’s not like they’re going to get anything else of value from the two-decade child-torture-suicide prison that we pretend is an education nowadays

  2. I’m curious if, incidentally, hiding the fact that something is being run in a VM will become easier with the push toward using hypervisor-based security features even in what you’d consider ‘bare metal’ installs.

    On any reasonably contemporary windows system, say, it’s more or less expected that software will cooperate with HVCI/VBS being enabled. If the ‘MXC’ stuff ever gains traction that will further normalize running in a container or a VM.

    None of this will make hiding the fact that you aren’t entirely on bare metal easier; but it will be significantly harder for software to treat VM-ish behavior as presumptively dodgy if it is increasingly common for ‘standard’ installs to have some VM flavor around the edges.

    1. I’d love if we moved to heavily containerized apps being standard. Especially if it’s performant.

      Recent security news just makes me so aware every time I run a video game, or any small thing like that, how much damage they could do even by accident.

        1. Just looked at what those do and “ew, no”.
          Those seem ripe for use as DRM tools (hides code from even hypervisor or OS) and would be awful if they made it to consumer products.

          I love the idea of them for shared computer resources or remote hardware but on consumer PCs it’d be a nightmare.

  3. The post mentions using a VM for industrial software running on old platforms. I hit this with a SCADA system running on i86 Solaris with sybase. Sybase (very old) locked itself to the hardware. Sybase provided a tool where you would ssh into the underlying esxi server, get a hardware key for that hardware, and then tell the VM sybase a code (from sybase) related to that hardware.

    One of the massive benefits of esxi was the ability to migrate a vm from machine to machine without a hiccup. This could be done while the “machine” was running live.

    If you did this, sybase would no longer work, and thus, the SCADA system would no longer work.

    “Fooling” these legitimately licensed VMs strikes me as the right thing to do. Also, what happens if sybase pulls support for that little hardware lock dance? Also, the number of IT people who know about that dance is probably very low, and some day they will move that SCADA system, sybase will barf, and then they will be left scrambling to get a mission/safety critical system up and running after a hardware failure/migration.

  4. Sure this isn’t to combat openai bots communicating through CPU cache on the same physical hardware when they have no other physical or virtual connection to each other apart from hardware itself? Makes me wonder if it would still find a way.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.