Skip to content

Commit c752d93

Browse files
committed
content: Add start script section
The QEMU command used to boot a VM is usually lengthy, put the command into a shell script to simplify start procedure. Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
1 parent 80fc00c commit c752d93

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/virtualization/cloud-hypervisor/heterogeneous-runner.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,31 @@ xz -dk ubuntu-24.04.1-preinstalled-server-riscv64.img.xz
9898
# The image defaults to 5 GiB, couldn't even fit in a kernel source code
9999
qemu-img resize -f raw ubuntu-24.04.1-preinstalled-server-riscv64.img +45G
100100
```
101+
102+
#### Start Script
103+
104+
The QEMU command used to start a RISC-V guest is normally lengthy, let's
105+
simplify it by writing them into a script named `start-riscv64.sh`:
106+
107+
```bash
108+
# Change memory and cores that fits in your host
109+
qemu-system-riscv64 \
110+
-machine virt \
111+
-nographic \
112+
-m 96G \
113+
-smp 16 \
114+
-bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.bin \
115+
-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
116+
-device virtio-net-device,netdev=eth0 \
117+
-netdev user,id=eth0,hostfwd=tcp::12055-:22 \
118+
-device virtio-rng-pci \
119+
-drive file=$1,format=raw,if=virtio \
120+
```
121+
122+
This script is sufficient to boot a fully emulated RISC-V VM, but insufficient
123+
to be the development environment because its kernel version does not support
124+
AIA. With this script in place, you can start VM with command:
125+
126+
```sh
127+
bash start-riscv64.sh
128+
```

0 commit comments

Comments
 (0)