diff --git a/Makefile b/Makefile index beffcd69..7ff89ae0 100644 --- a/Makefile +++ b/Makefile @@ -196,6 +196,7 @@ endif install -m 0755 qvm-tools/qubes-bug-report $(DESTDIR)/usr/bin/qubes-bug-report install -m 0755 qvm-tools/qubes-hcl-report $(DESTDIR)/usr/bin/qubes-hcl-report install -m 0755 qvm-tools/qvm-sync-clock $(DESTDIR)/usr/bin/qvm-sync-clock + install -m 0755 qvm-tools/qvm-terminal-dispvm $(DESTDIR)/usr/bin/qvm-terminal-dispvm for method in $(ADMIN_API_METHODS_SIMPLE); do \ ln -s ../../usr/libexec/qubes/qubesd-query-fast \ $(DESTDIR)/etc/qubes-rpc/$$method || exit 1; \ diff --git a/qvm-tools/qvm-terminal-dispvm b/qvm-tools/qvm-terminal-dispvm new file mode 100755 index 00000000..ec69324a --- /dev/null +++ b/qvm-tools/qvm-terminal-dispvm @@ -0,0 +1,18 @@ +#!/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