Installing on QEMU
Firmware
Standard EFI Firmware
Download the following binaries from the download page:
RISCV_VIRT_CODE.fd
RISCV_VIRT_VARS.fd
Alternatively, compile the latest EDK2 OVMF firmware locally according to the official documentation
EFI Firmware with Penglai TEE Support
Download the following binary from the download page:
fw_dynamic_oe_2403_penglai.bin
QEMU Version
To support UEFI, QEMU version 8.1 or above is required.
During compilation, the libslirp dependency needs to be installed (package name varies by distribution, for openEuler it's libslirp-devel) and the --enable-slirp parameter should be added.
~$ qemu-system-riscv64 --version
QEMU emulator version 8.2.2
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers
qcow2 Image
Obtain the ISO file (e.g., openEuler-24.03-LTS-riscv64.qcow2.xz
)
~$ ls *.qcow2.xz
openEuler-24.03-LTS-riscv64.qcow2.xz
Getting the Startup Script
Obtain the startup script from the download page:
start_vm.sh
: Default script, requires manual installation of the desktop environment.start_vm_penglai.sh
: Script supporting Penglai TEE functionality.
Script Parameters:
ssh_port
: Local SSH forwarding port, default is 12055.vcpu
: Number of threads for QEMU execution, default is 8 cores, adjustable as needed.memory
: Amount of memory allocated for QEMU execution, default is 8GiB, adjustable as needed.fw
: Firmware payload for booting.drive
: Path to the virtual disk, adjustable as needed.bios
(optional): Boot firmware, can be used to load firmware enabled with Penglai TEE.
Creating a Virtual Hard Disk File
Create a new virtual hard disk file, in the example below, the size of the virtual hard disk is 40GiB.
Do not use qcow2 virtual hard disk files that already contain data to avoid unexpected situations during the boot process.
Ensure that there is only one qcow2 virtual hard disk file in the current directory to avoid errors in script recognition.
~$ qemu-img create -f qcow2 qemu.qcow2 40G