{
    "content": [
        {
            "type": "text",
            "text": "# SYSTEMD-DETECT-VIRT (info)\n\n## NAME\n\nsystemd-detect-virt - Detect execution in a virtualized environment\n\n## SYNOPSIS\n\nsystemd-detect-virt [OPTIONS...]\n\n## DESCRIPTION\n\nsystemd-detect-virt detects execution in a virtualized environment. It\nidentifies the virtualization technology and can distinguish full\nmachine virtualization from container virtualization.\nsystemd-detect-virt exits with a return value of 0 (success) if a\nvirtualization technology is detected, and non-zero (error) otherwise.\nBy default, any type of virtualization is detected, and the options\n--container and --vm can be used to limit what types of virtualization\nare detected.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (8 subsections)\n- **EXIT STATUS**\n- **SEE ALSO**\n- **NOTES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "SYSTEMD-DETECT-VIRT",
        "section": "",
        "mode": "info",
        "summary": "systemd-detect-virt - Detect execution in a virtualized environment",
        "synopsis": "systemd-detect-virt [OPTIONS...]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-c",
                "long": "--container",
                "arg": null,
                "description": "Only detects container virtualization (i.e. shared kernel virtualization)."
            },
            {
                "flag": "-v",
                "long": "--vm",
                "arg": null,
                "description": "Only detects hardware virtualization."
            },
            {
                "flag": "-r",
                "long": "--chroot",
                "arg": null,
                "description": "Detect whether invoked in a chroot(2) environment. In this mode, no output is written, but the return value indicates whether the process was invoked in a chroot() environment or not."
            },
            {
                "flag": "",
                "long": "--private-users",
                "arg": null,
                "description": "Detect whether invoked in a user namespace. In this mode, no output is written, but the return value indicates whether the process was invoked inside of a user namespace or not. See usernamespaces(7) for more information."
            },
            {
                "flag": "-q",
                "long": "--quiet",
                "arg": null,
                "description": "Suppress output of the virtualization technology identifier."
            },
            {
                "flag": "",
                "long": "--list",
                "arg": null,
                "description": "Output all currently known and detectable container and VM environments."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Print a short help text and exit."
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "Print a short version string and exit."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "systemd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
            },
            {
                "name": "systemd-nspawn",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-nspawn/1/json"
            },
            {
                "name": "chroot",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/chroot/2/json"
            },
            {
                "name": "namespaces",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/namespaces/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 127,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-c, --container",
                        "lines": 3,
                        "flag": "-c",
                        "long": "--container"
                    },
                    {
                        "name": "-v, --vm",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--vm"
                    },
                    {
                        "name": "-r, --chroot",
                        "lines": 4,
                        "flag": "-r",
                        "long": "--chroot"
                    },
                    {
                        "name": "--private-users",
                        "lines": 5,
                        "long": "--private-users"
                    },
                    {
                        "name": "-q, --quiet",
                        "lines": 2,
                        "flag": "-q",
                        "long": "--quiet"
                    },
                    {
                        "name": "--list",
                        "lines": 3,
                        "long": "--list"
                    },
                    {
                        "name": "-h, --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "--version",
                        "lines": 2,
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "EXIT STATUS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 16,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "systemd-detect-virt - Detect execution in a virtualized environment\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "systemd-detect-virt [OPTIONS...]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "systemd-detect-virt detects execution in a virtualized environment. It\nidentifies the virtualization technology and can distinguish full\nmachine virtualization from container virtualization.\nsystemd-detect-virt exits with a return value of 0 (success) if a\nvirtualization technology is detected, and non-zero (error) otherwise.\nBy default, any type of virtualization is detected, and the options\n--container and --vm can be used to limit what types of virtualization\nare detected.\n\nWhen executed without --quiet will print a short identifier for the\ndetected virtualization technology. The following technologies are\ncurrently identified:\n\nTable 1. Known virtualization technologies (both VM, i.e. full hardware\nvirtualization, and container, i.e. shared kernel virtualization)\n+----------+--------------------+---------------------+\n|Type      | ID                 | Product             |\n+----------+--------------------+---------------------+\n|VM        | qemu               | QEMU software       |\n|          |                    | virtualization,     |\n|          |                    | without KVM         |\n|          +--------------------+---------------------+\n|          | kvm                | Linux KVM kernel    |\n|          |                    | virtual machine, in |\n|          |                    | combination with    |\n|          |                    | QEMU. Not used for  |\n|          |                    | other virtualizers  |\n|          |                    | using the KVM       |\n|          |                    | interfaces, such as |\n|          |                    | Oracle VirtualBox   |\n|          |                    | or Amazon EC2       |\n|          |                    | Nitro, see below.   |\n|          +--------------------+---------------------+\n|          | amazon             | Amazon EC2 Nitro    |\n|          |                    | using Linux KVM     |\n|          +--------------------+---------------------+\n|          | zvm                | s390 z/VM           |\n|          +--------------------+---------------------+\n|          | vmware             | VMware Workstation  |\n|          |                    | or Server, and      |\n|          |                    | related products    |\n|          +--------------------+---------------------+\n|          | microsoft          | Hyper-V, also known |\n|          |                    | as Viridian or      |\n|          |                    | Windows Server      |\n|          |                    | Virtualization      |\n|          +--------------------+---------------------+\n|          | oracle             | Oracle VM           |\n|          |                    | VirtualBox          |\n|          |                    | (historically       |\n|          |                    | marketed by innotek |\n|          |                    | and Sun             |\n|          |                    | Microsystems), for  |\n|          |                    | legacy and KVM      |\n|          |                    | hypervisor          |\n|          +--------------------+---------------------+\n|          | powervm            | IBM PowerVM         |\n|          |                    | hypervisor -- comes |\n|          |                    | as firmware with    |\n|          |                    | some IBM POWER      |\n|          |                    | servers             |\n|          +--------------------+---------------------+\n|          | xen                | Xen hypervisor      |\n|          |                    | (only domU, not     |\n|          |                    | dom0)               |\n|          +--------------------+---------------------+\n|          | bochs              | Bochs Emulator      |\n|          +--------------------+---------------------+\n|          | uml                | User-mode Linux     |\n|          +--------------------+---------------------+\n|          | parallels          | Parallels Desktop,  |\n|          |                    | Parallels Server    |\n|          +--------------------+---------------------+\n|          | bhyve              | bhyve, FreeBSD      |\n|          |                    | hypervisor          |\n|          +--------------------+---------------------+\n|          | qnx                | QNX hypervisor      |\n+----------+--------------------+---------------------+\n|acrn      | ACRN hypervisor[1] |                     |\n+----------+--------------------+---------------------+\n|Container | openvz             | OpenVZ/Virtuozzo    |\n|          +--------------------+---------------------+\n|          | lxc                | Linux container     |\n|          |                    | implementation by   |\n|          |                    | LXC                 |\n|          +--------------------+---------------------+\n|          | lxc-libvirt        | Linux container     |\n|          |                    | implementation by   |\n|          |                    | libvirt             |\n|          +--------------------+---------------------+\n|          | systemd-nspawn     | systemd's minimal   |\n|          |                    | container           |\n|          |                    | implementation, see |\n|          |                    | systemd-nspawn(1)   |\n|          +--------------------+---------------------+\n|          | docker             | Docker container    |\n|          |                    | manager             |\n|          +--------------------+---------------------+\n|          | podman             | Podman[2] container |\n|          |                    | manager             |\n|          +--------------------+---------------------+\n|          | rkt                | rkt app container   |\n|          |                    | runtime             |\n|          +--------------------+---------------------+\n|          | wsl                | Windows Subsystem   |\n|          |                    | for Linux[3]        |\n|          +--------------------+---------------------+\n|          | proot              | proot[4] userspace  |\n|          |                    | chroot/bind mount   |\n|          |                    | emulation           |\n|          +--------------------+---------------------+\n|          | pouch              | Pouch[5] Container  |\n|          |                    | Engine              |\n+----------+--------------------+---------------------+\n\nIf multiple virtualization solutions are used, only the \"innermost\" is\ndetected and identified. That means if both machine and container\nvirtualization are used in conjunction, only the latter will be\nidentified (unless --vm is passed).\n\nWindows Subsystem for Linux is not a Linux container, but an\nenvironment for running Linux userspace applications on top of the\nWindows kernel using a Linux-compatible interface. WSL is categorized\nas a container for practical purposes. Multiple WSL environments share\nthe same kernel and services should generally behave like when being\nrun in a container.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "The following options are understood:\n",
                "subsections": [
                    {
                        "name": "-c, --container",
                        "content": "Only detects container virtualization (i.e. shared kernel\nvirtualization).\n",
                        "flag": "-c",
                        "long": "--container"
                    },
                    {
                        "name": "-v, --vm",
                        "content": "Only detects hardware virtualization.\n",
                        "flag": "-v",
                        "long": "--vm"
                    },
                    {
                        "name": "-r, --chroot",
                        "content": "Detect whether invoked in a chroot(2) environment. In this mode, no\noutput is written, but the return value indicates whether the\nprocess was invoked in a chroot() environment or not.\n",
                        "flag": "-r",
                        "long": "--chroot"
                    },
                    {
                        "name": "--private-users",
                        "content": "Detect whether invoked in a user namespace. In this mode, no output\nis written, but the return value indicates whether the process was\ninvoked inside of a user namespace or not. See usernamespaces(7)\nfor more information.\n",
                        "long": "--private-users"
                    },
                    {
                        "name": "-q, --quiet",
                        "content": "Suppress output of the virtualization technology identifier.\n",
                        "flag": "-q",
                        "long": "--quiet"
                    },
                    {
                        "name": "--list",
                        "content": "Output all currently known and detectable container and VM\nenvironments.\n",
                        "long": "--list"
                    },
                    {
                        "name": "-h, --help",
                        "content": "Print a short help text and exit.\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "--version",
                        "content": "Print a short version string and exit.\n",
                        "long": "--version"
                    }
                ]
            },
            "EXIT STATUS": {
                "content": "If a virtualization technology is detected, 0 is returned, a non-zero\ncode otherwise.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "systemd(1), systemd-nspawn(1), chroot(2), namespaces(7)\n",
                "subsections": []
            },
            "NOTES": {
                "content": "1. ACRN hypervisor\nhttps://projectacrn.org\n\n2. Podman\nhttps://podman.io\n\n3. Windows Subsystem for Linux\nhttps://docs.microsoft.com/en-us/windows/wsl/about\n\n4. proot\nhttps://proot-me.github.io/\n\n5. Pouch\nhttps://github.com/alibaba/pouch\n\nsystemd 249                                             SYSTEMD-DETECT-VIRT(1)",
                "subsections": []
            }
        }
    }
}