#!/bin/bash # # Restart spice-vdagent inside the guest # # Get instances instances="`ps -o pid,command -e | grep "spice-vdagent$" | cut -d ' ' -f 2 | xargs`" # Kill old instances for pid in $instances; do kill -9 $pid &> /dev/null done # Just to make sure we're inside a virtual machine if which spice-vdagent &> /dev/null ; then spice-vdagent fi