summaryrefslogtreecommitdiff
path: root/Meta/run.sh
diff options
context:
space:
mode:
authorx-yl <kylepereira@mail.com>2021-07-12 18:42:08 +0400
committerAndreas Kling <kling@serenityos.org>2021-07-14 12:33:07 +0200
commit6b68f16f2c78c2a7ce7b92b9bb6fba6ca841a314 (patch)
tree34735b6c591882f1dc2880960b6f093c98c6c065 /Meta/run.sh
parentc8b13bd053c32f59bf75b35941d2e938b9ff96b8 (diff)
downloadserenity-6b68f16f2c78c2a7ce7b92b9bb6fba6ca841a314.zip
Meta: Change QEMU options in run.sh to use SPICE
If QEMU has the qemu_vdagent chardev (should be present in QEMU 6.1) then we use that as the SPICE client. If qemu_vdagent is not present, no SPICE client will be launched by default because it makes the display a bit choppy. Set SERENITY_SPICE to override the default behavior and use your default SPICE client.
Diffstat (limited to 'Meta/run.sh')
-rwxr-xr-xMeta/run.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/Meta/run.sh b/Meta/run.sh
index 7f0f50cb92..b3ba72cea4 100755
--- a/Meta/run.sh
+++ b/Meta/run.sh
@@ -86,8 +86,16 @@ if [ "$installed_major_version" -lt "$SERENITY_QEMU_MIN_REQ_VERSION" ]; then
die
fi
+if [ -z "$SERENITY_SPICE" ] && "${SERENITY_QEMU_BIN}" -chardev help | grep -iq qemu-vdagent; then
+ SERENITY_SPICE_SERVER_CHARDEV="-chardev qemu-vdagent,clipboard=on,mouse=off,id=vdagent,name=vdagent"
+elif "${SERENITY_QEMU_BIN}" -chardev help | grep -iq spicevmc; then
+ SERENITY_SPICE_SERVER_CHARDEV="-chardev spicevmc,id=vdagent,name=vdagent"
+fi
+
SERENITY_SCREENS="${SERENITY_SCREENS:-1}"
-if (uname -a | grep -iq WSL) || (uname -a | grep -iq microsoft); then
+if [ "$SERENITY_SPICE" ]; then
+ SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-spice-app}"
+elif (uname -a | grep -iq WSL) || (uname -a | grep -iq microsoft); then
# QEMU for windows does not like gl=on, so detect if we are building in wsl, and if so, disable it
# Also, when using the GTK backend we run into this problem: https://github.com/SerenityOS/serenity/issues/7657
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-sdl,gl=off}"
@@ -126,10 +134,12 @@ $SERENITY_EXTRA_QEMU_ARGS
-device $SERENITY_QEMU_DISPLAY_DEVICE
-drive file=${SERENITY_DISK_IMAGE},format=raw,index=0,media=disk
-usb
--device virtio-serial
+$SERENITY_SPICE_SERVER_CHARDEV
+-device virtio-serial,max_ports=2
-chardev stdio,id=stdout,mux=on
-device virtconsole,chardev=stdout
-device isa-debugcon,chardev=stdout
+-device virtserialport,chardev=vdagent,nr=1
-device virtio-rng-pci
-soundhw pcspk
-device sb16
@@ -137,6 +147,7 @@ $SERENITY_EXTRA_QEMU_ARGS
-device i82801b11-bridge,bus=bridge1,id=bridge2 -device sdhci-pci,bus=bridge2
-device i82801b11-bridge,id=bridge3 -device sdhci-pci,bus=bridge3
-device ich9-ahci,bus=bridge3
+-spice port=5930,agent-mouse=off,disable-ticketing=on
"
[ -z "$SERENITY_COMMON_QEMU_Q35_ARGS" ] && SERENITY_COMMON_QEMU_Q35_ARGS="