KVM (Kernel-based Virtual Machine) is an open-source virtualization technology based on the Linux kernel. It allows the Linux kernel itself to function as a Type 1 (bare-metal) hypervisor. This means that a physical server can run multiple isolated virtual environments, or virtual machines (VMs), simultaneously. Each VM has its own virtualized hardware (CPU, memory, disk, network card, etc.) and can run independent operating systems such as Linux or Windows.
Device Information:
This demo is running on the DC-ROMA RISC-V AI PC, powered by a RISC-V AI SoC with a high-performance CPU and NPU. It supports hardware-accelerated virtualization through KVM (Kernel-based Virtual Machine) and QEMU, making it ideal for developers experimenting with virtualized environments on RISC-V.
Installation Commands:
sudo apt install -y virt-manager # Graphical management tool
sudo apt install -y libvirt-dev # Libvirt development libraries
sudo systemctl enable libvirtd # Enable libvirtd on startup
sudo systemctl start libvirtd # Start libvirt service
sudo apt install -y u-boot-qemu # U-Boot
sudo apt install -y qemu-efi-riscv64 # EDK2 boot utility
sudo dpkg -i edk2-riscv64_20250221-9_all.deb # EDK2 toolset ported from Fedora for RISC-V platform
sudo modprobe kvm # Manually load KVM driver (not auto-loaded at boot)
sudo adduser $USER libvirt
sudo adduser $USER kvm
Code language: PHP (php)
RISC-V platform EDK2 boot tools:
👉 https://github.com/DC-Yanwei/RISC-V-Development-Tools.git
Download the image:
wget https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04.3-preinstalled-server-riscv64.img.xzCode language: JavaScript (javascript)
Decompress the image:
xz -dkv -T0 ubuntu-24.04.3-preinstalled-server-riscv64.img.xzCode language: CSS (css)
Run the image:
qemu-system-riscv64 --enable-kvm -M virt -cpu host \
-m 8192 -smp 4 -nographic \
-device virtio-net-device,netdev=eth0 -netdev user,id=eth0 \
-device virtio-rng-pci \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
-drive file=ubuntu-24.04.03-preinstalled-server-riscv64.img,format=raw,if=virtio
Default credentials:
ubuntuubuntuImportant: On first boot, you will be required to change the default password. Please follow the on-screen instructions.
Download the image:
wget https://dl.fedoraproject.org/pub/alt/risc-v/release/42/Server/riscv64/images/Fedora-Server-Host-Generic-42.20250414-8635a3a5bfcd.riscv64.raw.xzCode language: JavaScript (javascript)
Decompress the image:
xz -dkv -T0 Fedora-Server-Host-Generic-42.20250414-8635a3a5bfcd.riscv64.raw.xzCode language: CSS (css)
Run the image:
qemu-system-riscv64 --enable-kvm -M virt -cpu host \
-m 8192 -smp 4 -nographic \
-device virtio-net-device,netdev=eth0 -netdev user,id=eth0 \
-device virtio-rng-pci \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
-drive file=Fedora-Server-Host-Generic-42.20250414-8635a3a5bfcd.riscv64.raw,format=raw,if=virtio
Default credentials:
fedoralinuxwget https://openkoji.iscas.ac.cn/pub/temp/qemu-kde.img.gz
gzip -d qemu-kde.img.gz
qemu-system-riscv64 --enable-kvm -M virt,pflash0=pflash0,acpi=off -m 6G -smp 4 \
-blockdev node-name=pflash0,read-only=on,driver=qcow2,file.driver=file,file.filename=/usr/share/edk2/riscv/RISCV_VIRT_CODE.qcow2 \
-device virtio-blk-pci,drive=hd0 \
-device virtio-net-device,netdev=usernet \
-netdev user,id=usernet \
-device virtio-vga \
-device qemu-xhci -usb -device usb-kbd -device usb-tablet \
-drive file=qemu-kde.img,format=raw,id=hd0,if=none \
-cpu rv64
Code language: JavaScript (javascript)
Default credentials:
rootriscvConvert RAW image to qcow2 format:
qemu-img convert -p -f raw -O qcow2 ubuntu-24.04.03-preinstalled-server-riscv64.img ubuntu-server.qcow2
qemu-img convert -p -f raw -O qcow2 Fedora-Server-Host-Generic-42.20250414-8635a3a5bfcd.riscv64.raw fedora-server.qcow2Code language: CSS (css)
Steps in Virt-Manager:
/home/roma) containing your qcow2 files as the disk pool./usr/lib/u-boot/qemu-riscv64_smode/uboot.elf into the same directory (e.g., /home/roma) for easier access.uboot.elf.