core-admin/qvm-tools/qvm-terminal-dispvm

19 lines
568 B
Plaintext
Raw Normal View History

2019-05-05 17:28:17 +02:00
#!/bin/bash
print_usage() {
cat >&2 << USAGE
Usage: $0 vmname
Connects to VM console throught DispVM using the admin.vm.TerminalDispVM RPC service.
USAGE
}
if [ $# -lt 1 ]; then
print_usage
exit 1
fi
QREXEC_REQUESTED_TARGET="$1"
qvm-check --quiet "$QREXEC_REQUESTED_TARGET" > /dev/null 2>&1 || { echo "Error: no such domain: '$QREXEC_REQUESTED_TARGET'"; exit 1; }
sudo qvm-run -p --localcmd="QREXEC_REQUESTED_TARGET=$QREXEC_REQUESTED_TARGET /etc/qubes-rpc/admin.vm.Terminal" --service --dispvm="$(qubes-prefs management_dispvm)" -- admin.vm.TerminalDispVM