<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>QEMU |</title><link>https://www.isarvin.com/tags/qemu/</link><atom:link href="https://www.isarvin.com/tags/qemu/index.xml" rel="self" type="application/rss+xml"/><description>QEMU</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-gb</language><lastBuildDate>Mon, 08 Jun 2026 00:00:00 +0000</lastBuildDate><image><url>https://www.isarvin.com/media/sharing.png</url><title>QEMU</title><link>https://www.isarvin.com/tags/qemu/</link></image><item><title>Emulating an Old-World LoongArch64 VM with QEMU</title><link>https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/</link><pubDate>Mon, 08 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/</guid><description>&lt;p&gt;LoongArch64 has an awkward bit of history: the ecosystem is often described as split between
. For the kind of server images I care about here, especially KylinOS Server and UnionTech OS Server, the practical target is still old-world compatibility.&lt;/p&gt;
&lt;p&gt;That is why the firmware file matters. A newer LoongArch64 UEFI build is not automatically better for these guests. For this workflow, &lt;code&gt;QEMU_EFI_7.2.fd&lt;/code&gt; is the boringly useful choice: old enough to match the systems being installed, but still aligned with QEMU&amp;rsquo;s LoongArch64 support era.&lt;/p&gt;
&lt;p&gt;I have shared my copy here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The file I am using is 3,801,088 bytes. Its SHA256 checksum is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;59ab6e18af0ca75ff1556ebb4b6ad640ffbf09499710e655172254f93a2d63ba
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can verify it after downloading:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;shasum -a &lt;span class="m"&gt;256&lt;/span&gt; QEMU_EFI_7.2.fd
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="callout flex px-4 py-3 mb-6 rounded-md border-l-4 bg-blue-100 dark:bg-blue-900 border-blue-500"
data-callout="note"
data-callout-metadata=""&gt;
&lt;span class="callout-icon pr-3 pt-1 text-blue-600 dark:text-blue-300"&gt;
&lt;svg height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"&gt;&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m16.862 4.487l1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125"/&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;div class="callout-content dark:text-neutral-300"&gt;
&lt;div class="callout-title font-semibold mb-1"&gt;Note&lt;/div&gt;
&lt;div class="callout-body"&gt;&lt;p&gt;This post is about full-system emulation, not native virtualisation. On an x86_64 or Apple Silicon host, LoongArch64 can be quite slow. If a guest has not reached the installer or booted system after a long time, the problem may be firmware, guest compatibility, or host QEMU support rather than just patience.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;details class="print:hidden xl:hidden" open&gt;
&lt;summary&gt;Table of Contents&lt;/summary&gt;
&lt;div class="text-sm"&gt;
&lt;nav id="TableOfContents"&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#install-qemu"&gt;Install QEMU&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#prepare-the-files"&gt;Prepare the files&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#boot-from-an-iso"&gt;Boot from an ISO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#boot-an-installed-qcow2"&gt;Boot an installed qcow2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#use-qemu-monitor"&gt;Use QEMU Monitor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#confirm-the-architecture"&gt;Confirm the architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#optional-use-utm-on-macos"&gt;Optional: use UTM on macOS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;
&lt;/div&gt;
&lt;/details&gt;
&lt;div class="hb-steps"&gt;
&lt;h3 id="install-qemu"&gt;Install QEMU&lt;/h3&gt;
&lt;p&gt;On macOS, Homebrew is the easiest way to install QEMU:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install qemu
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qemu-system-loongarch64 --version
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qemu-system-loongarch64 -machine &lt;span class="nb"&gt;help&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qemu-system-loongarch64 -cpu &lt;span class="nb"&gt;help&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On Linux, install the package that provides &lt;code&gt;qemu-system-loongarch64&lt;/code&gt;. For example, on a Fedora-like host:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dnf install -y qemu-system-loongarch64 qemu-img
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;QEMU 7.2 or newer is strongly preferred. QEMU 7.1 introduced initial LoongArch support, and QEMU 7.2 included important updates. In practice, I would not spend time debugging old QEMU builds for this.&lt;/p&gt;
&lt;p&gt;UTM is worth knowing about on macOS because it is a pleasant QEMU-based VM manager. It can emulate a LoongArch64 VM, so the point is not that UTM is unavailable. For this old-world cloud-image workflow, though, I still prefer the direct &lt;code&gt;qemu-system-loongarch64&lt;/code&gt; command because the firmware, device, monitor, and forwarding options are easier to reproduce exactly.&lt;/p&gt;
&lt;h3 id="prepare-the-files"&gt;Prepare the files&lt;/h3&gt;
&lt;p&gt;Create a working directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir -p ~/VMs/loongarch64
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/VMs/loongarch64
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Put these files in that directory:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;QEMU_EFI_7.2.fd&lt;/code&gt;, downloaded from one of the cloud-drive links above.&lt;/li&gt;
&lt;li&gt;A LoongArch64 server ISO, such as KylinOS Server or UnionTech OS Server.&lt;/li&gt;
&lt;li&gt;A qcow2 disk created for the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Create the disk with &lt;code&gt;qemu-img&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qemu-img create -f qcow2 KylinOS-Server-loongarch64.qcow2 40G
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Adjust the filename and size for your own guest. These systems are Red Hat-like, so a 40 GB disk is a reasonable starting point for a small build or image-preparation VM.&lt;/p&gt;
&lt;h3 id="boot-from-an-iso"&gt;Boot from an ISO&lt;/h3&gt;
&lt;p&gt;Use this shape when installing a fresh LoongArch64 server guest from an ISO:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qemu-system-loongarch64 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -M virt &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -bios QEMU_EFI_7.2.fd &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -cdrom KylinOS-Server-loongarch64.iso &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -chardev socket,id&lt;span class="o"&gt;=&lt;/span&gt;qemu-ga.0,path&lt;span class="o"&gt;=&lt;/span&gt;qemu-ga.sock,server&lt;span class="o"&gt;=&lt;/span&gt;on,wait&lt;span class="o"&gt;=&lt;/span&gt;off &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -cpu la464-loongarch-cpu &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device nec-usb-xhci,id&lt;span class="o"&gt;=&lt;/span&gt;xhci,addr&lt;span class="o"&gt;=&lt;/span&gt;0x1b &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device usb-kbd,id&lt;span class="o"&gt;=&lt;/span&gt;keyboard,bus&lt;span class="o"&gt;=&lt;/span&gt;xhci.0,port&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device usb-tablet,id&lt;span class="o"&gt;=&lt;/span&gt;tablet,bus&lt;span class="o"&gt;=&lt;/span&gt;xhci.0,port&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device virtio-gpu-pci &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device virtio-serial &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device virtserialport,chardev&lt;span class="o"&gt;=&lt;/span&gt;qemu-ga.0,name&lt;span class="o"&gt;=&lt;/span&gt;org.qemu.guest_agent.0 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -hda KylinOS-Server-loongarch64.qcow2 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -m 2G &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -monitor telnet:localhost:5555,server&lt;span class="o"&gt;=&lt;/span&gt;on,wait&lt;span class="o"&gt;=&lt;/span&gt;off &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -net nic,model&lt;span class="o"&gt;=&lt;/span&gt;virtio &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -net user,hostfwd&lt;span class="o"&gt;=&lt;/span&gt;tcp::10000-:22 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -smp &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -vnc 0.0.0.0:1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For UnionTech OS Server, keep the same command structure and replace the ISO and qcow2 filenames. The main point is not the exact distribution name; it is the combination of &lt;code&gt;qemu-system-loongarch64&lt;/code&gt;, &lt;code&gt;-M virt&lt;/code&gt;, &lt;code&gt;QEMU_EFI_7.2.fd&lt;/code&gt;, &lt;code&gt;la464-loongarch-cpu&lt;/code&gt;, VirtIO devices, VNC, QEMU Guest Agent wiring, and SSH port forwarding.&lt;/p&gt;
&lt;p&gt;Connect with a VNC viewer to the host&amp;rsquo;s display &lt;code&gt;:1&lt;/code&gt;, which normally means TCP port &lt;code&gt;5901&lt;/code&gt;. If you add &lt;code&gt;--serial stdio&lt;/code&gt;, QEMU will also print serial output in the terminal, which can be useful when the graphical display is quiet.&lt;/p&gt;
&lt;p&gt;During installation, treat the guest as a Red Hat-like system:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use VirtIO-backed disk and network devices.&lt;/li&gt;
&lt;li&gt;Install or keep &lt;code&gt;qemu-guest-agent&lt;/code&gt; if the image-preparation workflow needs guest-agent operations later.&lt;/li&gt;
&lt;li&gt;Ensure SSH is installed and enabled if you want to log in through the forwarded host port.&lt;/li&gt;
&lt;li&gt;Keep the firmware file and qcow2 disk together so the boot command stays reproducible.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="boot-an-installed-qcow2"&gt;Boot an installed qcow2&lt;/h3&gt;
&lt;p&gt;After installation, stop the emulation session and boot from the qcow2 disk without &lt;code&gt;-cdrom&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qemu-system-loongarch64 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -M virt &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -bios QEMU_EFI_7.2.fd &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -chardev socket,id&lt;span class="o"&gt;=&lt;/span&gt;qemu-ga.0,path&lt;span class="o"&gt;=&lt;/span&gt;qemu-ga.sock,server&lt;span class="o"&gt;=&lt;/span&gt;on,wait&lt;span class="o"&gt;=&lt;/span&gt;off &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -cpu la464-loongarch-cpu &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device nec-usb-xhci,id&lt;span class="o"&gt;=&lt;/span&gt;xhci,addr&lt;span class="o"&gt;=&lt;/span&gt;0x1b &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device usb-kbd,id&lt;span class="o"&gt;=&lt;/span&gt;keyboard,bus&lt;span class="o"&gt;=&lt;/span&gt;xhci.0,port&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device usb-tablet,id&lt;span class="o"&gt;=&lt;/span&gt;tablet,bus&lt;span class="o"&gt;=&lt;/span&gt;xhci.0,port&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device virtio-gpu-pci &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device virtio-serial &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -device virtserialport,chardev&lt;span class="o"&gt;=&lt;/span&gt;qemu-ga.0,name&lt;span class="o"&gt;=&lt;/span&gt;org.qemu.guest_agent.0 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -hda KylinOS-Server-loongarch64.qcow2 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -m 2G &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -monitor telnet:localhost:5555,server&lt;span class="o"&gt;=&lt;/span&gt;on,wait&lt;span class="o"&gt;=&lt;/span&gt;off &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -net nic,model&lt;span class="o"&gt;=&lt;/span&gt;virtio &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -net user,hostfwd&lt;span class="o"&gt;=&lt;/span&gt;tcp::10000-:22 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -smp &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -vnc 0.0.0.0:1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then SSH through the forwarded port:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh root@localhost -p &lt;span class="m"&gt;10000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the guest has no network, first use VNC or serial output to inspect it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip addr
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;systemctl status sshd
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;systemctl status qemu-guest-agent
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On KylinOS Server or UnionTech OS Server, the package-management commands should feel familiar if you have used RHEL-like systems:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dnf install -y openssh-server qemu-guest-agent
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; --now sshd qemu-guest-agent
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="use-qemu-monitor"&gt;Use QEMU Monitor&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;-monitor telnet:localhost:5555,server=on,wait=off&lt;/code&gt; option opens a QEMU Monitor endpoint. Connect to it from the host:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;telnet localhost &lt;span class="m"&gt;5555&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Common monitor commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;info status
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;info block
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;system_powerdown
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;system_reset
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;quit
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;system_powerdown&lt;/code&gt; is the polite option if the guest supports ACPI shutdown. &lt;code&gt;quit&lt;/code&gt; stops QEMU directly and can lose guest data, so I only use it when the VM is disposable or already stuck.&lt;/p&gt;
&lt;p&gt;For more monitor commands, see the
.&lt;/p&gt;
&lt;h3 id="confirm-the-architecture"&gt;Confirm the architecture&lt;/h3&gt;
&lt;p&gt;Inside the guest:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;uname -m
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;uname -a
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The first command should print:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;loongarch64
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At that point the VM is ready for the usual Red Hat-like server chores: package updates, qemu-guest-agent checks, image clean-up, kernel clean-up, and whatever build or compatibility work needed a LoongArch64 environment in the first place.&lt;/p&gt;
&lt;h3 id="optional-use-utm-on-macos"&gt;Optional: use UTM on macOS&lt;/h3&gt;
&lt;p&gt;If you prefer a GUI, UTM can be configured for this kind of VM as well. I would treat it as a convenience path rather than the main recipe, because the command line is easier to copy, audit, and rerun during image work.&lt;/p&gt;
&lt;p&gt;The important system settings are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Architecture: &lt;code&gt;LoongArch64&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;System: &lt;code&gt;QEMU LoongArch Virtual Machine (default) (virt)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;CPU: &lt;code&gt;Default&lt;/code&gt;, or the closest available LoongArch CPU setting exposed by your UTM build.&lt;/li&gt;
&lt;li&gt;Memory and CPU cores: choose values that match your host. LoongArch64 emulation is slow, and checking &lt;code&gt;Force Multicore&lt;/code&gt; may help sometimes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="UTM system settings for a LoongArch64 QEMU virt machine."
srcset="https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-loongarch64-system_hu_17b1900a04fad702.webp 320w, https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-loongarch64-system_hu_a5924c7faa16bc13.webp 480w, https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-loongarch64-system_hu_cf8130110d3023bd.webp 700w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-loongarch64-system_hu_17b1900a04fad702.webp"
width="700"
height="369"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Add &lt;code&gt;QEMU_EFI_7.2.fd&lt;/code&gt; as a drive with image type &lt;code&gt;BIOS&lt;/code&gt;, and keep it read-only.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="UTM drive settings showing QEMU_EFI_7.2.fd as a BIOS image."
srcset="https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-bios-drive_hu_4dbabf08fe722a7e.webp 320w, https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-bios-drive_hu_adcceb036749e08e.webp 480w, https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-bios-drive_hu_ea81d84dff8896d8.webp 700w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-bios-drive_hu_4dbabf08fe722a7e.webp"
width="700"
height="368"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;For display, &lt;code&gt;virtio-ramfb&lt;/code&gt; is a useful starting point.&lt;/p&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="UTM display settings using virtio-ramfb."
srcset="https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-virtio-ramfb-display_hu_a5d22c2b3d75e1da.webp 320w, https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-virtio-ramfb-display_hu_2a54e78b93a1066e.webp 480w, https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-virtio-ramfb-display_hu_f4421257622eef82.webp 700w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://www.isarvin.com/blog/emulate-loongarch64-vm-with-qemu/utm-virtio-ramfb-display_hu_a5d22c2b3d75e1da.webp"
width="700"
height="368"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;You still need the same guest-side checks after installation: SSH, &lt;code&gt;qemu-guest-agent&lt;/code&gt; if required, VirtIO networking, and &lt;code&gt;uname -m&lt;/code&gt; showing &lt;code&gt;loongarch64&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;</description></item></channel></rss>