feat(quickemu): add support for passing extra arguments to the SPICE viewer
This commit is contained in:
parent
40dea5547e
commit
99f2d2e394
|
|
@ -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:
|
||||
<https://www.spice-space.org/usbredir.html#filter-string-format>.
|
||||
|
||||
##### Enabling SPICE redirection on NixOS
|
||||
|
||||
On NixOS, if you encounter this error:
|
||||
|
|
|
|||
7
quickemu
7
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:-}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue