diff --git a/install.sh b/install.sh index 70785190..b6cd3b79 100755 --- a/install.sh +++ b/install.sh @@ -126,7 +126,9 @@ x86_64) vm_pkgs="qemu-base edk2-ovmf" ;; aarch64) vm_fw=edk2-aarch64 pacman -Si "$vm_fw" >/dev/null 2>&1 || pacman -Qi "$vm_fw" >/dev/null 2>&1 || vm_fw=qemu-system-arm-firmware - vm_pkgs="qemu-base qemu-system-aarch64 $vm_fw" + # The ARM virt machine has no VGA, so machines get a virtio-gpu display, which qemu-base leaves out. + # The -pci package needs the base one but does not depend on it, and without it QEMU crashes when libvirt probes it. + vm_pkgs="qemu-base qemu-system-aarch64 $vm_fw qemu-hw-display-virtio-gpu qemu-hw-display-virtio-gpu-pci" ;; *) die "My Own Data Center needs a 64-bit Intel, AMD or ARM computer; this one is $arch." ;; esac diff --git a/omarchyd/machines.mjs b/omarchyd/machines.mjs index dc5c0cee..a31dcbaf 100644 --- a/omarchyd/machines.mjs +++ b/omarchyd/machines.mjs @@ -642,7 +642,7 @@ function domainXml(m, kvm, uuid = '') { ${nic} - ${o.tablet === false ? '' : "\n "}${o.agent ? "\n " : ''} + ${arm && (o.tablet !== false || m.usbDevices?.length) ? "\n " : ''}${o.tablet === false ? '' : "\n "}${o.agent ? "\n " : ''} /dev/urandom ${(m.usbDevices ?? []).map((d) => hostdevXml(d)).join('\n ')}${m.nixos ? `\n ${nixosConfigFilesystemXml(configDir(dataDir, m.id))}` : ''} diff --git a/test/install-arch.test.mjs b/test/install-arch.test.mjs index b0ffbcf2..ec4edadd 100644 --- a/test/install-arch.test.mjs +++ b/test/install-arch.test.mjs @@ -31,9 +31,9 @@ test('x86-64 installs exactly the packages it always has', {skip}, async () => { }) test('aarch64 (Omarchy on an M1 Mac) is accepted and gets the ARM QEMU and firmware', {skip}, async () => { - assert.equal(await pick('aarch64', true), 'PKGS qemu-base qemu-system-aarch64 edk2-aarch64') + assert.equal(await pick('aarch64', true), 'PKGS qemu-base qemu-system-aarch64 edk2-aarch64 qemu-hw-display-virtio-gpu qemu-hw-display-virtio-gpu-pci') // Arch Linux ARM names the same firmware qemu-system-arm-firmware. - assert.equal(await pick('aarch64', false), 'PKGS qemu-base qemu-system-aarch64 qemu-system-arm-firmware') + assert.equal(await pick('aarch64', false), 'PKGS qemu-base qemu-system-aarch64 qemu-system-arm-firmware qemu-hw-display-virtio-gpu qemu-hw-display-virtio-gpu-pci') }) test('other processors are refused with a clear message', {skip}, async () => { diff --git a/test/machines.test.mjs b/test/machines.test.mjs index 9a869e5c..891c2e08 100644 --- a/test/machines.test.mjs +++ b/test/machines.test.mjs @@ -265,6 +265,7 @@ describe('omarchyd machines', () => { assert.match(seen.xml, //) assert.match(seen.xml, //) assert.match(seen.xml, //) + assert.doesNotMatch(seen.xml, /qemu-xhci/, 'q35 brings its own USB controller') assert.match(seen.xml, //) assert.match(seen.userData, /qemu-guest-agent/) assert.match(seen.userData, /python3/) @@ -1689,6 +1690,8 @@ test('on an ARM server (Omarchy on Apple Silicon) a machine is an aarch64 "virt" assert.match(xml, /<\/controller>/) assert.match(xml, /device='cdrom'>/) assert.match(xml, /