x11vnc: improve FINDCREATEDISPLAY (-create) script, FD_GEOM, FD_SESS, FD_OPTS, FD_PROG env vars, add Xvnc support

pull/1/head
runge 17 years ago
parent f31f7159b5
commit a69ed666eb

@ -1,3 +1,7 @@
2007-08-18 Karl Runge <runge@karlrunge.com>
* x11vnc: improve FINDCREATEDISPLAY (-create) script. Document
FD_GEOM, FD_SESS, FD_OPTS, FD_PROG env vars, add Xvnc support.
2007-08-15 Karl Runge <runge@karlrunge.com>
* x11vnc: add reverse -connect support to -display WAIT:
i.e. -find, -create, -svc, ... mode. Document need for

@ -1,5 +1,5 @@
x11vnc README file Date: Wed Aug 15 15:33:58 EDT 2007
x11vnc README file Date: Fri Aug 17 23:09:12 EDT 2007
The following information is taken from these URLs:
@ -1778,16 +1778,19 @@ typedef unsigned int in_addr_t;
There are precompiled x11vnc binaries built by other groups that are
available at the following locations:
Debian: (.deb) [315]http://packages.debian.org/x11vnc
Slackware: (.tgz) [315]http://www.linuxpackages.net/
Slackware: (.tgz) [316]http://www.linuxpackages.net/ Redhat/Fedora:
(.rpm) [317]http://dag.wieers.com/packages/x11vnc/
[318]http://dries.ulyssis.org/rpm/packages/x11vnc SuSE: (.rpm)
Redhat/Fedora: (.rpm) [316]http://dag.wieers.com/packages/x11vnc/
[317]http://dries.ulyssis.org/rpm/packages/x11vnc Debian: (.deb)
[318]http://packages.debian.org/x11vnc (N.B: old and unmaintained;
better to compile from source) SuSE: (.rpm)
[319]http://linux01.gwdg.de/~pbleser/ Solaris: (pkg)
[320]http://www.sunfreeware.com/ FreeBSD: (.tbz)
[321]http://www.freebsd.org/ [322]http://www.freshports.org/net/x11vnc
OpenBSD: (.tgz) [323]http://www.openbsd.org/ NetBSD: (src)
[324]http://pkgsrc.se/x11/x11vnc Nokia 770 (.deb)
[320]http://www.sunfreeware.com/ (N.B: very old; better to compile
from source) FreeBSD: (.tbz) [321]http://www.freebsd.org/
[322]http://www.freshports.org/net/x11vnc OpenBSD: (.tgz)
[323]http://www.openbsd.org/ (N.B: very old and unmaintained; better
to compile from source) NetBSD: (src) [324]http://pkgsrc.se/x11/x11vnc
Nokia 770 (.deb)
[325]http://mike.saunby.googlepages.com/x11vncfornokia7702 Sharp
Zaurus [326]http://www.pdaxrom.org/ and [327]http://www.focv.com/
@ -7849,10 +7852,10 @@ References
312. http://www.karlrunge.com/x11vnc/x11vnc_sunos4.html
313. http://www.karlrunge.com/x11vnc/index.html#building
314. http://www.karlrunge.com/x11vnc/index.html#faq-build
315. http://packages.debian.org/x11vnc
316. http://www.linuxpackages.net/search_view.php?by=name&name=x11vnc
317. http://dag.wieers.com/packages/x11vnc/
318. http://dries.ulyssis.org/rpm/packages/x11vnc/info.html
315. http://www.linuxpackages.net/search_view.php?by=name&name=x11vnc
316. http://dag.wieers.com/packages/x11vnc/
317. http://dries.ulyssis.org/rpm/packages/x11vnc/info.html
318. http://packages.debian.org/x11vnc
319. http://linux01.gwdg.de/~pbleser/rpm-navigation.php?cat=Network/x11vnc/
320. http://www.sunfreeware.com/
321. http://www.freebsd.org/cgi/ports.cgi?query=x11vnc&stype=all
@ -11072,7 +11075,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options:
% x11vnc -opts (see below for -help long descriptions)
x11vnc: allow VNC connections to real X11 displays. 0.9.3 lastmod: 2007-08-15
x11vnc: allow VNC connections to real X11 displays. 0.9.3 lastmod: 2007-08-17
x11vnc options:
-display disp -auth file -N
@ -11186,7 +11189,7 @@ libvncserver-tight-extension options:
% x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.9.3 lastmod: 2007-08-15
x11vnc: allow VNC connections to real X11 displays. 0.9.3 lastmod: 2007-08-17
(type "x11vnc -opts" to just list the options.)
@ -11997,14 +12000,15 @@ Options:
your long "login:" line press the Up arrow once
(before typing anything else).
Another option is "geom=WxH" or "geom=WxHxD"
(or ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going to
be created. It sets the width and height of the new
display, and optionally the color depth as well. You
can also supply "kde", "gnome", "fvwm", "twm",
or "failsafe" to have the created display use that
mode for the user session.
Another option is "geom=WxH" or "geom=WxHxD" (or
ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going
to be created. It sets the width and height of
the new display, and optionally the color depth as
well. You can also supply "gnome", "kde", "twm",
"fvwm", "mwm", "dtwm", "wmaker", "Xsession",
or "failsafe" (same as "xterm") to have the created
display use that mode for the user session.
To disable the option setting set the environment
variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.
@ -12100,14 +12104,18 @@ Options:
e.g., WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X and/or
leave out ones you do not want. The the extra case
"X" means try to start up a real, hardware X server
using xinit(1) or startx(1). If there is already an
X server running the X case may only work on Linux
(see startx(1)).
using xinit(1) or startx(1). "Xvnc" also works. If
there is already an X server running the X case may
only work on Linux (see startx(1)).
You can set the environment variable FD_GEOM (or
X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width
and height and optionally the color depth of the
created display.
created display. You can also set FD_SESS to be the
session (short name of the windowmanager: kde, gnome,
twm, failsafe), and FD_OPTS as extra options to pass
to the created X server. You can also set FD_PROG to
be the full path to the session/windowmanager program.
If you want the FINDCREATEDISPLAY session to contact an
XDMCP login manager (xdm/gdm/kdm) on the same machine,

@ -834,14 +834,15 @@ void print_help(int mode) {
" your long \"login:\" line press the Up arrow once\n"
" (before typing anything else).\n"
"\n"
" Another option is \"geom=WxH\" or \"geom=WxHxD\"\n"
" (or ge=). This only has an effect in FINDCREATEDISPLAY\n"
" mode when a virtual X server such as Xvfb is going to\n"
" be created. It sets the width and height of the new\n"
" display, and optionally the color depth as well. You\n"
" can also supply \"kde\", \"gnome\", \"fvwm\", \"twm\",\n"
" or \"failsafe\" to have the created display use that\n"
" mode for the user session.\n"
" Another option is \"geom=WxH\" or \"geom=WxHxD\" (or\n"
" ge=). This only has an effect in FINDCREATEDISPLAY\n"
" mode when a virtual X server such as Xvfb is going\n"
" to be created. It sets the width and height of\n"
" the new display, and optionally the color depth as\n"
" well. You can also supply \"gnome\", \"kde\", \"twm\",\n"
" \"fvwm\", \"mwm\", \"dtwm\", \"wmaker\", \"Xsession\",\n"
" or \"failsafe\" (same as \"xterm\") to have the created\n"
" display use that mode for the user session.\n"
"\n"
" To disable the option setting set the environment\n"
" variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.\n"
@ -937,14 +938,18 @@ void print_help(int mode) {
" e.g., WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X and/or\n"
" leave out ones you do not want. The the extra case\n"
" \"X\" means try to start up a real, hardware X server\n"
" using xinit(1) or startx(1). If there is already an\n"
" X server running the X case may only work on Linux\n"
" (see startx(1)).\n"
" using xinit(1) or startx(1). \"Xvnc\" also works. If\n"
" there is already an X server running the X case may\n"
" only work on Linux (see startx(1)).\n"
"\n"
" You can set the environment variable FD_GEOM (or\n"
" X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width\n"
" and height and optionally the color depth of the\n"
" created display.\n"
" created display. You can also set FD_SESS to be the\n"
" session (short name of the windowmanager: kde, gnome,\n"
" twm, failsafe), and FD_OPTS as extra options to pass\n"
" to the created X server. You can also set FD_PROG to\n"
" be the full path to the session/windowmanager program.\n"
"\n"
" If you want the FINDCREATEDISPLAY session to contact an\n"
" XDMCP login manager (xdm/gdm/kdm) on the same machine,\n"

@ -678,8 +678,8 @@ static char *dcop_session(void) {
p = strtok(out, "\n");
while (p) {
if (db) fprintf(stderr, "p: %s\n", p);
char *q = strstr(p, ".DCOP");
if (db) fprintf(stderr, "p: %s\n", p);
if (q == NULL) {
;
} else if (host) {

@ -963,8 +963,8 @@ char create_display[] =
"}\n"
"\n"
"findsession() {\n"
" if [ \"X$session\" != \"X\" ]; then\n"
" echo \"$session\"\n"
" if [ \"X$FD_PROG\" != \"X\" ]; then\n"
" echo \"$FD_PROG\"\n"
" return\n"
" fi\n"
" if [ \"X$have_gnome_session\" != \"X\" -a \"X$FD_SESS\" = \"Xgnome\" ]; then\n"
@ -979,12 +979,30 @@ char create_display[] =
" elif [ \"X$have_fvwm2\" != \"X\" -a \"X$FD_SESS\" = \"Xfvwm\" ]; then\n"
" echo \"$have_fvwm2\"\n"
" return\n"
" elif [ \"X$have_mwm\" != \"X\" -a \"X$FD_SESS\" = \"Xmwm\" ]; then\n"
" elif [ \"X$have_mwm\" != \"X\" -a \"X$FD_SESS\" = \"Xmwm\" ]; then\n"
" echo \"$have_mwm\"\n"
" return\n"
" elif [ \"X$have_dtwm\" != \"X\" -a \"X$FD_SESS\" = \"Xdtwm\" ]; then\n"
" echo \"$have_dtwm\"\n"
" return\n"
" elif [ \"X$have_windowmaker\" != \"X\" -a \"X$FD_SESS\" = \"Xwmaker\" ]; then\n"
" echo \"$have_windowmaker\"\n"
" return\n"
" elif [ \"X$have_wmaker\" != \"X\" -a \"X$FD_SESS\" = \"Xwmaker\" ]; then\n"
" echo \"$have_wmaker\"\n"
" return\n"
" elif [ \"X$have_Xsession\" != \"X\" -a \"X$FD_SESS\" = \"XXsession\" ]; then\n"
" echo \"$have_Xsession\"\n"
" return\n"
" elif [ \"X$have_Xsession\" != \"X\" -a \"X$FD_SESS\" = \"Xcde\" ]; then\n"
" echo \"$have_Xsession\"\n"
" return\n"
" elif [ \"X$have_xterm\" != \"X\" -a \"X$FD_SESS\" = \"Xfailsafe\" ]; then\n"
" echo \"$have_xterm\"\n"
" return\n"
" elif [ \"X$have_xterm\" != \"X\" -a \"X$FD_SESS\" = \"Xxterm\" ]; then\n"
" echo \"$have_xterm\"\n"
" return\n"
" fi\n"
" home=`csh -f -c \"echo ~$USER\"`\n"
" if [ \"X$home\" = \"X\" -o ! -d \"$home\" ]; then\n"
@ -1090,11 +1108,11 @@ char create_display[] =
" ns=4\n"
" if [ \"X$use_xdmcp_query\" = \"X1\" ]; then\n"
" # we cannot use -nolisten tcp\n"
" echo \"$* -once -query localhost\" 1>&2\n"
" echo \"$* -once -query localhost $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
" $have_nohup $* -once -query localhost 1>&2 &\n"
" $have_nohup $* -once -query localhost $FD_OPTS 1>&2 &\n"
" else\n"
" $have_nohup sh -c \"(sleep $ns; $* -once -query localhost -auth $authfile)\" 1>&2 &\n"
" $have_nohup sh -c \"(sleep $ns; $* -once -query localhost -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" ns=0\n"
" result=1\n"
" fi\n"
@ -1105,24 +1123,24 @@ char create_display[] =
" else\n"
" sxcmd=$have_xinit\n"
" fi\n"
" echo \"$sxcmd $sess -- $* -nolisten tcp -auth $authfile\" 1>&2\n"
" echo \"$sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
" $sxcmd $sess -- $* -nolisten tcp -auth $authfile 1>&2 &\n"
" $sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS 1>&2 &\n"
" else\n"
" $have_nohup sh -c \"(sleep $ns; $sxcmd $sess -- $* -nolisten tcp -auth $authfile)\" 1>&2 &\n"
" $have_nohup sh -c \"(sleep $ns; $sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" ns=0\n"
" result=1\n"
" fi\n"
" pid=$!\n"
" else\n"
" echo \"$* -nolisten tcp -auth $authfile\" 1>&2\n"
" echo \"$* -nolisten tcp -auth $authfile $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
" $have_nohup $* -nolisten tcp -auth $authfile 1>&2 &\n"
" $have_nohup $* -nolisten tcp -auth $authfile $FD_OPTS 1>&2 &\n"
" pid=$!\n"
" sleep 2\n"
" $have_nohup $sess 1>&2 &\n"
" else\n"
" $have_nohup sh -c \"(sleep $ns; $* -nolisten tcp -auth $authfile)\" 1>&2 &\n"
" $have_nohup sh -c \"(sleep $ns; $* -nolisten tcp -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" pid=$!\n"
" sleep 2\n"
" $have_nohup sh -c \"(sleep $ns; $sess)\" 1>&2 &\n"
@ -1182,6 +1200,14 @@ char create_display[] =
" #have_startx=$save_have_startx\n"
"}\n"
"\n"
"try_Xvnc() {\n"
" if [ \"X$have_Xvnc\" = \"X\" ]; then\n"
" return\n"
" fi\n"
"\n"
" server $have_Xvnc :$N -geometry $geom -depth $depth\n"
"}\n"
"\n"
"try_Xvfb() {\n"
" if [ \"X$have_Xvfb\" = \"X\" ]; then\n"
" return\n"
@ -1212,7 +1238,18 @@ char create_display[] =
" -e 'keycode any = Alt_R' \\\n"
" -e 'keycode any = Meta_L' \\\n"
" -e 'clear Mod1' \\\n"
" -e 'add Mod1 = Alt_L Alt_R Meta_L' \\\n"
" -e 'add Mod1 = Alt_L Alt_R Meta_L';\n"
" if uname | grep SunOS > /dev/null; then\n"
" for sym in SunAudioMute SunAudioLowerVolume SunAudioRaiseVolume\n"
" do\n"
" if $have_xmodmap -pk | grep -w \\$sym > /dev/null; then\n"
" :\n"
" else\n"
" $have_xmodmap -e \\\"keycode any = \\$sym\\\"\n"
" fi\n"
" done\n"
" fi\n"
"\n"
" )\" 1>&2 &\n"
" else\n"
" (\n"
@ -1225,7 +1262,18 @@ char create_display[] =
" -e 'keycode any = Alt_R' \\\n"
" -e 'keycode any = Meta_L' \\\n"
" -e 'clear Mod1' \\\n"
" -e 'add Mod1 = Alt_L Alt_R Meta_L' \\\n"
" -e 'add Mod1 = Alt_L Alt_R Meta_L';\n"
" # this is to workaround a bug with JDS Solaris 10 gnome-session-daemon.\n"
" if uname | grep SunOS > /dev/null; then\n"
" for sym in SunAudioMute SunAudioLowerVolume SunAudioRaiseVolume\n"
" do\n"
" if $have_xmodmap -pk | grep -w $sym > /dev/null; then\n"
" :\n"
" else\n"
" $have_xmodmap -e \"keycode any = $sym\"\n"
" fi\n"
" done\n"
" fi\n"
" ) 1>&2 &\n"
" fi\n"
" fi\n"
@ -1332,7 +1380,7 @@ char create_display[] =
" p_ok=1\n"
"fi\n"
"\n"
"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb xauth mcookie md5sum xmodmap startkde gnome-session blackbox fvwm2 mwm openbox twm windowmaker metacity X Xorg XFree86 Xsun Xsession netstat nohup\n"
"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb Xvnc xauth mcookie md5sum xmodmap startkde gnome-session blackbox fvwm2 mwm openbox twm windowmaker wmaker metacity X Xorg XFree86 Xsun Xsession dtwm netstat nohup\n"
"do\n"
" p2=`echo \"$prog\" | sed -e 's/-/_/g'`\n"
" eval \"have_$p2=''\"\n"
@ -1383,6 +1431,8 @@ char create_display[] =
" try_Xdummy\n"
" elif echo \"$curr_try\" | grep -iw \"Xvfb\" > /dev/null; then\n"
" try_Xvfb\n"
" elif echo \"$curr_try\" | grep -iw \"Xvnc\" > /dev/null; then\n"
" try_Xvnc\n"
" elif echo \"$curr_try\" | grep -iw \"X\" > /dev/null; then\n"
" try_X\n"
" fi\n"

@ -1789,7 +1789,7 @@ if (0) db = 1;
if (strstr(cmd, "FINDCREATEDISPLAY") == cmd) {
char *opts = strchr(cmd, '-');
char st[] = "";
char geom[32], xsess[32];
char geom[128], xsess[128], fdopts[128], fdprog[128];
if (opts) {
opts++;
if (strstr(opts, "xdmcp")) {
@ -1801,6 +1801,8 @@ if (0) db = 1;
sprintf(geom, "NONE");
xsess[0] = '\0';
geom[0] = '\0';
fdopts[0] = '\0';
fdprog[0] = '\0';
#if 0
if (!keep_unixpw_opts) {
fprintf(stderr, "no keep_unixpw_opts\n");
@ -1820,6 +1822,16 @@ if (!keep_unixpw_opts) {
sprintf(xsess, "fvwm");
} else if (strstr(t, "mwm")) {
sprintf(xsess, "mwm");
} else if (strstr(t, "cde")) {
sprintf(xsess, "cde");
} else if (strstr(t, "dtwm")) {
sprintf(xsess, "dtwm");
} else if (strstr(t, "xterm")) {
sprintf(xsess, "xterm");
} else if (strstr(t, "wmaker")) {
sprintf(xsess, "wmaker");
} else if (strstr(t, "Xsession")) {
sprintf(xsess, "Xsession");
} else if (strstr(t, "failsafe")) {
sprintf(xsess, "failsafe");
}
@ -1855,14 +1867,22 @@ if (!keep_unixpw_opts) {
free(t);
}
if (geom[0] == '\0' && getenv("FD_GEOM")) {
snprintf(geom, 30, "%s", getenv("FD_GEOM"));
snprintf(geom, 120, "%s", getenv("FD_GEOM"));
}
if (xsess[0] == '\0' && getenv("FD_SESS")) {
snprintf(xsess, 30, "%s", getenv("FD_SESS"));
snprintf(xsess, 120, "%s", getenv("FD_SESS"));
}
if (fdopts[0] == '\0' && getenv("FD_OPTS")) {
snprintf(fdopts, 120, "%s", getenv("FD_OPTS"));
}
if (fdprog[0] == '\0' && getenv("FD_PROG")) {
snprintf(fdprog, 120, "%s", getenv("FD_PROG"));
}
set_env("FD_GEOM", geom);
set_env("FD_SESS", xsess);
set_env("FD_OPTS", fdopts);
set_env("FD_PROG", fdprog);
if (usslpeer || (unixpw && keep_unixpw_user)) {
char *uu = usslpeer;
@ -1872,13 +1892,17 @@ if (!keep_unixpw_opts) {
create_cmd = (char *) malloc(strlen(tmp)+1
+ strlen("env USER='' ")
+ strlen("FD_GEOM='' ")
+ strlen("FD_OPTS='' ")
+ strlen("FD_PROG='' ")
+ strlen("FD_SESS='' /bin/sh ")
+ strlen(uu) + 1
+ strlen(geom) + 1
+ strlen(xsess) + 1
+ strlen(fdopts) + 1
+ strlen(fdprog) + 1
+ strlen(opts) + 1);
sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' FD_SESS='%s' /bin/sh %s %s",
uu, geom, xsess, tmp, opts);
sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' FD_SESS='%s' FD_OPTS='%s' FD_PROG='%s' /bin/sh %s %s",
uu, geom, xsess, fdopts, fdprog, tmp, opts);
} else {
create_cmd = (char *) malloc(strlen(tmp)
+ strlen("/bin/sh ") + 1 + strlen(opts) + 1);

@ -2,7 +2,7 @@
.TH X11VNC "1" "August 2007" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.9.3, lastmod: 2007-08-15
version: 0.9.3, lastmod: 2007-08-17
.SH SYNOPSIS
.B x11vnc
[OPTION]...
@ -983,14 +983,15 @@ type and enter your password incorrectly, to retrieve
your long "login:" line press the Up arrow once
(before typing anything else).
.IP
Another option is "geom=WxH" or "geom=WxHxD"
(or ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going to
be created. It sets the width and height of the new
display, and optionally the color depth as well. You
can also supply "kde", "gnome", "fvwm", "twm",
or "failsafe" to have the created display use that
mode for the user session.
Another option is "geom=WxH" or "geom=WxHxD" (or
ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going
to be created. It sets the width and height of
the new display, and optionally the color depth as
well. You can also supply "gnome", "kde", "twm",
"fvwm", "mwm", "dtwm", "wmaker", "Xsession",
or "failsafe" (same as "xterm") to have the created
display use that mode for the user session.
.IP
To disable the option setting set the environment
variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.
@ -1094,16 +1095,20 @@ using
.IR xinit (1)
or
.IR startx (1).
If there is already an
X server running the X case may only work on Linux
(see
"Xvnc" also works. If
there is already an X server running the X case may
only work on Linux (see
.IR startx (1)
).
.IP
You can set the environment variable FD_GEOM (or
X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width
and height and optionally the color depth of the
created display.
created display. You can also set FD_SESS to be the
session (short name of the windowmanager: kde, gnome,
twm, failsafe), and FD_OPTS as extra options to pass
to the created X server. You can also set FD_PROG to
be the full path to the session/windowmanager program.
.IP
If you want the FINDCREATEDISPLAY session to contact an
XDMCP login manager (xdm/gdm/kdm) on the same machine,

@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.9.3 lastmod: 2007-08-15";
char lastmod[] = "0.9.3 lastmod: 2007-08-17";
/* X display info */

Loading…
Cancel
Save