Remote X sessions or VNC (was:Re: Headless YellowDog)

Geert Janssens geert.janssens3 at pandora.be
Mon Oct 11 11:17:57 MDT 2004


Thank you both Bill and Jim,

Both your explanations on X as a server are very insightful. I also
found Bill's introduction to X in the YDL faq at sharplabs.

I'm not there yet though. Because of the many questions I have, I will
split them in different mails.

1. I followed the X session example FAQ, which really cleared things up
on how X works on a single machine. When it faq comes to a remote
machine, it gets a bit fuzzy for me. Here's what I did.

g3ydl is the desktop I'm sitting at, with the default X session on
console 7, and an extra, clean X session (:1) on console 8.
aragorn a the remote machine.

 From g3ydl, I ssh into aragorn, set DISPLAY to g3ydl:1 and export it.
Next I start an xterm, which immediatly exits with error:
Xlib: connection to "g3ydl:1.0" refused by server
Xlib: no protocol specified

On my virtual console on g3ydl that I used to start X :1, I get this
message:
AUDIT: <date>: 1452 X: client 1 rejected from IP 192.168.0.2 port 32827

So this part of the faq is not working out of the box. By the way
192.168.0.2 is the ip address of aragorn, so it's really my remote xterm
being refused

I remember in my unix days, we had to set xhost +[remote ip] or simply
xhost + to unlock the remote access to the X server.

So when I type xhost in console 2 on g3ydl, I get
access control enabled, only authorised clients can connect

and the screen switches to console 8

switching back to console 2 and typing xhost +, gives me
access control disabled, clients can connect from any host

and another switch to console 8

switching back yet again to console 2 and typing xhost shows me that the
access control is enabled again.

Then I had a bright idea :-) , and in console 2 I typed xterm, which
started an xterm in my X:1 session. In this xterm, I typed xhost +,
which disabled the access control again.

Now with this setup, in my remote session on aragorn, I start an xterm,
which now does appear on my X:1 session in g3ydl, hiding the locally
started xterm.

So apparently, I'm missing some clue about this access control. Can
anyone elaborate a bit on this, and maybe Bill, extend the concerning
faq a bit ?


2. With the workaround for the access control, I could effectively start
wmaker from my aragorn remote session, and that worked.

3. Next, I exited from wmaker, and typed startx, thinking this would
start my default window manager (kde), but that did not work. Instead,
it complained KDE was already running on display :0.0. Ok, so I typed
startx -- :1, which started another X session :1, but on aragorn's vt8.
This was not what I had in mind. Apparently startx ignores the display
setting, and maybe, startx does what the name implies: starting an X
session, but then completely with window and session managers.

4. So next, I used startkde on my aragorn remote session. And yes, this
finally brought me my KDE session. I did however skip the login session.
Is this normal, considering display 0 is also a logged in X session, or
that I logged in via ssh ?

5. So all of the above to learn something more about X, which I did. Now
I started all this as a question about VNC. But considering X can
display a remote KDE session locally, why would I still want VNC ?

This is meant as a general question. Perhaps for my purpose here, the
remote X solution is good, but what are the (dis)advantages of remote X
over VNC and vice versa ? In which situations would VNC be preferred or
the only solution, and in which situations remote X ?

Thanks,
Geert Jan

Longman, Bill wrote:
> So here are some questions that could further improve my VNC experience:
> 
> What is meant exactly with 'servers' in the above quote ? Is this in the
> (for me confusing) context of X where the screen you are working on is 
> the server, and the machine being connected to the client ? If so, what 
> exactly is meant with the :1, :2 and so on ? Until now, I always used :0
> which I was told to do in a former employment in a unix environment.
> 
> = Geert, in the context of VNC servers, you're talking about both a VNC
> server which accepts requests from client VNC sessions *AND* which is
> running an instance of an X server, in the usual X sense. So, I would say
> that a VNC server is two servers for the price of one - a VNC server which
> runs an X server.
> 
> = You know that when an X client connects to an X server, it does so with
> regard to the DISPLAY variable. If your DISPLAY environment variable is
> doppelbock.ales.com:2, your X client will try to send its output to that
> machine on display :2. You therefore necessarily have to have unique server
> identifiers on a given system. The console is generally on :0, but you can
> also run several X sessions on your console. As long as you have enough
> virtual terminals, you can run several of them. I often bring up KDE on my
> :0 and test my apps under Gnome on :1. Same machine, same hardware, just
> different X sessions.
> 
> 
> I understand that I don't need to connect to the local X session on the 
> server in the basement, but VNC can start it's own X session. Great!
> 
> Next point: I would like to display the VNC session on my YDL box in a 
> separate console (or virtual terminal?), like MOL can be run in a 
> separate console. I haven't managed that just yet. I only can have a 
> window in my existing X session on my YDL box. What magic should be 
> performed here ?
> 
> = VNC sessions always run their own X session. But your question here seems
> to me to ask, "How do you get access to the VNC server's X session from the
> console?" Well, you can't if you're just using "vncserver", but if you just
> start up another X session on the console that uses the VNC module, you'll
> be able to do it. Then you'd just VNC to foomachine:1 instead of
> foomachine:0.
> 
> Also, as I am using the system now, when I open the Remote Desktop 
> Connection tool on my YDL box, it starts with the following error
> message:
> 
> "Browsing the network is not possible. You probably did not install SLP 
> support correctly"
> 
> I have no clue what SLP is all about, and even less of a clue how to 
> install it. Any ideas ?
> 
> = SLP is just a multicasting method of device discovery. More and more
> printers are using it, for instance, so unlike the
> broadcast-all-my-printers-on-the-network-every-60-seconds stupidity of CUPS,
> your printer would just subscribe to an SLP instance and anyone else on the
> network would then see its capabilities. WITHOUT BROADCASTING EVERY DAMNED
> MINUTE!
> 
> 



More information about the yellowdog-general mailing list