aboutsummaryrefslogtreecommitdiffstats
path: root/tools/examples/vnc
diff options
context:
space:
mode:
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>2005-03-18 10:52:26 +0000
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>2005-03-18 10:52:26 +0000
commit7b14405f61f000ad5d331a3dd480ee9d074762a9 (patch)
tree2cb656e95caf380a8e20c6749cf1838048610269 /tools/examples/vnc
parent4e8d6c72d0e111405a3b865b76c9b334fb78576f (diff)
downloadxen-7b14405f61f000ad5d331a3dd480ee9d074762a9.tar.gz
xen-7b14405f61f000ad5d331a3dd480ee9d074762a9.tar.bz2
xen-7b14405f61f000ad5d331a3dd480ee9d074762a9.zip
bitkeeper revision 1.1159.269.8 (423ab2eapL4QIhT8q2gPBPlVaSKmZw)
Script and xdm config to connect vnc in a domain back to a viewer running in domain-0. Signed-off-by: Mike Wray <mike.wray@hp.com>
Diffstat (limited to 'tools/examples/vnc')
-rw-r--r--tools/examples/vnc/Xservers5
-rwxr-xr-xtools/examples/vnc/Xvnc-xen53
2 files changed, 58 insertions, 0 deletions
diff --git a/tools/examples/vnc/Xservers b/tools/examples/vnc/Xservers
new file mode 100644
index 0000000000..adc5748be6
--- /dev/null
+++ b/tools/examples/vnc/Xservers
@@ -0,0 +1,5 @@
+# Configuration lines to go in /etc/X11/xdm/Xservers to
+# start Xvnc and connect back to a vncviewer in domain-0.
+# See 'man xdm' under 'LOCAL SERVER SPECIFICATION' for format details.
+
+:1 Xvnc local /usr/X11R6/bin/Xvnc-xen :1 \ No newline at end of file
diff --git a/tools/examples/vnc/Xvnc-xen b/tools/examples/vnc/Xvnc-xen
new file mode 100755
index 0000000000..15058e622d
--- /dev/null
+++ b/tools/examples/vnc/Xvnc-xen
@@ -0,0 +1,53 @@
+#!/bin/bash
+#============================================================================
+# This script should be installed in /usr/X11R6/bin/Xvnc-xen.
+#============================================================================
+#
+# Start Xvnc and use vncconnect to connect back to a vncviewer listening in
+# domain 0. The host and port to connect to are given by
+#
+# VNC_VIEWER=<host>:<port>
+#
+# in the kernel command line (/proc/cmdline).
+#
+# The '--vnc' option to 'xm create' will start a vncviewer and
+# pass its address in VNC_VIEWER for this script to find.
+#
+# Usage:
+# Xvnc-xen [args]
+#
+# Any arguments are passed to Xvnc.
+#
+#============================================================================
+
+# Prefix for messages.
+M="[$(basename $0)]"
+
+# Usage: vnc_addr
+# Print <host>:<port> for the vncviewer given in
+# the kernel command line.
+vnc_addr () {
+ sed -n -e "s/.*VNC_VIEWER=\([^ ]*\).*/\1/p" /proc/cmdline
+}
+
+# Usage: vnc_connect
+# If a vncviewer address was given on the kernel command line,
+# run vncconnect for it.
+vnc_connect () {
+ local addr=$(vnc_addr)
+
+ if [ -n "${addr}" ] ; then
+ echo "$M Connecting to ${addr}."
+ vncconnect ${addr}
+ else
+ echo "$M No VNC_VIEWER in kernel command line."
+ echo "$M Create the domain with 'xm create --vnc <display>'."
+ return 1
+ fi
+}
+
+# Start the vnc server.
+Xvnc "$@" >/dev/null 2>&1 &
+
+# Connect back to the viewer in domain-0.
+vnc_connect