PDA

View Full Version : Using X -query to setup a LAN



A. Jorge Garcia
10-23-2003, 06:39 PM
I'm having a problem with X -query - I can't get this to work at all.

If I knoppix-installer all 25 PCs in my classroom, I was thinking of adding X -query to /etc/rc.d/rc.local to automatically have my student's X-server boot to the "server's" X-server so they go directly to a login screen with their userids and /home dirs. Is there something else I have to initialize for this to work?

BTW, do I need to update /etc/hosts for X -query to work if I'm using raw ip addresses? What about X -broadcast?

Sorry I'm so clueless wrt setting up a LAN....

TIA,

A. Jorge Garcia
10-25-2003, 02:11 AM
I remember setting up a LAN like this years ago with Slackware. I just added X -query 10.10.2.64 (where 10.10.2.64 is the server ip address) to /etc/rc.d/rc.local and every PC booted-up as a slave to the server's X login screen. Now I can't get this to work. Is there something new I'm missing? There seems to be a bunch of different rc.d's and no rc.local but something like kdelaunch.local?

TIA,

RockMumbles
10-25-2003, 04:57 AM
On your server you'll need to set up kdm, gdm or xdm to allow remote X logins, what is your servers login display program? If you are using kdm you should be able to find the threads here on setting it up to allow remote x logins. I use gdm and its setup is different.

You wouldn't really have to install on all of the 25 client machines, you could just run from cd (or a poorman's install), booting into runlevel 2 (console mode) using:
knoppix 2 (plus any other necessary boot parameters)

then once the student's (client) computer has the root prompt then use:

X -query ip.add.re.ss

or use:

X -broadcast

If you want to do hd installs on each client, then I would recommend setting the default runlevel to 2 (console mode) and then at the very end of the runlevel 2 startup run a script that will run either of the X commands. I made a script in my init.d directory called Xrem which had the line:
/usr/X11R6/bin/X -query 10.181.6.25
you have to make the Xrem script executable for at least root.

then in /etc/rc2.d I made a symlink to Xrem like this:

ln -s /etc/init.d/Xrem /etc/rc2.d/S99Xrem

The reason I named this S99Xrem is it needs to be the last startup script ran on boot.

HTH

~rock

A. Jorge Garcia
10-25-2003, 04:31 PM
Client Side and hdinstall:
OOO, this is exactly what I was looking for! Thanx, Rock! I sure would like to get away from CDs and boot floppies and data floppies. OK, how do I run a script after runlevel 2 completes? You say make Xrem an executable (shell?) script in /etc/init.d and then make a sym link in /etc/rc2.d - is that all I do?

This is so differrent than I remember. Years ago I think all I did was to set runlevel 3 and add /usr/X11R6/bin/X -query 10.10.2.64 to the end of /etc/rc.d/rc.local! Does it matter on the client side whether I knoppix-instaler as knoppix or debian for this procedure to work?

Server Side and hdinstall:
I'm not sure, but I imagine I'm using kdm for logins. I use whatever the default is from the debian knoppix-installer which is how I installed the server. OK, I found http://www.knoppix.net/forum/viewtopic.php?p=6873#6873, but this link does not exist: http://linux-sxs.org/remotexkdm.html

Client Side and liveCD
Now that you mention it though, maybe just running knoppix 2 off the poor man's install would suffice. Will my clients still have all the poor man's install autodetection and <k><knoppix><configure><configure printers> as well as /mnt/auto/floppy?

Thanx,

A. Jorge Garcia
10-29-2003, 02:03 AM
OK, I tried to get this to work today.

On my server (which is knoppix-installed as debian):
I editted the /etc/kde3/kdm/Xaccess file to uncomment this line:
any host can get a login window
Then I editted the file /etc/kde3/kdm/kderc and set Enable to true:
[Xdmcp]
Enable=true
Then I issued the command line:
/etc/init.d/kdm start
and in /etc/rc5.d I issued the command line:
ln -s /etc/init.d/kdm /etc/rc5.d/S99kdm
then, one final command line:
chmod a-x /etc/init.d/xsession

On my client (which is a KNOPPIX liveCD or poor man's CD image):
I issused the following command line after a knoppix 2 boot:
X -query 10.10.2.64
(which is the server's ip).

The client booted up to the grey X screen and froze! Now, what did I miss?

If I can get this working with the liveCD, then I'll figure out how to get the clients working this way as hdd installs.

TIA,

A. Jorge Garcia
11-19-2003, 04:51 PM
OK, I tried to get this to work AGAIN today!!!

Server Side:
My server is knoppix-installed as debian.

I checked the /etc/kde3/kdm/Xaccess file to see if I uncommented this line:
any host can get a login window

Then I checked the file /etc/kde3/kdm/kdmrc and to see if I set Enable to true:
[Xdmcp]
Enable=true

Then I issued the command line:
/etc/init.d/kdm restart

Then I
rm /etc/rc5.d/S99kdm
and reissued the command line:
ln -s /etc/init.d/kdm /etc/rc5.d/S99kdm

Then, one final command line:
chmod a-x /etc/init.d/xsession

Client Side:
My clients are also knoppix-installed as debian and set to boot to runlevel 3 (text-based login screen only).
I logged-in as a user defined on the client and issused the following command line:
X -query 10.10.2.5
(which is the server's ip).

The client booted up to a grey X screen and froze! All I can do is move the mouse around!! What I expected to see was the login screen on the server....

What's wrong here? Please help!!!

TIA,

horo
11-19-2003, 05:27 PM
Hi,

this is what I did:

In /etc/kde3/kdm/Xaccess change
#* ...
to
* ...

In /etc/kde3/kdm/kdmrc in section [Xdmcp]
Enable=true
In /etc/X11/xdm/Xaccess the same change as above.

and finally in /etc/X11/xdm/xdm-conf comment out this line:
DisplayManager.requestPort: 0
it becomes
! DisplayManager.requestPort: 0

Then do:
/etc/init.d/kdm restart

For a test on this computer:
X -query localhost :1
on VT8 should start a KDM screen.

If this is ok, you can try it from another computer:
X -query <COMPUTERNAME>
if there is no X running, else
X -query <COMPUTERNAME> :1

I was able to work with an old notebook (486, 16MB, 640x480, virtual screen 800x600, 10BaseT, SuSE 7.0) without problems.

Hope it helps,
Ciao Martin

A. Jorge Garcia
11-19-2003, 08:54 PM
OK, great! Thanx Martin (aka horo), I will try that in my lab tomorrow! It looks like you caught some steps I left out....

Regards,

A. Jorge Garcia
11-20-2003, 03:17 AM
Oh, btw, how do I view VT8 agian?

TIA,

A. Jorge Garcia
11-20-2003, 05:36 PM
Martin: Thanx for all your help.

horo
11-20-2003, 06:29 PM
X -query localhost:1
should be


X -query localhost :1
(Space between localhost and :1)

I tried it yet with an unchanged Knoppix box (192.168.1.99). All I had to do was:

1. In /etc/kde3/kdm/Xaccess change
#* #any host...
to
* #any host...

2. In /etc/kde3/kdm/kdmrc set
[Xdmcp]
Enable=true

After /etc/init.d/kdm restart I was able to
X -query localhost :1
This gave me a logon screen on vt8, vt7 was my original kdm screen.

From another box (192.168.1.100) in runlevel 3 (no X)I connected with
X -query 192.168.1.99
If there is already a X running I use
X -query 192.168.1.99 :1

Works with these two changes above.

Good luck
Ciao Martin

A. Jorge Garcia
11-20-2003, 07:12 PM
Martin:
Just two questions.

(1) Are you sure I don't also need the following?

Then I
rm /etc/rc5.d/S99kdm
ln -s /etc/init.d/kdm /etc/rc5.d/S99kdm
chmod a-x /etc/init.d/xsession
which was part of my earlier post, but not part of yours and
/etc/init.d/kdm restart
I was told by another knopper that I did....

(2) I forget how to view VT8. How do I do this?

TIA!

horo
11-20-2003, 09:47 PM
Hi Jorge,

(1) No, I didn't need it.
(2) < ALT><CTRL>F8 brings you to vt8
First try to get it over localhost and if this is ok try the networked version.

Ciao Martin

Edit: Sorry, I typed ALT CTRL in <>, but the ALT was "eaten" by the forum software. :(

A. Jorge Garcia
11-21-2003, 02:08 PM
Thanx Martin, I'll try this again later today when I get a chance. BTW, I tried <ctrl><F8> and didn't get what I expected, that's why I thought I didn't remember right how to view VT8....

Regards,

horo
11-22-2003, 04:19 PM
<ALT><CTRL> Fx if you are on X
<ALT>Fx from a textconsole, but <ALT><CTRL>Fx doesn't hurt.
If HTML Code is enabled in the forum <ALT> ist recognized as a HTML tag and you don't see it. :(

Ciao Martin

RockMumbles
11-22-2003, 06:37 PM
horo

For a test on this computer:
X *-query *localhost *:1
on VT8 should start a KDM screen.

Thanks for the great xdmcp testing tip!

~rock

horo
11-24-2003, 04:35 PM
Hi Jorge,

I tried my "two changes solution" from above just on a knoppix running from CD. I had to replace the two symlinks to CD with real files in ramdisk. It worked, _but_only_ if I had a configured eth0. If eth0 was not running, I got only the gray X screen. Maybe it's a hint for you to narrow down your problem.

Ciao Martin

A. Jorge Garcia
11-25-2003, 12:53 AM
Thanx for your concern and continued help! I don't need to fix the symlinks if I'm running off hdinstall, right? BTW, I tested to make sure eth0 was working....

Thanx,

A. Jorge Garcia
11-26-2003, 03:54 PM
Sorry to leave you hanging, but this week was too hectic to play with my hdinstalls. I'll definitely try after T-Day!

Thanx,

A. Jorge Garcia
12-11-2003, 03:11 AM
Thank you, thank you, thank you, gentlemen! Finally, I got this mess to work. I did as Doug suggested. I think that after all the mods I made on the clients and server hdds, I must have screwed-up xhost.

Steps that worked:
(1)Server: I installed my server with knoppix-installer as Debian, addusers, and made all the server modifications listed in the links above. I then ran xhost +eachclientip but I found that adding the ips to /etc/hosts on the server works best!

(2)Client: Then I have my clients boot the knoppix cd with the boot string: knoppix 2. Then my clients run X -broadcast (I did not need :1) or X -query 10.10.2.5. And all is finally as it should be in the Land of Linux!

Minor problems left to resolve:
(1)Client: What I need to do is have my knoppix-installer as knoppix clients boot up to runlevel 2 so I don't need to burn so many cds....

(2)Server: The clients and the server resolution are both 800x600 only. If I boot the CD with the boot string: vga=normal screen=1024x768 xvrefresh=60 which used to work, I get a video modes on server and client mismatch error. I need to figure out how to get my i810 intel video onboard chip to give me its other mode, namely 1024x768 on the server. I got this res on the clients (when using ssh and fish instead of X -query) by booting a CD with the given boot string and copying the XF86Config-4 file from the ramdisk to my hdinstall. However, this only worked on knoppix-installer as knoppix, not knoppix-installer as debian. I had to knoppix-installer as debian my server to addusers and get the login window for my users....

Thanx,

A. Jorge Garcia
12-11-2003, 07:18 PM
OK, I tried X -query localhost :1 from vt2 and EDIT: got the login screen right away on vt8 (on my knoppix-installer as debian server)! Hurray!!

From a client PC (knoppix-installer as debian), if try X -broadcast :1 from vt2, then I get the login screen on vt8. EDIT: The only problem is that it doesn't come up in vt8 until I change to a vt other that 2 or 8 first. Otherwise it just sits there forever with a dark screen in vt2. Why must I play this game or why does it take so long? Can I do something about that?

NB:
(1) If you try this on an knoppix-installed as debian client, please note that vt7 is the local terminal and vt8 with be the remote terminal and vt>8 are undefined (as was 8 before the X -query).

(2)If you try this on an knoppix-installed as knoppix client instead, vt5 is local, vt6 is remote and vt>6 are undefined (as was 6 before the X -query).

(3)If you try this on alive CD, you need the knoppix 2 boot string. When you get the command line on vt1, you issue the X -broadcast command and you get a remote login terminal on vt5. BTW, with knoppix 2, as you are in textmode, you don't need the :1 at all.

TIA,

A. Jorge Garcia
12-14-2003, 12:41 AM
************************************************** **
All right, here's what worked for me based on HORO's work - THANX!
************************************************** **




SETUP Server (knoppix-installed as debian)
1. In a root console edit with kwrite the file /etc/kde3/kdm/Xaccess changing #* #any host... to * #any host...

2. In a root console edit with kwrite the file /etc/kde3/kdm/kdmrc changing Enable=false to Enable=true under [Xdmcp]

3. In a root console edit with kwrite the file /etc/hosts adding the client ips

4. In a root console enter the command line /etc/init.d/kdm restart




TEST Server (knoppix-installed as debian)
In vt2 issue the command line X -query localhost :1 and you should get the kdm login window for this server right away on vt8 (as opposed to the local login window on vt7).

TEST ClientA (knoppix-installed as debian)
In vt2 issue the command line X -query ipofserver :1 or X -broadcast :1 and you should get the kdm login window for the server in vt8 (as opposed to the local login window on vt7). This process may hang unless you change vt's a few times.... WHY???

TEST ClientB (knoppix-installed as knoppix)
In vt2 issue the command line: X -query ipofserver :1 or X -broadcast :1 and you will get the kdm login window for the server in vt6 (as opposed to the local login window on vt5). This process may hang unless you change vt's a few times.... WHY???

TEST ClientC (liveCD)
After booting with the knoppix 2 cheatcode, issue the command line X -query ipofserver or X -broadcast and you will get the kdm login window for the server in vt5 (there is no local login window as we booted into textmode on vt1). On the liveCD, I get the login screen right away!




I haven't tested this, but if you set-up more than one server as described above, X -broadcast may not work. Do you need to use X -chooser and enable that in /etc/kde3/kdm/Xaccess?

Regards,