Add qvm-terminal-dispvm

This commit is contained in:
Frédéric Pierret (fepitre) 2019-05-05 17:28:17 +02:00
parent b0e027ed1c
commit 4b86606890
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2
2 changed files with 19 additions and 0 deletions

View File

@ -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; \

18
qvm-tools/qvm-terminal-dispvm Executable file
View File

@ -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