Attempting to restart sys-usb in a script disables the usb keyboard and mouse and also the laptop keyboard and touchpad, but not at the command line

Do you mean you have different result when you press Enter key to execute the script in dom0 terminal on laptop keyboard and on USB keyboard?
Maybe the pressed Enter key on the USB keyboard when you shut down the sys-usb is causing some issue. Try to change the script to this:

#!/bin/bash
sleep 3; date; qvm-shutdown --wait sys-usb; date; qvm-prefs sys-usb template default-dvm; date; sleep 3; date; qvm-start sys-usb; date 

And don’t press any keys on the USB keyboard after pressing and releasing the Enter key to run the script.

Also check the log in /var/log/xen/console/guest-sys-usb-dm.log.

1 Like