Ports/loongarch64/QEMU

From ALT Linux Wiki
Stub.png
Under construction.
This page is not finished yet and may lack substantial information.


This page describes how to start a loongarch64 virtual machine via QEMU.

Install the necessary packages

QEMU 8.1 or better is highly recommended.

For Sisyphus and p10, install the following:

apt-get install qemu-system-loongarch  qemu-ui-sdl \
   qemu-device-display-virtio-vga qemu-device-display-virtio-vga-gl \
   qemu-device-display-virtio-gpu qemu-device-display-virtio-gpu-gl

Firmware

You'll need a loongarch64 EFI binary. If you're using Sisyphus or p10, you can get one by installing edk2-loongarch64 package:

 apt-get install edk2-loongarch64

For other ALT branches you can download the noarch package and install it; or just extract QEMU_EFI.fd from the package and use it right away.

Command line

You can boot a VM from an ISO into LiveCD with the following command:

qemu-system-loongarch64 \
         -nographic -m 6G  -machine virt \
         -bios "/usr/share/LA64VMF/QEMU_EFI.fd" \
         -smp cpus=4 \
         -netdev user,id=eth0,hostfwd=tcp::5900-:5900 \
         -net nic,netdev=eth0 \
         -device nec-usb-xhci,id=xhci,addr=0x1b \
         -device usb-tablet,id=tablet,bus=xhci.0,port=1 \
         -device usb-kbd,id=keyboard,bus=xhci.0,port=2 \
         -device virtio-gpu-gl,xres=1280,yres=800 -display sdl,gl=on \
         -cdrom path/to/iso

You can add a virtual hard drive in a usual way -- e.g. -drive file=/path/to/some.qcow2.

We recommend to avoid proxying GL if you don't have a working GPU and use llvmpipe on your host: replace virtio-gpu line with the following: -device virtio-gpu,xres=1280,yres=800 -display sdl,gl=off.