From 49633ed11b6d1ea119aa57071f2830e01b736b73 Mon Sep 17 00:00:00 2001 From: Lorenzo Villani Date: Wed, 28 Jan 2026 21:33:32 +0100 Subject: [PATCH 1/3] style(quickemu): strip trailing whitespace --- docs/quickemu.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickemu.1.md b/docs/quickemu.1.md index eb99a78..f8823e5 100644 --- a/docs/quickemu.1.md +++ b/docs/quickemu.1.md @@ -259,7 +259,7 @@ These should be handled by dependencies in Trixie and later. For earlier versions (and their derivatives): ``` shell -sudo apt-get install bash coreutils curl genisoimage grep jq mesa-utils ovmf pciutils procps python3 qemu sed socat spice-client-gtk swtpm-tools unzip usbutils util-linux xdg-user-dirs xrandr zsync +sudo apt-get install bash coreutils curl genisoimage grep jq mesa-utils ovmf pciutils procps python3 qemu sed socat spice-client-gtk swtpm-tools unzip usbutils util-linux xdg-user-dirs xrandr zsync ``` #### Install requirements on Fedora hosts From 40dea5547e4811be12138e1643e0ebb252d0ebd6 Mon Sep 17 00:00:00 2001 From: Lorenzo Villani Date: Sat, 18 Oct 2025 14:10:05 +0200 Subject: [PATCH 2/3] docs(quickemu): clarify that 'viewer' refers to the SPICE viewer --- docs/quickemu.1.md | 4 ++-- quickemu | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/quickemu.1.md b/docs/quickemu.1.md index f8823e5..ab89b48 100644 --- a/docs/quickemu.1.md +++ b/docs/quickemu.1.md @@ -75,7 +75,7 @@ You can also pass optional parameters : Do not commit any changes to disk/snapshot. **--viewer \** -: Choose an alternative viewer. @Options: 'spicy' (default), +: Choose an alternative SPICE viewer. @Options: 'spicy' (default), 'remote-viewer', 'none' **--width \** @@ -784,7 +784,7 @@ Arguments --snapshot delete : Delete a snapshot. --snapshot info : Show disk/snapshot info. --status-quo : Do not commit any changes to disk/snapshot. - --viewer : Choose an alternative viewer. @Options: 'spicy' (default), 'remote-viewer', 'none' + --viewer : Choose an alternative SPICE viewer. @Options: 'spicy' (default), 'remote-viewer', 'none' --width : Set VM screen width; requires '--height' --height : Set VM screen height; requires '--width' --ssh-port : Set SSH port manually diff --git a/quickemu b/quickemu index 9b65359..ee66a3a 100755 --- a/quickemu +++ b/quickemu @@ -2307,7 +2307,7 @@ function usage() { echo " --snapshot delete : Delete a snapshot." echo " --snapshot info : Show disk/snapshot info." echo " --status-quo : Do not commit any changes to disk/snapshot." - echo " --viewer : Choose an alternative viewer. @Options: 'spicy' (default), 'remote-viewer', 'none'" + echo " --viewer : Choose an alternative SPICE viewer. @Options: 'spicy' (default), 'remote-viewer', 'none'" echo " --width : Set VM screen width; requires '--height'" echo " --height : Set VM screen height; requires '--width'" echo " --ssh-port : Set SSH port manually" From 99f2d2e3945ac6c2344ce98cb39b570d4416e70d Mon Sep 17 00:00:00 2001 From: Lorenzo Villani Date: Fri, 29 Aug 2025 19:11:18 +0200 Subject: [PATCH 3/3] feat(quickemu): add support for passing extra arguments to the SPICE viewer --- docs/quickemu_conf.5.md | 13 +++++++++++++ quickemu | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/docs/quickemu_conf.5.md b/docs/quickemu_conf.5.md index 8f67dab..352e0da 100644 --- a/docs/quickemu_conf.5.md +++ b/docs/quickemu_conf.5.md @@ -46,6 +46,7 @@ secureboot="off" tpm="off" usb_devices=() viewer="spicy" +viewer_extra_args="" ssh_port="" spice_port="" public_dir="" @@ -273,6 +274,18 @@ device selection*) support this feature. To ensure that this functionality works as expected, make sure that you have installed the necessary SPICE Guest Tools on the virtual machine. +Automatic redirection of specific devices can be configured in the +configuration file by setting the `viewer_extra_args` variable. + +For example (in the configuration file): + + viewer_extra_args="--spice-usbredir-redirect-on-connect=-1,0x1234,0x5678,-1,1" + +Where `0x1234` and `0x5678` are example USB VID and PID, respectively. + +The string format is described at: +. + ##### Enabling SPICE redirection on NixOS On NixOS, if you encounter this error: diff --git a/quickemu b/quickemu index ee66a3a..bec6198 100755 --- a/quickemu +++ b/quickemu @@ -2243,6 +2243,12 @@ function start_viewer { viewer_args+=("${viewer_uri}") fi + # Add extra arguments + if [ -n "${viewer_extra_args}" ]; then + # shellcheck disable=SC2206 + viewer_args+=(${viewer_extra_args}) + fi + # Launch the viewer echo " - Viewer: ${viewer} ${viewer_args[*]} >/dev/null 2>&1 &" "${viewer}" "${viewer_args[@]}" >/dev/null 2>&1 & @@ -2550,6 +2556,7 @@ secureboot="off" tpm="off" usb_devices=() viewer="${viewer:-spicy}" +viewer_extra_args="${viewer_extra_args:-}" width="${width:-}" height="${height:-}" ssh_port="${ssh_port:-}"