2024-07-14 16:04:36 +02:00
|
|
|
#!/bin/sh
|
2024-07-11 22:38:18 +02:00
|
|
|
|
2024-07-15 20:30:05 +02:00
|
|
|
VM_NAME="Windows"
|
2024-07-11 22:38:18 +02:00
|
|
|
|
2024-07-15 20:30:05 +02:00
|
|
|
vm_state=$(virsh --connect qemu:///system domstate "$VM_NAME")
|
2024-07-11 22:38:18 +02:00
|
|
|
|
2024-07-15 20:30:05 +02:00
|
|
|
if [ "$vm_state" != "running" ]; then
|
|
|
|
virsh --connect qemu:///system start "$VM_NAME"
|
2024-08-16 20:03:20 +02:00
|
|
|
sleep 20
|
2024-07-11 22:38:18 +02:00
|
|
|
fi
|
|
|
|
|
2024-08-03 12:00:20 +02:00
|
|
|
# Get the IP address of the VM
|
|
|
|
VM_IP=$(virsh --connect qemu:///system domifaddr "$VM_NAME" | grep -oP '(\d+\.){3}\d+' | head -1)
|
|
|
|
|
|
|
|
if [ -z "$VM_IP" ]; then
|
|
|
|
echo "Failed to retrieve IP address for VM: $VM_NAME"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
xfreerdp -grab-keyboard /v:"$VM_IP" /u:joy /p:1 /size:100% /dynamic-resolution /gfx-h264:avc444 +gfx-progressive /sec:nla /bpp:32 /rfx /rfx-mode:video -bitmap-cache -offscreen-cache -glyph-cache
|