Skip to content

Instantly share code, notes, and snippets.

@thetooth
Created April 18, 2022 05:29
Show Gist options
  • Save thetooth/4b77a8a105a205f48c004936caefb9c0 to your computer and use it in GitHub Desktop.
Save thetooth/4b77a8a105a205f48c004936caefb9c0 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Using host $SMARTOS_HOST..."
payload=`ssh root@$SMARTOS_HOST "vmadm lookup -j -o uuid alias=$1 | json -a uuid | xargs vmadm info"`
if [ "$payload" = "" ]; then
echo "VM does not exist or does not have a VNC console"
exit
fi
target=`echo $payload | jq -r .vnc.host`
display=`echo $payload | jq -r .vnc.display`
gvncviewer $target:$display
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment