更新虚拟机设置和截图

This commit is contained in:
CallMeR
2026-07-26 19:17:14 +08:00
parent 47ebcd6628
commit 698969cadb
45 changed files with 56 additions and 44 deletions
+53 -41
View File
@@ -18,13 +18,13 @@
勾选底部 `高级` 选项,显示完整的配置参数,节点即 “本机” ,`VM ID``名称` 可自定义。 勾选底部 `高级` 选项,显示完整的配置参数,节点即 “本机” ,`VM ID``名称` 可自定义。
![虚拟机名称](img/p04/vm_id.jpeg) ![虚拟机名称](img/p04/vm_id.jpg)
### 1.2.操作系统 ### 1.2.操作系统
无需使用任何安装介质,客户机操作系统类别选择 `Linux` 版本选择 `6.x - 2.6 Kernel` 即可。 无需使用任何安装介质,客户机操作系统类别选择 `Linux` 版本选择 `7.x - 2.6 Kernel` 即可。
![虚拟机操作系统](img/p04/vm_os.jpeg) ![虚拟机操作系统](img/p04/vm_os.jpg)
### 1.3.系统 ### 1.3.系统
@@ -34,29 +34,29 @@ SCSI 控制器保持默认 `VirtIO SCSI single` ,机型可选 `q35` ,并勾
`预注册密钥` 可启用,启用后将预装特定于发行版和 Microsoft 标准的安全启动密钥。 `预注册密钥` 可启用,启用后将预装特定于发行版和 Microsoft 标准的安全启动密钥。
![虚拟机系统](img/p04/vm_system.jpeg) ![虚拟机系统](img/p04/vm_system.jpg)
### 1.4.磁盘 ### 1.4.磁盘
因使用 Debian 云镜像制作虚拟机模板,此处需删除所有 `磁盘` 因使用 Debian 云镜像制作虚拟机模板,此处需删除所有 `磁盘`
![虚拟机磁盘](img/p04/vm_hd.jpeg) ![虚拟机磁盘](img/p04/vm_hd.jpg)
### 1.5.CPU ### 1.5.CPU
CPU `类` 选择 `host` `插槽``核心` 数根据物理 CPU 核心数进行酌情设置。 CPU `类` 选择 `host` `插槽``核心` 数根据物理 CPU 核心数进行酌情设置。
若 PVE 服务器内有多颗物理 CPU ,则推荐勾选 `启用 NUMA` 选项。 若 PVE 服务器内有多颗物理 CPU ,则推荐勾选 `启用 NUMA` 选项。
![虚拟机CPU](img/p04/vm_cpu.jpeg) ![虚拟机CPU](img/p04/vm_cpu.jpg)
### 1.6.内存 ### 1.6.内存
内存一般 `2G` 足够使用,取消勾选 `Ballooning 设备` 内存一般 `2G` 足够使用,取消勾选 `Ballooning 设备`
对于 `Kernel Samepage Merging (KSM)` 内核同页合并功能,建议保留勾选状态。 对于 `允许 KSM` 内核同页合并功能,建议保留勾选状态。
![虚拟机内存](img/p04/vm_mem.jpeg) ![虚拟机内存](img/p04/vm_mem.jpg)
### 1.7.网络 ### 1.7.网络
@@ -64,7 +64,7 @@ CPU `类别` 选择 `host` `插槽` 与 `核心` 数根据物理 CPU 核心
因在 [02.PVE初始化配置](./02.PVE初始化配置.md) 中曾创建未桥接物理网口的内部网桥,故可根据实际需求选择是否使用纯内部网桥作为该参数值。 因在 [02.PVE初始化配置](./02.PVE初始化配置.md) 中曾创建未桥接物理网口的内部网桥,故可根据实际需求选择是否使用纯内部网桥作为该参数值。
![虚拟机网口](img/p04/vm_network_port.jpeg) ![虚拟机网口](img/p04/vm_network_port.jpg)
多数情况下,无需使用 PVE 内建防火墙,因此 **取消勾选** 网络设备的 `防火墙` 选项。 多数情况下,无需使用 PVE 内建防火墙,因此 **取消勾选** 网络设备的 `防火墙` 选项。
@@ -72,13 +72,13 @@ CPU `类别` 选择 `host` `插槽` 与 `核心` 数根据物理 CPU 核心
即有 n 个 CPU 核心,此处多队列也设置为 n 。 即有 n 个 CPU 核心,此处多队列也设置为 n 。
![虚拟机网卡多队列](img/p04/vm_network_queue.jpeg) ![虚拟机网卡多队列](img/p04/vm_network_queue.jpg)
### 1.8.确认 ### 1.8.确认
接下来查看设置总览,确认无误后即可点击 `完成` 接下来查看设置总览,确认无误后即可点击 `完成`
![虚拟机确认](img/p04/vm_confirm.jpeg) ![虚拟机确认](img/p04/vm_confirm.jpg)
## 2.调整硬件参数 ## 2.调整硬件参数
@@ -86,9 +86,33 @@ CPU `类别` 选择 `host` `插槽` 与 `核心` 数根据物理 CPU 核心
查看虚拟机详情页,在虚拟机 `硬件` 配置页面,移除其 `CD/DVD驱动器` 查看虚拟机详情页,在虚拟机 `硬件` 配置页面,移除其 `CD/DVD驱动器`
![虚拟机删除光驱](img/p04/vm_delete_cd.jpeg) ![虚拟机删除光驱](img/p04/vm_delete_cd.jpg)
### 2.2.导入镜像文件 ### 2.2.添加 VirtIO RNG
为确保系统拥有充足的可用熵,需为模板虚拟机添加 `VirtIO RNG` 熵源。
点击顶部 `新增` 菜单,选择 `VirtIO RNG`
![虚拟机添加RNG](img/p04/vm_rng.jpg)
`熵源` 选择 `/dev/urandom` ,其余参数保持默认即可。
![虚拟机RNG参数](img/p04/vm_rng_details.jpg)
### 2.3.添加串行端口
在基于 Debian Cloud Image 创建 VM 时,须在虚拟机硬件列表中添加 `串行端口` 设备 `serial0`
补全串口硬件可避免系统因缺失 `/dev/ttyS0` 而无限循环报 `agetty` 输入/输出错误,同时可启用 PVE 的 `xterm.js` 控制台(支持原生复制粘贴)。
![虚拟机添加串行端口](img/p04/vm_serial.jpg)
`串行端口` 设置为 `0` 即可。
![虚拟机RNG参数](img/p04/vm_serial_details.jpg)
### 2.4.导入镜像文件
使用终端工具登录 PVE 服务器,并进入 `/tmp` 目录,执行以下命令创建一个目录。 使用终端工具登录 PVE 服务器,并进入 `/tmp` 目录,执行以下命令创建一个目录。
@@ -131,17 +155,17 @@ unused0: successfully imported disk 'local-lvm:vm-1001-disk-2'
磁盘导入成功后,虚拟机硬件列表中将显示一块未使用的磁盘设备,可鼠标 **双击** 该设备进行配置调整。 磁盘导入成功后,虚拟机硬件列表中将显示一块未使用的磁盘设备,可鼠标 **双击** 该设备进行配置调整。
![虚拟机新磁盘](img/p04/vm_unused_hd.jpeg) ![虚拟机新磁盘](img/p04/vm_unused_hd.jpg)
当宿主机使用 SSD 作为物理存储设备,并且虚拟磁盘采用 Thin Provisioning (精简置备)模式时,可考虑开启以下选项: 当宿主机使用 SSD 作为物理存储设备,并且虚拟磁盘采用 Thin Provisioning (精简置备)模式时,可考虑开启以下选项:
- `Discard` `丢弃` 选项,有助于存储空间回收。 - `丢弃` `Discard` 选项,有助于存储空间回收。
- `SSD Emulation` `SSD 仿真` ) 选项,让虚拟机将虚拟磁盘视为 SSD 存储设备。 - `SSD 仿真` `SSD Emulation` ) 选项,让虚拟机将虚拟磁盘视为 SSD 存储设备。
在弹出的对话框中,确认 `IO thread` 选项为 **勾选** 状态,并点击 `添加` 在弹出的对话框中,确认 `IO thread` 选项为 **勾选** 状态,并点击 `新增`
![虚拟机使用该磁盘](img/p04/vm_enable_hd.jpeg) ![虚拟机使用该磁盘](img/p04/vm_enable_hd.jpg)
导入的镜像仅具备 `3G` 磁盘空间,为方便后续使用,可通过 `qm` 命令直接将该磁盘调整至目标容量。 导入的镜像仅具备 `3G` 磁盘空间,为方便后续使用,可通过 `qm` 命令直接将该磁盘调整至目标容量。
@@ -156,39 +180,27 @@ $ qm disk resize 1001 scsi0 24G
或鼠标 **单击** 选中该磁盘,选择页面顶部 `磁盘操作` 菜单的子菜单 `调整大小` 或鼠标 **单击** 选中该磁盘,选择页面顶部 `磁盘操作` 菜单的子菜单 `调整大小`
![虚拟机磁盘扩容](img/p04/vm_hd_resize.jpeg) ![虚拟机磁盘扩容](img/p04/vm_hd_resize.jpg)
在弹出的对话框中,给该磁盘增加 `21G` 磁盘空间。 在弹出的对话框中,给该磁盘增加 `21G` 磁盘空间。
![虚拟机磁盘增加18G](img/p04/vm_hd_scale_up.jpeg) ![虚拟机磁盘增加18G](img/p04/vm_hd_scale_up.jpg)
### 2.3.添加 CloudInit ### 2.5.添加 CloudInit
为确保 Cloud-Init 能正常初始化系统,需为模板虚拟机添加 `CloudInit 设备` 为确保 Cloud-Init 能正常初始化系统,需为模板虚拟机添加 `CloudInit 设备`
点击顶部 `添加` 菜单,选择 `CloudInit 设备` 同样通过 `新增` 菜单,选择 `CloudInit 设备`
![虚拟机添加ci](img/p04/vm_cloudinit.jpeg) ![虚拟机添加ci](img/p04/vm_cloudinit.jpg)
`总线/设备` 选择 `SCSI` ,编号为 `1` ,存储路径需根据实际情况进行调整,演示为 `local-lvm` `总线/设备` 选择 `SCSI` ,编号为 `1` ,存储路径需根据实际情况进行调整,演示为 `local-lvm`
![虚拟机ci参数](img/p04/vm_ci_details.jpeg) ![虚拟机ci参数](img/p04/vm_ci_details.jpg)
### 2.4.添加 VirtIO RNG
为确保系统拥有充足的可用熵,需为模板虚拟机添加 `VirtIO RNG` 熵源。
点击顶部 `添加` 菜单,选择 `VirtIO RNG`
![虚拟机添加RNG](img/p04/vm_rng.jpeg)
`熵源` 选择 `/dev/urandom` ,其余参数保持默认即可。
![虚拟机RNG参数](img/p04/vm_rng_details.jpeg)
虚拟机硬件设备修改完成后,如下图所示。 虚拟机硬件设备修改完成后,如下图所示。
![虚拟机全部硬件](img/p04/vm_hardware_all.jpeg) ![虚拟机全部硬件](img/p04/vm_hardware_all.jpg)
## 3.调整配置参数 ## 3.调整配置参数
@@ -208,15 +220,15 @@ $ qm disk resize 1001 scsi0 24G
鼠标 **双击** `引导顺序` 选项,进入编辑界面。 鼠标 **双击** `引导顺序` 选项,进入编辑界面。
`scsi0` 设备处勾选 “已启用” 复选框,并通过排序功能将其拖拽至首位,点击 `OK` 即可。 `scsi0` 设备处勾选 “已启用” 复选框,并通过排序功能将其拖拽至首位,点击 `确定` 即可。
![虚拟机引导顺序](img/p04/vm_boot.jpeg) ![虚拟机引导顺序](img/p04/vm_boot.jpg)
### 3.2.设置平板指针 ### 3.2.设置平板指针
关闭 `使用平板指针` 选项,可以一定程度上降低虚拟机的 CPU 使用率。 关闭 `使用平板指针` 选项,可以一定程度上降低虚拟机的 CPU 使用率。
![虚拟机平板指针](img/p04/vm_tablet.jpeg) ![虚拟机平板指针](img/p04/vm_tablet.jpg)
## 4.设置 Cloud-Init ## 4.设置 Cloud-Init
Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB