ImVirt(3)

πŸ’– ImVirt πŸ’–

okay so bestie, welcome to the ImVirt(3) manual page β€” it's literally here to detect several virtualizations, and the vibe is very β€œam I in a container or not?” ✨

πŸ“› NAME

ImVirt β€” detects several virtualizations

✨ SYNOPSIS ✨

    use ImVirt;
    print imv_get(IMV_PROB_DEFAULT, imv_detect()),"\n";

🫢 DESCRIPTION 🫢

The ImVirt package tries to figure out whether it's running inside a virtualization container. At least these containers should get detected:

  • ARAnyM
  • KVM
  • lguest
  • LXC
  • OpenVZ
  • QEMU
  • UML
  • VirtualBox
  • Virtual PC/Server
  • VMware
  • Xen

πŸ” DETECTION HEURISTIC πŸ”

⚠️ bestie warning: the detection is based on a heuristic β€” you should not trust the result at all. like, fr fr, no cap.

ImVirt pokes at different well-known characteristics of different virtualization containers. Whether each characteristic is found or not found, it gets weighted by how significant it is.

The heuristic's result is a weighted tree. The leaves are the containers that got detected β€” and the ones that didn't. πŸ¦‹

🧚 FUNCTIONS 🧚

Use these functions to pull out the detected virtualization containers:

  • imv_get($prob) β€” gives you exactly one string describing the detected container. If the detected container's match probability is smaller than $prob, you get the string 'Unknown' back instead. 😭
  • imv_get_all() β€” gives you back a hash where any positive detected containers are the keys, and their corresponding match probability is the value.
  • imv_get_pos_results() β€” gives you a list of all possible results which might be returned by all detection modules. Those list entries might get some extra data appended, like version numbers etc.

πŸ’Œ cute sign-off: this ImVirt(3) page is from perl v5.44.0, dated 2026-10-17. mwah, go detect those virtualizations bestie, slay πŸ’…πŸ¦‹

πŸ“¦ where this page comes from