* [PATCH] vm: do not require KVM to run QEMU
@ 2025-08-07 18:21 Demi Marie Obenour
2025-08-14 12:50 ` [PATCH] Use -cpu max instead of -cpu host Alyssa Ross
0 siblings, 1 reply; 5+ messages in thread
From: Demi Marie Obenour @ 2025-08-07 18:21 UTC (permalink / raw)
To: Spectrum OS Development; +Cc: Alyssa Ross, Demi Marie Obenour
This prevented running QEMU on Qubes OS.
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
img/app/Makefile | 2 +-
scripts/run-qemu.sh | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/img/app/Makefile b/img/app/Makefile
index 5380ffb76e7bdf8867dcb61560d77028bf910fa3..e458ffebb7db0718007dd15af6a17dda74d36d0a 100644
--- a/img/app/Makefile
+++ b/img/app/Makefile
@@ -148,7 +148,7 @@ start-virtiofsd: scripts/start-virtiofsd.elb
.PHONY: start-virtiofsd
run-qemu: $(imgdir)/appvm/blk/root.img start-vhost-user-net start-virtiofsd
- @../../scripts/run-qemu.sh -m 256 -cpu host -kernel $(KERNEL) -vga none \
+ @../../scripts/run-qemu.sh -m 256 -kernel $(KERNEL) -vga none \
-drive file=$(imgdir)/appvm/blk/root.img,if=virtio,format=raw,readonly=on \
-append "root=PARTLABEL=root nokaslr" \
-gdb unix:build/gdb.sock,server,nowait \
diff --git a/scripts/run-qemu.sh b/scripts/run-qemu.sh
index 64fd29259ab108bc547cb7c74623ae9dc288b3b7..9fa240aed44822a0aff295d246cb23a0e1cf7b8a 100755
--- a/scripts/run-qemu.sh
+++ b/scripts/run-qemu.sh
@@ -5,6 +5,8 @@
# This script wraps around QEMU to paper over platform differences,
# which can't be handled portably in Make language.
+cpu='-cpu host'
+if [ ! -f /dev/kvm ]; then cpu=; fi
case "${ARCH:="$(uname -m)"}" in
aarch64)
machine=virt,accel=kvm:tcg,gic-version=3,iommu=smmuv3
@@ -51,7 +53,7 @@ while [ $i -lt $# ]; do
virtualization=on)
case "$ARCH" in
aarch64)
- opt="$opt,accel=tcg"
+ opt="$opt,accel=tcg" cpu=
;;
*)
continue
@@ -88,4 +90,5 @@ exec ${QEMU_SYSTEM:-qemu-system-$ARCH} \
-machine "$machine" \
${kernel:+${append:+-append "$append"}} \
${iommu:+-device "$iommu"} \
+ $cpu \
"$@"
---
base-commit: 39baa378367d95fac6ce4d0140b25203b2ee9b53
change-id: 20250807-no-require-kvm-c6755f4ade76
--
Sincerely,
Demi Marie Obenour (she/her/hers)
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH] Use -cpu max instead of -cpu host
2025-08-07 18:21 [PATCH] vm: do not require KVM to run QEMU Demi Marie Obenour
@ 2025-08-14 12:50 ` Alyssa Ross
2025-08-14 21:20 ` Demi Marie Obenour
2025-08-15 7:12 ` Alyssa Ross
0 siblings, 2 replies; 5+ messages in thread
From: Alyssa Ross @ 2025-08-14 12:50 UTC (permalink / raw)
To: devel; +Cc: Demi Marie Obenour
-cpu host doesn't work if KVM isn't available. This should do the
right thing in both cases.
Fixes: 0f2d3c7 ("Makefile: add run target to test with QEMU")
Fixes: 3ebad5c ("run-vm.nix: add for running installer test VMs")
Fixes: eaafee7 ("Makefile: add run target")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
Demi, could you please check whether this solves the problem for you on
Qubes OS? I'd prefer to do it this way if it works, because it lets
QEMU take care of the problem rather than our script.
img/app/Makefile | 2 +-
release/installer/run-vm.nix | 2 +-
vm/sys/net/Makefile | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/img/app/Makefile b/img/app/Makefile
index 5380ffb..9665a6b 100644
--- a/img/app/Makefile
+++ b/img/app/Makefile
@@ -148,7 +148,7 @@ start-virtiofsd: scripts/start-virtiofsd.elb
.PHONY: start-virtiofsd
run-qemu: $(imgdir)/appvm/blk/root.img start-vhost-user-net start-virtiofsd
- @../../scripts/run-qemu.sh -m 256 -cpu host -kernel $(KERNEL) -vga none \
+ @../../scripts/run-qemu.sh -m 256 -cpu max -kernel $(KERNEL) -vga none \
-drive file=$(imgdir)/appvm/blk/root.img,if=virtio,format=raw,readonly=on \
-append "root=PARTLABEL=root nokaslr" \
-gdb unix:build/gdb.sock,server,nowait \
diff --git a/release/installer/run-vm.nix b/release/installer/run-vm.nix
index dda9127..37b470c 100644
--- a/release/installer/run-vm.nix
+++ b/release/installer/run-vm.nix
@@ -28,7 +28,7 @@ writeShellScript "run-spectrum-installer-vm.sh" ''
truncate -s 20G "$img"
exec 3<>"$img"
rm -f "$img"
- exec ${../../scripts/run-qemu.sh} -cpu host -m 4G \
+ exec ${../../scripts/run-qemu.sh} -cpu max -m 4G \
-device virtio-keyboard \
-device virtio-mouse \
-device virtio-gpu \
diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile
index 785bd46..e681940 100644
--- a/vm/sys/net/Makefile
+++ b/vm/sys/net/Makefile
@@ -99,7 +99,7 @@ start-vhost-user-net:
../../../scripts/start-passt.elb
run-qemu: $(vmdir)/netvm/blk/root.img
- @../../../scripts/run-qemu.sh -m 256 -cpu host -kernel $(KERNEL) -vga none \
+ @../../../scripts/run-qemu.sh -m 256 -cpu max -kernel $(KERNEL) -vga none \
-drive file=$(vmdir)/netvm/blk/root.img,if=virtio,format=raw,readonly=on \
-append "root=PARTLABEL=root nokaslr" \
-gdb unix:build/gdb.sock,server,nowait \
base-commit: 586577f3015397afacd83bc185454f4cc3c8028f
--
2.50.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] Use -cpu max instead of -cpu host
2025-08-14 12:50 ` [PATCH] Use -cpu max instead of -cpu host Alyssa Ross
@ 2025-08-14 21:20 ` Demi Marie Obenour
2025-08-15 7:13 ` Alyssa Ross
2025-08-15 7:12 ` Alyssa Ross
1 sibling, 1 reply; 5+ messages in thread
From: Demi Marie Obenour @ 2025-08-14 21:20 UTC (permalink / raw)
To: Alyssa Ross, devel
[-- Attachment #1.1.1: Type: text/plain, Size: 3020 bytes --]
On 8/14/25 08:50, Alyssa Ross wrote:
> -cpu host doesn't work if KVM isn't available. This should do the
> right thing in both cases.
>
> Fixes: 0f2d3c7 ("Makefile: add run target to test with QEMU")
> Fixes: 3ebad5c ("run-vm.nix: add for running installer test VMs")
> Fixes: eaafee7 ("Makefile: add run target")
> Signed-off-by: Alyssa Ross <hi@alyssa.is>
> ---
> Demi, could you please check whether this solves the problem for you on
> Qubes OS? I'd prefer to do it this way if it works, because it lets
> QEMU take care of the problem rather than our script.>
> img/app/Makefile | 2 +-
> release/installer/run-vm.nix | 2 +-
> vm/sys/net/Makefile | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/img/app/Makefile b/img/app/Makefile
> index 5380ffb..9665a6b 100644
> --- a/img/app/Makefile
> +++ b/img/app/Makefile
> @@ -148,7 +148,7 @@ start-virtiofsd: scripts/start-virtiofsd.elb
> .PHONY: start-virtiofsd
>
> run-qemu: $(imgdir)/appvm/blk/root.img start-vhost-user-net start-virtiofsd
> - @../../scripts/run-qemu.sh -m 256 -cpu host -kernel $(KERNEL) -vga none \
> + @../../scripts/run-qemu.sh -m 256 -cpu max -kernel $(KERNEL) -vga none \
> -drive file=$(imgdir)/appvm/blk/root.img,if=virtio,format=raw,readonly=on \
> -append "root=PARTLABEL=root nokaslr" \
> -gdb unix:build/gdb.sock,server,nowait \
> diff --git a/release/installer/run-vm.nix b/release/installer/run-vm.nix
> index dda9127..37b470c 100644
> --- a/release/installer/run-vm.nix
> +++ b/release/installer/run-vm.nix
> @@ -28,7 +28,7 @@ writeShellScript "run-spectrum-installer-vm.sh" ''
> truncate -s 20G "$img"
> exec 3<>"$img"
> rm -f "$img"
> - exec ${../../scripts/run-qemu.sh} -cpu host -m 4G \
> + exec ${../../scripts/run-qemu.sh} -cpu max -m 4G \
> -device virtio-keyboard \
> -device virtio-mouse \
> -device virtio-gpu \
> diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile
> index 785bd46..e681940 100644
> --- a/vm/sys/net/Makefile
> +++ b/vm/sys/net/Makefile
> @@ -99,7 +99,7 @@ start-vhost-user-net:
> ../../../scripts/start-passt.elb
>
> run-qemu: $(vmdir)/netvm/blk/root.img
> - @../../../scripts/run-qemu.sh -m 256 -cpu host -kernel $(KERNEL) -vga none \
> + @../../../scripts/run-qemu.sh -m 256 -cpu max -kernel $(KERNEL) -vga none \
> -drive file=$(vmdir)/netvm/blk/root.img,if=virtio,format=raw,readonly=on \
> -append "root=PARTLABEL=root nokaslr" \
> -gdb unix:build/gdb.sock,server,nowait \
>
> base-commit: 586577f3015397afacd83bc185454f4cc3c8028f
Works for me, so:
Tested-by: Demi Marie Obenour <demiobenour@gmail.com>
Would it be possible for you to sign patches with patatt and include
your public key in the repository patatt keyring? That way I have
confidence that the patch came from you and not an imposter who was
able to spoof the DKIM records or the like.
--
Sincerely,
Demi Marie Obenour (she/her/hers)
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Use -cpu max instead of -cpu host
2025-08-14 12:50 ` [PATCH] Use -cpu max instead of -cpu host Alyssa Ross
2025-08-14 21:20 ` Demi Marie Obenour
@ 2025-08-15 7:12 ` Alyssa Ross
1 sibling, 0 replies; 5+ messages in thread
From: Alyssa Ross @ 2025-08-15 7:12 UTC (permalink / raw)
To: Alyssa Ross, devel; +Cc: Demi Marie Obenour
This patch has been committed as e5e3e1109d4f151cb568e102ceb0676ec331e003,
which can be viewed online at
https://spectrum-os.org/git/spectrum/commit/?id=e5e3e1109d4f151cb568e102ceb0676ec331e003.
This is an automated message. Send comments/questions/requests to:
Alyssa Ross <hi@alyssa.is>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-08-15 7:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 18:21 [PATCH] vm: do not require KVM to run QEMU Demi Marie Obenour
2025-08-14 12:50 ` [PATCH] Use -cpu max instead of -cpu host Alyssa Ross
2025-08-14 21:20 ` Demi Marie Obenour
2025-08-15 7:13 ` Alyssa Ross
2025-08-15 7:12 ` Alyssa Ross
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).