Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Feb 2003 16:48:08 -0600
From:      Mike Meyer <mwm-dated-1046558888.f33ef8@mired.org>
To:        "Brian Henning" <b1henning@hotmail.com>
Cc:        "freebsd" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: DISPLAY variable
Message-ID:  <15962.41256.111255.43404@guru.mired.org>
In-Reply-To: <OE72Cekp8tg1zSarY6F000074bf@hotmail.com>
References:  <OE72Cekp8tg1zSarY6F000074bf@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In <OE72Cekp8tg1zSarY6F000074bf@hotmail.com>, Brian Henning <b1henning@hotmail.com> typed:
> setenv DISPLAY ipaddr:0.0
> what are the display number and screen number used for?

The display number denotes which X server at ipaddr you're going to
talk to. It's basically added to 6000 to get a port number to connect
to. If I start a second X server with "startx -- :1" it will be the
second server, listening to 6001, and hence you would use ipaddr:1.x.

The screen number denotes which of the monitors that that X server is
managing that you want to open on. On my system with two monitors, the
second - smaller, as it happens - is at :0.1 on the first server, and
:1.1 on the second server.

> how do i know what number to use for the display number and screen number?

By knowing which X server and monitor you want to use.

> for example when i tunnel x11 through ssh for a user i use :10.0
> when i access x11 on the same network i use :0.0

ssh is forwarding the port - 6010 - for server #11 - :10 - to DISPLAY
if that environment variable is set. When I ssh from my workstation, I
use :10.1 to open things on the second monitor on the workstation.
Actually, ssh automatically walks through a list of port numbers until
it finds one that isn't used, sets DISPLAY on the server end to the
appropriate value, and forwards it to DISPLAY on the client end. If
you want, you can forward X11 by hand by forwarding port 6000 + X to
port 6000 - assuming you are using :0.0 - and setting your DISPLAY to
:X.0 in the shell. I have clients that don't forward ssh for security
reasons, and have to do that by hand when I'm on their machines.

	<mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15962.41256.111255.43404>