> For the complete documentation index, see [llms.txt](https://docs.verge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verge.io/run-the-platform/zh/xu-ni-ji/working-with-vms.md).

# 使用虚拟机（VM）

## VM 控制台访问

该 [远程控制台](/run-the-platform/zh/xu-ni-ji/vm-remote-console.md) 通过 VergeOS 用户界面为您的 VM 提供视频/键盘鼠标访问。

* **打开单个 VM 的远程控制台**：导航到 VM 仪表板并在左侧导航菜单中点击“远程控制台”。
* **为多个 VM 打开远程控制台（在单独的标签页中）**：在虚拟机列表中选择 VM，在左侧导航菜单中点击“远程控制台”。（这可能会被某些弹出窗口拦截器阻止。）

## 克隆 VM

克隆功能允许您创建一个新的 VM 实例，作为现有 VM 的副本（可以保留或不保留相同的 MAC 地址）。这在多种用途下都非常方便：测试、部署、数据恢复等。在 VergeOS 中克隆 VM 几乎是即时完成的，而且过程非常简单。

{% hint style="success" %}
虽然克隆允许您简单复制一个 VM， [配方](/automate-protect-and-extend/zh/zi-dong-hua/vm-recipes.md) 可让您基于模板 VM 生成新的自定义 VM 实例；配方问题可在实例创建时按实例调整详细信息，例如 IP 地址、来宾用户名/密码、分配的资源、网络等。
{% endhint %}

### 克隆步骤

1. 在可能的情况下， **先关闭 VM** 再进行克隆。
2. 从 **VM 仪表板或虚拟机列表中** 页面上选中一个 VM 后，选择 **克隆** 左侧菜单中的“从”。\
   会显示源 VM 的名称以及资源（核心/RAM、操作系统、驱动器数量和 NIC 数量）。
3. 该 **虚拟机名称** 默认将使用原始 VM 名称 + "clone"；名称可根据需要更改。
4. 默认情况下，新实例中的每个 NIC 设备都会创建一个新的唯一 MAC 地址（不同于源 VM）。可以启用“保留 MAC 地址”选项，将原始 VM 的 MAC 地址复制到新的克隆实例。
5. 单击 **提交**。VM 实例会被创建，并显示新 VM 的仪表板页面。

{% hint style="warning" %}
应谨慎使用“保留 MAC 地址”设置，以避免同一网络上运行重复地址，从而引发问题。
{% endhint %}

## 删除 VM

删除 VM 时的注意事项：

* VM 必须先关闭电源，才能被删除。
  * 如果 VM 正在运行，系统不允许删除该 VM。
* 当前作为某个 VM 配方基础的 VM 不能被删除。
* 删除 VM 还会删除其 VM 快照；不过，该 VM 仍会包含在创建该快照时存在的系统快照中。

## 关机 / 重启 / 重置 / 断电

理解以下操作的不同行为非常重要： *关机 / 重启 / 硬重置 / 断电* VM 命令。

* **关机** — 向 VM 发出 ACPI 命令，并依赖于来宾操作系统中已启用/已配置 ACPI。关机会对 VM 发起正常关机。
* **重启** — 先对 VM 执行正常关机，然后再开机。会向 VM 发出 ACPI 命令，并依赖于来宾操作系统中已启用/已配置 ACPI。

{% hint style="success" %}
**在将服务器投入生产之前，建议测试一次&#x20;*****关闭电源*****&#x20;和&#x20;*****重启*****&#x20;通过 VergeOS 用户界面执行的操作，无论用户是否已登录来宾操作系统，或在无人登录/屏幕锁定时都应进行测试。**
{% endhint %}

* **硬重置** — 此选项仅应在无法访问来宾操作系统以进行正常关机时使用（例如来宾操作系统崩溃或锁定）。这会直接关闭硬件电源，而不尝试对来宾操作系统进行正常关机，然后再次开机。
* **断电** — 此选项仅应在无法访问来宾操作系统以进行正常关机时使用（例如来宾操作系统崩溃或锁定）。这相当于在裸机上拔掉电源插头。


---

# 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://docs.verge.io/run-the-platform/zh/xu-ni-ji/working-with-vms.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.
