Skip to content

Commit 997f118

Browse files
committed
ops/qemu-kvm: Add cdrom in first example
Not quite useful if you don't know how to add a cdrom to install OS.
1 parent 7d05deb commit 997f118

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/ops/virtualization/qemu-kvm.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ QEMU 与 KVM 的关系是互补的。当二者结合使用时,QEMU 负责提
6666

6767
### 第一台虚拟机
6868

69-
以下实例命令用于启动一个使用 KVM, 带有双核 CPU1GB 内存,使用一个名为 `example.img` 的磁盘镜像文件和用户态网络的虚拟机
69+
以下实例命令用于启动一个使用 KVM带有双核 CPU1GB 内存,使用一个名为 `example.img` 的磁盘镜像文件,挂载了 `livecd.iso` 作为光盘文件,和用户态网络的虚拟机
7070

7171
```bash
7272
qemu-system-x86_64 \
@@ -75,6 +75,7 @@ qemu-system-x86_64 \
7575
-cpu host \
7676
-smp cores=2 \
7777
-drive file=example.img,format=raw,if=virtio \
78+
-cdrom ./livecd.iso \
7879
-nic user,model=virtio
7980
```
8081

@@ -86,6 +87,7 @@ qemu-system-x86_64 \
8687
- `-cpu host`: 使用宿主机 CPU 模型。
8788
- `-smp cores=2`: 使用 2 个 CPU 核心。
8889
- `-drive file=example.img,format=raw,if=virtio`: 使用 `example.img` 作为磁盘镜像,格式为 `raw`,使用 `virtio` 设备模型。
90+
- 可以使用 `truncate -s 2G example.img``fallocate -l 2G example.img` 创建文件。
8991
- `-nic user,model=virtio`: 使用用户态网络设备,使用 `virtio` 设备模型。
9092

9193
这只是创建虚拟机的一个基本示例,QEMU 提供了很多其他选项,可以让你定制网络、图形输出、设备等。

0 commit comments

Comments
 (0)