[Gllug] Multiple X servers

Pete Ryland pdr at pdr.cx
Sun Dec 22 06:56:10 UTC 2002


On Sun, 2002-12-22 at 05:17, Tom Taylor wrote:
> Is there an easy(ish) way to run more than one X server on the one machine?
> 
> For example to have 2 different users logged in at once, both able to use X.

Run one of them on display ':1'.  So, directly you might run 'X :1'
(from a console) or 'startx -- :1' or if you are using an xdm (a login
window), try editing the config for that, then restart it.  For example,
if you are using gdm:

(Under X)
$ echo $DISPLAY
:0
$ ssh -X root at localhost  # -X may not be necessary depending on config
Password:
# echo $DISPLAY
localhost:10.0     # This is a 'forwarded' X (encrypted and all)
# gdmconfig        # In the 'X-server Setup' tab of the window that
                   # comes up, you can configure more X servers
# logout     # tip - under Unix ctrl-D (EOT) will logout of most things

ok, now you can logout of your x session and test this all will work:

# /etc/init.d/gdm restart

As an aside, you may notice in that config thing that it includes
options for XDMCP.  This protocol allows you to have a thin client
connect to your host by running an X server, then connecting to your xdm
login manager.  In this way, you can also be logged into several
machines at once from the one machine, via X!  You do this by going back
to a console and typing "X :1 -query hostname" which will start an X
session and then bring up the login screen for 'hostname'.  Gotta love
the way this works.  Usually this is disabled by default, though, for
security reasons.  Also, you can run X programs from anywhere to any
display by setting the DISPLAY env var and having the appropriate
'authority' which is either by your host being explicitly allowed using
the 'xauth' command (e.g. 'xauth +muriel') or by having the correct
$HOME/.Xauthority file around, so from the console, I can type

$ echo $DISPLAY
$ xterm
xterm Xt error: Can't open display: 
$ DISPLAY=:0 xterm &                     # This time it runs fine.

Pete
-- 
Pete Ryland
http://pdr.cx/


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list