Skip to content

Commit 31a197c

Browse files
committed
feat(quickemu): add support for passing extra arguments to the SPICE viewer
1 parent 46771d6 commit 31a197c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/quickemu_conf.5.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ secureboot="off"
4646
tpm="off"
4747
usb_devices=()
4848
viewer="spicy"
49+
viewer_extra_args=""
4950
ssh_port=""
5051
spice_port=""
5152
public_dir=""
@@ -273,6 +274,18 @@ device selection*) support this feature.
273274
To ensure that this functionality works as expected, make sure that you
274275
have installed the necessary SPICE Guest Tools on the virtual machine.
275276

277+
Automatic redirection of specific devices can be configured in the
278+
configuration file by setting the `viewer_extra_args` variable.
279+
280+
For example (in the configuration file):
281+
282+
viewer_extra_args="--spice-usbredir-redirect-on-connect=-1,0x1234,0x5678,-1,1"
283+
284+
Where `0x1234` and `0x5678` are example USB VID and PID, respectively.
285+
286+
The string format is described at:
287+
<https://www.spice-space.org/usbredir.html#filter-string-format>.
288+
276289
##### Enabling SPICE redirection on NixOS
277290

278291
On NixOS, if you encounter this error:

quickemu

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,6 +2243,12 @@ function start_viewer {
22432243
viewer_args+=("${viewer_uri}")
22442244
fi
22452245

2246+
# Add extra arguments
2247+
if [ -n "${viewer_extra_args}" ]; then
2248+
# shellcheck disable=SC2206
2249+
viewer_args+=(${viewer_extra_args})
2250+
fi
2251+
22462252
# Launch the viewer
22472253
echo " - Viewer: ${viewer} ${viewer_args[*]} >/dev/null 2>&1 &"
22482254
"${viewer}" "${viewer_args[@]}" >/dev/null 2>&1 &
@@ -2550,6 +2556,7 @@ secureboot="off"
25502556
tpm="off"
25512557
usb_devices=()
25522558
viewer="${viewer:-spicy}"
2559+
viewer_extra_args="${viewer_extra_args:-}"
25532560
width="${width:-}"
25542561
height="${height:-}"
25552562
ssh_port="${ssh_port:-}"

0 commit comments

Comments
 (0)