> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man4/vmgenc.4.md).

# vmgenc.4

`vmgenc` — ACPI 虚拟机生成 ID 计数器

## 名称

`vmgenc`

## 概要

`device vmgenc`

`在 loader.conf(5) 中： vmgenc_load="YES"`

## 描述

`vmgenc` 驱动为虚拟机生成 ID（Virtual Machine Generation ID）提供支持，这是 hypervisor 通过 ACPI 暴露的 128 位唯一标识符。每当虚拟机被克隆、从快照恢复或以其他方式复制时，hypervisor 都会更改此标识符。

当检测到生成 ID 更改时，`vmgenc` 驱动会将新标识符送入内核熵池（通过 [random(4)](/man/man4/random.4.md)），确保复制的虚拟机不共享加密状态。驱动还会发送 [devctl(4)](/man/man4/devctl.4.md) 事件和内部内核通知，以便其他子系统能对复制做出响应。

虚拟机生成 ID 规范由 QEMU、VMware ESXi、Microsoft Hyper-V 和 Xen 支持。

## SYSCTL 变量

以下变量可用：

**`dev.vmgenc.%d.guid`** 当前缓存的 VM 生成计数器，作为 128 位值。每次 hypervisor 发出生成更改信号时都会更新此值。

## 参见

[acpi(4)](/man/man4/acpi.4.md), [random(4)](/man/man4/random.4.md)

## 历史

`vmgenc` 驱动最早出现于 FreeBSD 13.0。

## 作者

`vmgenc` 驱动由 Conrad Meyer <cem@FreeBSD.org> 编写。

本手册页由 Christos Longros <chris.longros@gmail.com> 编写。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man4/vmgenc.4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
