Add qvm-connect-tool to ease creating ad-hoc connections
This commit is contained in:
parent
e27296da3c
commit
3c1381c29b
1
Makefile
1
Makefile
@ -316,6 +316,7 @@ install-common: install-doc
|
||||
install -m 0755 misc/tinyproxy-wrapper $(DESTDIR)/usr/lib/qubes/tinyproxy-wrapper
|
||||
|
||||
install -m 0755 misc/qvm-console $(DESTDIR)$(BINDIR)/qvm-console
|
||||
install -m 0755 misc/qvm-connect-tcp $(DESTDIR)$(BINDIR)/qvm-connect-tcp
|
||||
|
||||
install -d $(DESTDIR)/var/run/qubes
|
||||
install -d $(DESTDIR)/rw
|
||||
|
1
debian/qubes-core-agent.install
vendored
1
debian/qubes-core-agent.install
vendored
@ -102,6 +102,7 @@ usr/bin/qvm-move-to-vm
|
||||
usr/bin/qvm-open-in-dvm
|
||||
usr/bin/qvm-open-in-vm
|
||||
usr/bin/qvm-run-vm
|
||||
usr/bin/qvm-connect-tcp
|
||||
usr/bin/qvm-console
|
||||
usr/bin/qvm-sync-clock
|
||||
usr/bin/xenstore-watch-qubes
|
||||
|
39
misc/qvm-connect-tcp
Executable file
39
misc/qvm-connect-tcp
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash --
|
||||
set -e
|
||||
[[ "$DEBUG" == "1" ]] && set -x
|
||||
|
||||
LOCALPORT="$(echo "$1" | cut -d ':' -f1)"
|
||||
DOMAIN="$(echo "$1" | cut -d ':' -f2)"
|
||||
PORT="$(echo "$1" | cut -d ':' -f3)"
|
||||
|
||||
print_usage() {
|
||||
cat >&2 <<USAGE
|
||||
Usage: $0 [localport]:[vmname]:[port]
|
||||
Bind localport to another VM port using the qubes.ConnectTCP RPC service.
|
||||
USAGE
|
||||
}
|
||||
|
||||
check_port() {
|
||||
[[ "$1" -ge 1 ]] && [[ "$1" -le 65535 ]]
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ] ; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ -z "$PORT" ]] && { echo "Please provide PORT"; exit 1; };
|
||||
[[ -z "$LOCALPORT" ]] && LOCALPORT="$PORT"
|
||||
|
||||
if check_port "$PORT" && check_port "$LOCALPORT"; then
|
||||
if [ -n "$DOMAIN" ]; then
|
||||
msg="Binding TCP '$DOMAIN:$PORT' to 'localhost:$LOCALPORT'..."
|
||||
else
|
||||
msg="Binding TCP '@default:$PORT' to 'localhost:$LOCALPORT'..."
|
||||
fi
|
||||
echo "$msg"
|
||||
sudo socat TCP-LISTEN:"$LOCALPORT",reuseaddr,fork EXEC:"qrexec-client-vm \'$DOMAIN\' qubes.ConnectTCP+$PORT" &
|
||||
else
|
||||
echo "Invalid port provided"
|
||||
exit 1
|
||||
fi
|
@ -617,6 +617,7 @@ rm -f %{name}-%{version}
|
||||
/usr/bin/qubes-open
|
||||
/usr/bin/qubes-session-autostart
|
||||
/usr/bin/qvm-console
|
||||
/usr/bin/qvm-connect-tcp
|
||||
%dir /usr/lib/qubes
|
||||
/usr/lib/qubes/prepare-suspend
|
||||
/usr/lib/qubes/qfile-agent
|
||||
|
Loading…
Reference in New Issue
Block a user