multiple Xvnc servers on the same machine - howto?

Jason C. Chen jasonc "at" technologist.com
Thu, 16 Apr 1998 13:53:20 +0000


On Thu, 16 Apr 1998, Tristan Richardson wrote:

>It sounds like the Xvnc process is actually running OK for the other users. 
>Try using ps to make sure this is the case.

guest      609  0.6  6.8  5620  4340  ?  S   08:13   0:00 Xvnc :2 -desktop
X -httpd /usr/X11R6/lib/vnc/classes -auth /home/guest/.Xauthority
-geometry 1020x744 -depth 24 -pixelformat rgb888 -rfbwait 120000 -rfbauth
/home/guest/.vnc/passwd
jasonc     555  1.3 13.5  9696  8616  p0 S   08:13   0:01 Xvnc :1 -desktop
X -httpd /usr/X11R6/lib/vnc/classes -auth /home/jasonc/.Xauthority
-geometry 1020x744 -depth 24 -pixelformat rgb888 -rfbwait 120000 -rfbauth
/home/jasonc/.vnc/passwd

These processes look fine with me.

>When you say a "blank screen" do you mean the X root weave pattern, or a
>single colour?

Just on X root weave pattern and a X cursor... nothing else is run there,
no window manager, etc. (since all that have got connection refused
errors, as X.log reports). 

>What form do the connection refused errors in the log file take?  There's a
>difference between connections being refused at the TCP level and being
>refused because of X authority problems.  Try starting an X client manually
>e.g. if the vncserver script says it has started a desktop host:2, try running
>something like "xterm -display host:2".  Try also without specifying host,
>i.e. "xterm -display :2".


% xterm -display delphinus:1
--> this starts an xterm from the desktop window vncviewer host:1


However, 

% xterm -display delphinus:2
Xlib: connection to "delphinus:2.0" refused by server
Xlib: Client is not authorized to connect to Server
color_xterm Xt error: Can't open display: delphinus:2

% xterm -display :2
Xlib: connection to ":2.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
color_xterm Xt error: Can't open display: :2

% ls /tmp/.X11-unix
total 11
drwxrwxrwt   2 root     root         1024 Apr 16 08:13 ./
drwxrwxrwt  11 root     root        10240 Apr 16 08:19 ../
srwxrwxrwx   1 root     users           0 Apr 16 08:10 X0=
srwxrwxrwx   1 jasonc   users           0 Apr 16 08:13 X1=
srwxrwxrwx   1 guest    users           0 Apr 16 08:13 X2=

I don't see how X1 and X2 are different 

-- 
I tried something else, I run another vncserver on X3 (from jasonc) and I
got the same connection refused errors (Xlib: connection to host:3 refused
by server; Xlib: client is not authorized to connect to server;  fvwm: 
cannot connect to X server host:3) in the X.log.  I STILL get NOTHING on
the X desktop; HOWEVER, I CAN RUN manually (***)

 fvwm -display :3 
and 
 xterm -display :3 

to have a proper X desktop there. 

As it turns out that I can do the same thing (ie. *** above) as long as I
am logged in as a user who is also the owner of the X displays.  For
instance, when I am login as 'jasonc' and I own /tmp/.X11-unix/X3, I can
do fvwm -display :3 and xterm -display :3 after having a blank vncviewer X
screen.  If I login as 'guest' and I own /tmp/.X11-unix/X2, I can also do
fvwm -display :2 and xterm -display :2 to start it manually. 

If 'guest' tries to run xterm or other things on display 1 and 3, 'guest'
will receive the same error as reported above:

Xlib: connection refused 
Xlib: not authorized to connect to server
Xlib: Invalid MIT-MAGIC-COOKIE key
program: cannot open display


What may cause an "invalid" MAGIC cookie key?  I used 'xauth' to remove
that dpyname.  Vncserver added that entry again to the .Xauthority file
but it still complains about the cookie key being invalid.

Any comments are welcome...  meanwhile, I will try to understand what
these errors mean from the man pages, man xauth and man Xsecurity

At least now I have some direction to look for answers to my problems.
Please comment or suggest anything that may help me solve this problem.

Thanks alot,

Jason