ia64/xen-unstable

changeset 4206:504d405a48d6

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>
author mjw@wray-m-3.hpl.hp.com
date Fri Mar 18 10:52:26 2005 +0000 (2005-03-18)
parents f7b4c5d6eb0d
children e194000fb445
files .rootkeys tools/examples/vnc/Xservers tools/examples/vnc/Xvnc-xen
line diff
     1.1 --- a/.rootkeys	Thu Mar 17 16:29:49 2005 +0000
     1.2 +++ b/.rootkeys	Fri Mar 18 10:52:26 2005 +0000
     1.3 @@ -323,6 +323,8 @@ 41e661e1giIEKbJ25qfiP-ke8u8hFA tools/exa
     1.4  40ee75a967sxgcRY4Q7zXoVUaJ4flA tools/examples/vif-bridge
     1.5  41fc0c18AFAVXA1uGm1JFWHMeeznVw tools/examples/vif-nat
     1.6  41e661e1ooiRKlOfwumG6wwzc0PdhQ tools/examples/vif-route
     1.7 +423ab2eaNCzxk3c-9yU1BwzxWvsDCQ tools/examples/vnc/Xservers
     1.8 +423ab2ea7ajZLdZOI-8Z-bpNdNhhAQ tools/examples/vnc/Xvnc-xen
     1.9  40ee75a93cqxHp6MiYXxxwR5j2_8QQ tools/examples/xend-config.sxp
    1.10  41090ec8Pj_bkgCBpg2W7WfmNkumEA tools/examples/xmexample1
    1.11  40cf2937oKlROYOJTN8GWwWM5AmjBg tools/examples/xmexample2
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/examples/vnc/Xservers	Fri Mar 18 10:52:26 2005 +0000
     2.3 @@ -0,0 +1,5 @@
     2.4 +# Configuration lines to go in /etc/X11/xdm/Xservers to
     2.5 +# start Xvnc and connect back to a vncviewer in domain-0.
     2.6 +# See 'man xdm' under 'LOCAL SERVER SPECIFICATION' for format details.
     2.7 +
     2.8 +:1 Xvnc local /usr/X11R6/bin/Xvnc-xen :1
     2.9 \ No newline at end of file
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/examples/vnc/Xvnc-xen	Fri Mar 18 10:52:26 2005 +0000
     3.3 @@ -0,0 +1,53 @@
     3.4 +#!/bin/bash
     3.5 +#============================================================================
     3.6 +# This script should be installed in /usr/X11R6/bin/Xvnc-xen.
     3.7 +#============================================================================
     3.8 +#
     3.9 +# Start Xvnc and use vncconnect to connect back to a vncviewer listening in
    3.10 +# domain 0. The host and port to connect to are given by
    3.11 +#
    3.12 +#    VNC_VIEWER=<host>:<port>
    3.13 +#
    3.14 +# in the kernel command line (/proc/cmdline). 
    3.15 +#
    3.16 +# The '--vnc' option to 'xm create' will start a vncviewer and
    3.17 +# pass its address in VNC_VIEWER for this script to find.
    3.18 +#
    3.19 +# Usage:
    3.20 +#        Xvnc-xen [args]
    3.21 +#
    3.22 +# Any arguments are passed to Xvnc.
    3.23 +#
    3.24 +#============================================================================
    3.25 +
    3.26 +# Prefix for messages.
    3.27 +M="[$(basename $0)]"
    3.28 +
    3.29 +# Usage: vnc_addr
    3.30 +# Print <host>:<port> for the vncviewer given in
    3.31 +# the kernel command line.
    3.32 +vnc_addr () {
    3.33 +    sed -n -e "s/.*VNC_VIEWER=\([^ ]*\).*/\1/p" /proc/cmdline
    3.34 +}
    3.35 +
    3.36 +# Usage: vnc_connect
    3.37 +# If a vncviewer address was given on the kernel command line,
    3.38 +# run vncconnect for it.
    3.39 +vnc_connect () {
    3.40 +    local addr=$(vnc_addr)
    3.41 +
    3.42 +    if [ -n "${addr}" ] ; then
    3.43 +        echo "$M Connecting to ${addr}."
    3.44 +        vncconnect ${addr}
    3.45 +    else
    3.46 +        echo "$M No VNC_VIEWER in kernel command line."
    3.47 +        echo "$M Create the domain with 'xm create --vnc <display>'."
    3.48 +        return 1
    3.49 +    fi
    3.50 +}
    3.51 +
    3.52 +# Start the vnc server.
    3.53 +Xvnc "$@" >/dev/null 2>&1 &
    3.54 +
    3.55 +# Connect back to the viewer in domain-0.
    3.56 +vnc_connect