Updates
This commit is contained in:
parent
afdc595f1b
commit
b84745d88a
@ -1,35 +1,60 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# _ _ __ ____ __
|
# _ _ __ ____ __
|
||||||
# | | __ _ _ _ _ __ ___| |__ \ \ / / \/ |
|
# | | __ _ _ _ _ __ ___| |__ \ \ / / \/ |
|
||||||
# | | / _` | | | | '_ \ / __| '_ \ \ \ / /| |\/| |
|
# | | / _` | | | | '_ \ / __| '_ \ \ \ / /| |\/| |
|
||||||
# | |__| (_| | |_| | | | | (__| | | | \ V / | | | |
|
# | |__| (_| | |_| | | | | (__| | | | \ V / | | | |
|
||||||
# |_____\__,_|\__,_|_| |_|\___|_| |_| \_/ |_| |_|
|
# |_____\__,_|\__,_|_| |_|\___|_| |_| \_/ |_| |_|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# by Stephan Raabe (2023)
|
# by Stephan Raabe (2023)
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
|
|
||||||
if [ -f ~/private/win11-credentials.sh ]; then
|
if [ -f ~/private/win11-credentials.sh ]; then
|
||||||
echo "Credential file exists. Using the file."
|
echo "Credential file exists. Using the file."
|
||||||
source ~/private/win11-credentials.sh
|
source ~/private/win11-credentials.sh
|
||||||
else
|
else
|
||||||
win11user="USER"
|
win11user="USER"
|
||||||
win11pass="PASS"
|
win11pass="PASS"
|
||||||
vmip="192.168.122.44"
|
win11ip="192.168.122.44"
|
||||||
|
win11name="windows11"
|
||||||
|
|
||||||
|
echo "## Preparing to remotely access your Windows virtual machine ##"
|
||||||
|
|
||||||
|
echo -n "Please enter your virtual machine name [default: $win11name]: "
|
||||||
|
read vmname
|
||||||
|
vmname=${vmname:-$win11name}
|
||||||
|
|
||||||
|
echo -n "Please enter your virtual machine ip [default: $win11ip]: "
|
||||||
|
read vmip
|
||||||
|
vmip=${vmip:-$win11ip}
|
||||||
|
|
||||||
|
echo -n "Please enter your username [default: $win11user]: "
|
||||||
|
read user
|
||||||
|
user=${user:-$win11user}
|
||||||
|
|
||||||
|
echo -n "Please enter your password [default: $win11pass]: "
|
||||||
|
read password
|
||||||
|
password=${password:-$win11pass}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# echo "Hello, $vmname, $vmip, $user, $password"
|
||||||
|
|
||||||
tmp=$(virsh --connect qemu:///system list | grep " win11 " | awk '{ print $3}')
|
tmp=$(virsh --connect qemu:///system list | grep " $vmname " | awk '{ print $3}')
|
||||||
|
|
||||||
if ([ "x$tmp" == "x" ] || [ "x$tmp" != "xrunning" ])
|
if ([ "x$tmp" == "x" ] || [ "x$tmp" != "xrunning" ]); then
|
||||||
then
|
echo "Virtual Machine $vmname is starting now... Waiting 30s before starting xfreerdp."
|
||||||
echo "Virtual Machine win11 is starting now... Waiting 30s before starting xfreerdp."
|
notify-send "Virtual Machine $vmname 11 is starting now..." "Waiting 30s before starting xfreerdp."
|
||||||
notify-send "Virtual Machine win11 is starting now..." "Waiting 30s before starting xfreerdp."
|
virsh --connect qemu:///system start $vmname
|
||||||
virsh --connect qemu:///system start win11
|
sleep 30
|
||||||
sleep 30
|
|
||||||
else
|
else
|
||||||
notify-send "Virtual Machine win11 is already running." "Launching xfreerdp now!"
|
notify-send "Virtual Machine $vmname is already running." "Launching xfreerdp now!"
|
||||||
echo "Starting xfreerdp now..."
|
echo "Starting xfreerdp now..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
xfreerdp -grab-keyboard /v:$vmip /size:100% /cert-ignore /u:$win11user /p:$win11pass /d: /dynamic-resolution /gfx-h264:avc444 +gfx-progressive &
|
if command -v xfreerdp >/dev/null 2>&1; then
|
||||||
|
xfreerdp -grab-keyboard /v:$vmip /size:100% /cert-ignore /u:$user /p:$password /d: /dynamic-resolution /gfx-h264:avc444 +gfx-progressive /f &
|
||||||
|
elif command -v xfreerdp3 >/dev/null 2>&1; then
|
||||||
|
xfreerdp3 -v:$vmip -u:$user -p:$password -d: -dynamic-resolution /cert:ignore /f /gfx:AVC444 &
|
||||||
|
else
|
||||||
|
echo "'xfreerdp' or 'xfreerdp3' command not found."
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user