From a500df36b07cee36de44f9c10d43f02a2b458704 Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Thu, 30 Mar 2023 18:02:07 +0200 Subject: [PATCH] Update VM Launch script --- scripts/launchvm.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/launchvm.sh b/scripts/launchvm.sh index 913a0d6..e9d6ff6 100755 --- a/scripts/launchvm.sh +++ b/scripts/launchvm.sh @@ -33,9 +33,13 @@ function countdown echo " " } -virsh --connect qemu:///system start win11 -echo "Waiting 20 sec for Windows 11 startup..." -countdown "00:00:20" +tmp=$(virsh --connect qemu:///system list | grep " win11 " | awk '{ print $3}') +if ([ "x$tmp" == "x" ] || [ "x$tmp" != "xrunning" ]) +then + virsh --connect qemu:///system start win11 + echo "Waiting 20 sec for Windows 11 startup..." + countdown "00:00:20" +fi echo "Starting xfreerdp now..." xfreerdp -grab-keyboard /t:"Windows 11" /v:192.168.122.42 /size:100% /d: /p:sancho /dynamic-resolution /gfx-h264:avc444 +gfx-progressive &