(?) linux server for xwindow....need hints

From J. BAKSHI

Answered By: Ashwin N, Jim Dennis, Dan Wilder, Jason Creighton, John Karns, Kapil Hari Paranjape, Thomas Adam

Hi all, I am a faculty at an institute. we use Linux as a server. students telnet to the linux server & use the bash shell from their windows machine. but I am interested to provide them the xwindow system of linux. so is it possible to use the xwindow of the linux server from their client windows machines ? if yes then plz give me some hints or the internet source where I can know the process.

thanks in advanced

(!) [Ashwin] You can install one of the many commercial X servers available.
HummingBird:
http://www.hummingbird.com
WinaXe:
http://www.labf.com/winaxe
If you want a truly free X server you can use the one that ships with CygWin. As a bonus, your students can try their shell and system programming on CygWin itself. Almost every Linux commandline and programming utility is available on CygWin.
CygWin:
http://www.cygwin.com
CygWin/XFree86:
http://www.cygwin.com/xfree
CygWin/XFree86 User's Guide:
http://xfree86.cygwin.com/docs/ug/cygwin-xfree-ug.html
(!) [JimD] But ... PLEASE, stop using telnet! ssh -X will be far more secure and actually easier to use (if the cygwin version of OpenSSH support X11 forwarding/tunnelling to the cygwin X server). I'd only use the cygwin ssh for the X apps or for very simple commands --- for any curses applications I'd recommend putty. It's terminal emulation is better than any I've seen for MS Windows.
(!) [Dan] X Windows is a client-server arrangement. In the strict sense I use here, "client" means "program which initiates contact with a server" and "server" means "program which provides services when contacted."
In this sense the familiar X programs such as xterm, Mozilla, StarOffice, and so on, are all "clients" and the program which provides display services for these is a "server". To wit, an "X server".
Normally the X server runs on the workstation, while the X clients run on the workstation or elsewhere. In your model, the X clients would run on the Linux server system, while the X servers would run on the Windows systems.
You need an X server for Windows. You're in luck. The most popular X server for Linux, BSD, et al, XFree86, has been ported to Windows and is available as a part of the Cygwin package, developed originally by Cygnus Support, now owned by Red Hat.
Take a look at http://www.cygwin.com and check the "XFree86" link on the front page.
An alternative is the VNC package, http://www.uk.research.att.com/vnc which uses its own client-server arrangement. In this case the X server, "vncserver", runs on the Linux server and proxies the connection over to Windows, where the display is handled by "vncviewer".
Both approaches have their advocates. Both work. YMMV.
(!) [Jason] VNC ("Virtual network computing") can also be found at: http://www.realvnc.com

(?) PS: I know the best solution is to install the Linux at the clients machines, but the institute will not permit the same. so the only way is to use the xwindow of the Linux server pc.

(!) [JimD] We already answered this in other ways, but I just noticed your postscript and wanted to add --- why not use KNOPPIX: http://www.knoppix.net
You could use KNOPPIX CDs, boot the systems up, running X and ssh and a large collection of other Linux software right off the CD. You wouldn't be "installing" anything. KNOPPIX runs from CD and out of the RAM disk.
(!) [John] Knoppix is definitely cool and one heck of a technical marvel. I've been using it for a while for rescue type stuff, and a few other things. And night before last, I decided to install it on my newer Inspiron to get my feet wet with a Debian install - nice easy install - Debian w/o the install / configuration headache!
(!) [Robos] Well, they are working on a better installer, taking over the progeny installer and modifying it. Dunno how far that went though...
(!) [Heather] For very crude values of installer, you can actually install straight from knoppix. knx-hdinstall is the app you're looking for, though it's really a shell script laced with dialog commands.

(?) [John] One problem I'm having with the install is that I'm unable to run X as a user I created after the install. The install created a login "knoppix" and the root of course. Afterward, I created a personal login using the "useradd" utility, and specified the "-m" switch and that it use a login shell.

(!) [Robos] Take a look at adduser, this is the debian way of adding users and groups to the system and adding users to groups: <quote man adduser> "They are friendlier front ends to the useradd and groupadd programs" </quote>
I created my users on my machine and that of my girlfriend just fine like that. Give it a try!

(?) [John] However "startx" returns with an error informing me that the login is not authorized to use the X srvr. I looked through some of the X related scripts and have combed through some of the Debian docs and links the Knoppix has set up, but to no avail.

Then I deleted the login id via the KDE user mgr utility (w/o deleting the home dir) and re-created. It then let me run X from that account ... until I rebooted the machine, and now I have the same problem. Any insight on that? I've looked through the logs, and couldn't see any clue.

(!) [Heather] Try adding the user to some of the same groups in /etc/group that the user knoppix belongs to?
(!) [Kapil] Since Knoppix is based on Debian it is likely that it uses the Xwrapper program. This is controlled by /etc/X11/Xwrapper.config on a "sarge" version of Debian. This file contains the "allowed_users" option with possible values of "rootonly", "console" and "anybody".
(!) [Thomas] Kapil, you're not wrong, and indeed I actually use Knoppix purely as a rescue CD, preferring my version of Debian Sarge to be pure. Mind you, I might get around to running Knoppix in a chroot jail at some point....
(!) [Kapil] For more details "man Xwrapper.config" is your best bet. Since this file can be managed by "debconf" you could also try to run
dpkg-reconfigure -plow xserver-common
but I am not sure how many changes Knoppix makes to "debconf"-style configuration.
(!) [Thomas] AFAICT, the debconf style intact as one would expect it to be in Debian.
(!) [Thomas] Could the problem also be the "~/.xsession" does not exist? Typically Debain (and other distros) look for this file.... I'd check that that exists and if not do something like...

See attached thomas.dot-xsession.txt

That is my ~/.xsession (chmod 700).

(?) [John] Indeed it does not exist - in either users home dir, neither the one for which X functions normally nor the one for it doesn't. There _does exist what I would assume to be one for global use of all X users on the system.

It doesn't matter what I put in ~/.xsession, running startx gives the output:

Using authority file /home/jkarns/.Xauthority
Writing authority file /home/jkarns/.Xauthority
Using authority file /home/jkarns/.Xauthority
Writing authority file /home/jkarns/.Xauthority

X: user not authorized to run the X server, aborting

(?) [John] OK, there is an Xwrapper config on the system which contains only the following:

Xwrapper.config ---------------

allowed_users=console
nice_value=-10

I discover that if I change 'console' to 'anybody' then X runs. There is remains a caveat with the .Xauthority file, however. It gets written as an empty file, whether or not I'm allowed to run X.

In any event, I'd kinda prefer to use the security mechanism that they're implementing here and leave it set to 'console'. So it seems that the problem may lie with the system determining that I'm running starts from the console. These convoluted X startup scripts give me a headache. :(

(!) [Kapil] What is the output of the "tty" command? On my system (/dev is devfs type) the output is "/dev/vc/n" (where n is the number of the virtual console). The wrapper strict says that the "console" keyword stands for any virtual console.

(?) [John] Output is "/dev/ttyn" where n is the virtcon number ... X runs, even with the allowed_users set to "console".

Ahha, but if I run screen (as I customarily do), then "tty" reports "/dev/pts/n-1" where the number of the term is 1 less than in the ttyn above, and 'startx', fails.

So the problem does lie with the system not recognizing pts as being the console, which is probably correct, as xterms also seem to fall in the domain of "pts". So I guess that for now, the solution will be to "startx" before running "screen".

Thanks for your input.

(!) [John] It's worked wonderfully in almost all situations of booting from the CD. The only exception to date was when I was booting it on some older K6-2 mobos (PC100, a.k.a PC Chips brand) recently. Due to the SCSI emulation mode that Knoppix uses, there was some wierdness where I couldn't access the IDE hd - some kind of compatibility issue - haven't run into that with more recent / better quality mobos. Maybe could have worked around it some way, but didn't have the time to mess with it. Hats off to Mr. Knopper and his associates.
(!) [Robos] You can specify something to the kernel like hda=ide or something. There are the "cheat-codes" which would probably list this, and they are already there at the boot up screen (F1 IIRC)
(!) [John] Another nice venue for me has been the SuSE Live CD distro. Very similar in concept to Knoppix, (not quite as efficient at autoconfiguring the hardware) but with the added feature that it will write a (100 MB) cfg file to an existing FAT filesystem to make the configuration non-volatile. So you can cfg the NIC, routing table, user logins etc., and have it all set for subsequent logins.
(!) [Robos] Like persistent home with knoppix? You have the option to save config and your home to hdd with knoppix too, just RT*M a little :)
(!) [Heather] Actually, like persistent home plus config floppy. Knoppix seperates the two ideas. And I'm not sure it has any useful support for more than one user account.
(!) [John] Very nice - might be worth a look for the kind of usage that Mr Bakshi is talking about. The Live CD is available (last I checked at least) for free download from the SuSE mirror sites (www.suse.com for U.S.), contrary to their commercial multi-CD distro.

(?) Thanks to all of you, who have helped me by giving the technical hints on setting a xwindow server.

I am very grateful to Mr. Dan Wilder for his writing on X server & clients. It has solved some of my confusion.

thanks a lot.



Copyright © 2003
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 93 of Linux Gazette, August 2003
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/


[ Table Of Contents ][ Answer Guy Current Index ] greetings   Meet the Gang   1   2   3   4   5   6 [ Index of Past Answers ]