> 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/knowledge-base/zh/virtual-machines/vm-advanced-options.md).

# 虚拟机高级选项

## 概述

VM 高级选项字段允许高级用户对虚拟机参数进行精细调整，超出标准 UI 中可用的范围。这些选项可对 CPU 功能、硬件模拟和设备行为进行细粒度控制。

{% hint style="warning" %}
**谨慎使用**

高级选项会显著影响 VM 的性能和稳定性。只有在了解其影响时才修改这些设置。错误的值可能会导致 VM 无法启动。
{% endhint %}

## 格式

高级选项使用简单的键值格式，每行一个选项：

```
选项1=值1
选项2=值2
选项3=值3
```

## 可用选项

### CPU 和内存

#### CPU 线程

```
cpu.threads=2
```

设置每个核心的 CPU 线程数。默认值为 1。

**使用场景：** 为受益于超线程的应用启用 SMT（同时多线程）。

#### 内存预分配

```
mem-prealloc=1
```

在启动时预先分配全部 VM 内存，而不是按需分配。

**使用场景：** 降低对性能关键型工作负载的内存分配延迟。适用于实时应用或使用 hugepages 时。

### UUID 配置

你可以自定义 VM 的 UUID（通用唯一标识符），以满足特定需求，例如软件许可或迁移场景。

#### 系统 UUID

```
smbios.type1.uuid=550e8400-e29b-41d4-a716-446655440000
```

设置呈现给来宾操作系统的系统 UUID。这是大多数软件会检查的主要 UUID。

**使用场景：**

* 在保留许可的情况下从其他平台迁移 VM
* 验证特定 UUID 的软件
* 需要唯一标识符的 VM 克隆

{% hint style="warning" %}
**UUID 格式**

UUID 必须采用标准格式： `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` （8-4-4-4-12 个十六进制字符）。无效格式会导致 VM 无法启动。
{% endhint %}

{% hint style="success" %}
**生成 UUID**

在 Linux 上： `uuidgen` 在 Windows PowerShell 中： `[guid]::NewGuid()` 在线：使用任意 UUID 生成器工具
{% endhint %}

### SMBIOS 自定义

SMBIOS（系统管理 BIOS）选项允许你自定义向来宾操作系统呈现的硬件信息。

#### 类型 0 - BIOS 信息

```
smbios.type0.vendor=American Megatrends Inc.
smbios.type0.version=2.0
smbios.type0.date=01/01/2023
```

#### 类型 1 - 系统信息

```
smbios.type1.product=Custom Server
smbios.type1.version=1.0
smbios.type1.sku=SKU123
smbios.type1.family=Server Family
```

#### 类型 2 - 主板信息

```
smbios.type2.manufacturer=Custom Manufacturer
smbios.type2.product=Custom Board
smbios.type2.version=1.0
```

#### 类型 3 - 机箱信息

```
smbios.type3.manufacturer=Custom Chassis
smbios.type3.version=1.0
smbios.type3.sku=CHASSIS123
```

#### 类型 4 - 处理器信息

```
smbios.type4.version=Intel(R) Xeon(R) CPU E5-2680 v4
smbios.type4.manufacturer=Intel
```

**SMBIOS 的使用场景：**

* 检查硬件签名的软件许可
* 期望特定硬件配置的应用程序
* 需要特定系统标识的测试场景

### 网络接口调优

对于每个 NIC，你都可以使用 NIC 的资产 ID 调整队列参数：

```
nic1.txqueuelen=2000
nic1.numtxqueues=4
nic1.numrxqueues=4
```

**使用场景：**

* 高吞吐量网络应用
* 降低网络延迟
* 针对特定网络工作负载进行优化

### 机器特定参数

自定义 QEMU 机器参数：

```
machine.cap-cfpc=broken
machine.cap-sbbc=broken
machine.cap-ibs=broken
```

**使用场景：**

* 用于规避 CPU 安全缓解问题
* 与特定来宾操作系统兼容
* 可信环境中的性能优化

### RTC（实时时钟）选项

```
rtc.drift-fix=slew
```

**使用场景：**

* 修复 VM 中的时间漂移问题
* 对时间敏感应用的同步需求

## 设备特定选项

你可以使用设备的资产 ID 为任意设备设置参数：

```
device1.guest-reset=true
device1.guest-resets-all=false
```

对于磁盘：

```
drive1.cache=writeback
drive1.detect-zeroes=on
```

## 常见使用场景

### 高性能计算

```
cpu.threads=2
mem-prealloc=1
nic1.numtxqueues=8
nic1.numrxqueues=8
```

### Windows 许可合规

```
smbios.type1.manufacturer=Dell Inc.
smbios.type1.product=PowerEdge R740
smbios.type1.serial=ABC123
```

### 迁移后保留 UUID

```
smbios.type1.uuid=550e8400-e29b-41d4-a716-446655440000
```

在将 VM 从另一个平台迁移过来，且来宾操作系统中的软件与原始 UUID 绑定时使用。

### 网络优化

```
nic1.txqueuelen=5000
nic1.numtxqueues=4
nic1.numrxqueues=4
```

## 最佳实践

{% hint style="success" %}
**测试建议**

1. 先在非生产环境中测试高级选项
2. 记录你使用的任何高级选项，以便日后参考
3. 只添加能解决特定问题或满足特定需求的选项
4. 应用高级选项后监控 VM 性能
   {% endhint %}

## 故障排除

如果在添加高级选项后 VM 无法启动：

1. 移除所有高级选项，然后尝试启动 VM
2. 逐个重新添加选项，以找出有问题的设置
3. 检查 VM 日志，查看具体错误信息
4. 验证语法——确保每个选项单独占一行，且没有多余空格

{% hint style="info" %}
**版本兼容性**

某些高级选项可能并非在所有 VergeOS 版本中都可用。选项会动态处理，因此不受支持的选项通常会被忽略，而不是引发错误。
{% endhint %}

{% hint style="info" %}
**文档信息**

* 最后更新：2026-01-24
* VergeOS 版本：26.1
  {% 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/knowledge-base/zh/virtual-machines/vm-advanced-options.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.
