old-www/LDP/LG/issue93/tag/1.html

481 lines
18 KiB
HTML

<!--startcut ==============================================-->
<!-- *** BEGIN HTML header *** -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD>
<META NAME="generator" CONTENT="lgazmail v1.4G.j">
<TITLE>The Answer Gang 93: linux server for xwindow....need hints</TITLE>
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!-- *** END HTML header *** -->
<!--endcut ==============================================-->
<!-- begin 1 -->
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>linux server for xwindow....need hints</H3>
<p><strong>From J. BAKSHI
</strong></p>
<p></strong></p>
<p align="right"><strong>Answered By: Ashwin N, Jim Dennis, Dan Wilder, Jason Creighton, John Karns, Kapil Hari Paranjape, Thomas Adam
</strong></p>
<P><STRONG>
Hi all,
I am a faculty at an institute. we use Linux as a server. students telnet to
the linux server &amp; 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.
</STRONG></P>
<P><STRONG>
thanks in advanced
</STRONG></P>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ashwin]
You can install one of the many commercial X servers available.
</blockQuote>
<blockQuote><DL><DT>
HummingBird:
<DD><A HREF="http://www.hummingbird.com"
>http://www.hummingbird.com</A>
</DL></blockQuote>
<blockQuote><DL><DT>
WinaXe:
<DD><A HREF="http://www.labf.com/winaxe"
>http://www.labf.com/winaxe</A>
</DL></blockQuote>
<blockQuote>
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.
</blockQuote>
<blockQuote><DL><DT>
CygWin:
<DD><A HREF="http://www.cygwin.com"
>http://www.cygwin.com</A>
</DL></blockQuote>
<blockQuote><DL><DT>
CygWin/XFree86:
<DD><A HREF="http://www.cygwin.com/xfree"
>http://www.cygwin.com/xfree</A>
</DL></blockQuote>
<blockQuote><DL><DT>
CygWin/XFree86 User's Guide:
<DD><A HREF="http://xfree86.cygwin.com/docs/ug/cygwin-xfree-ug.html"
>http://xfree86.cygwin.com/docs/ug/cygwin-xfree-ug.html</A>
</DL></blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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.
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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."
</blockQuote>
<blockQuote>
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".
</blockQuote>
<blockQuote>
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.
</blockQuote>
<blockQuote>
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 <A HREF="http://www.redhat.com/">Red Hat</A>.
</blockQuote>
<blockQuote>
Take a look at <A HREF="http://www.cygwin.com"
>http://www.cygwin.com</A> and check the "XFree86" link on the front
page.
</blockQuote>
<blockQuote>
An alternative is the VNC package, <A HREF="http://www.uk.research.att.com/vnc"
>http://www.uk.research.att.com/vnc</A>
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".
</blockQuote>
<blockQuote>
Both approaches have their advocates. Both work. YMMV.
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Jason]
VNC ("Virtual network computing") can also be found at:
<A HREF="http://www.realvnc.com"
>http://www.realvnc.com</A>
</blockQuote>
<P><STRONG>
<IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
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.
</STRONG></P>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
We already answered this in other ways, but I just noticed your
postscript and wanted to add --- why not use KNOPPIX:
<A HREF="http://www.knoppix.net"
>http://www.knoppix.net</A>
</blockQuote>
<blockQuote>
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.
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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 <A HREF="http://www.debian.org/">Debian</A> install - nice easy install - Debian w/o the
install <TT>/</TT> configuration headache!
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Robos]
Well, they are working on a better installer, taking over the progeny
installer and modifying it. Dunno how far that went though...
</blockQuote>
<blockquote><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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.
</blockquote>
<P><STRONG>
<IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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.
</STRONG></P>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Robos]
Take a look at adduser, this is the debian way of adding users and groups to
the system and adding users to groups: &lt;quote man adduser&gt;
"They are friendlier front ends to the useradd and groupadd programs"
&lt;/quote&gt;
</blockQuote>
<blockQuote>
I created my users on my machine and that of my girlfriend just fine like
that. Give it a try!
</blockQuote>
<P><STRONG>
<IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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.
</STRONG></P>
<P><STRONG>
Then I deleted the login id via the <A HREF="http://www.kde.org/">KDE</A> 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.
</STRONG></P>
<blockquote><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather] Try adding the user to some of the same groups in /etc/group that the
user knoppix belongs to?
</blockquote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Kapil]
Since Knoppix is based on Debian it is likely that it uses the Xwrapper
program. This is controlled by <TT>/etc/X11/Xwrapper.config</TT> on a "sarge"
version of Debian. This file contains the "allowed_users" option with
possible values of "rootonly", "console" and "anybody".
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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....
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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
</blockQuote>
<blockQuote><CODE>
dpkg-reconfigure -plow xserver-common
</CODE></blockQuote>
<blockQuote>
but I am not sure how many changes Knoppix makes to "debconf"-style
configuration.
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
AFAICT, the debconf style intact as one would expect it to be in Debian.
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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...
</blockQuote>
<p align="center">See attached <tt><a href="../misc/tag/thomas.dot-xsession.txt">thomas.dot-xsession.txt</a></tt></p>
<blockQuote>
That is my ~/.xsession (chmod 700).
</blockQuote>
<P><STRONG>
<IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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 <em> _does</em> exist
what I would assume to be one for global use of all X users on the system.
</STRONG></P>
<P><STRONG>
It doesn't matter what I put in ~/.xsession, running startx gives the
output:
</STRONG></P>
<pre><strong>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
</strong></pre>
<P><STRONG>
<IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
OK, there is an Xwrapper config on the system which contains only the
following:
</STRONG></P>
<P><STRONG><BLOCKQuote>
Xwrapper.config
---------------
</BLOCKQuote></STRONG></P>
<pre><strong>allowed_users=console
nice_value=-10
</strong></pre>
<P><STRONG>
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.
</STRONG></P>
<P><STRONG>
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.
<IMG SRC="../../gx/dennis/unsmily.gif" ALT=":("
height="24" width="20" align="middle">
</STRONG></P>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Kapil]
What is the output of the "tty" command? On my system (<TT>/dev</TT> is devfs
type) the output is "<TT>/dev/vc/n</TT>" (where n is the number of the virtual
console). The wrapper strict says that the "console" keyword stands for
any virtual console.
</blockQuote>
<P><STRONG>
<IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
Output is "<TT>/dev/ttyn</TT>" where n is the virtcon number ... X runs, even with
the allowed_users set to "console".
</STRONG></P>
<P><STRONG>
Ahha, but if I run screen (as I customarily do), then "tty" reports
"<TT>/dev/pts/n-1</TT>" where the number of the term is 1 less than in the ttyn
above, and 'startx', fails.
</STRONG></P>
<P><STRONG>
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".
</STRONG></P>
<P><STRONG>
Thanks for your input.
</STRONG></P>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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 <TT>/</TT> 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.
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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)
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
Another nice venue for me has been the <A HREF="http://www.suse.com/">SuSE</A> 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.
</blockQuote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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
<IMG SRC="../../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</blockQuote>
<blockquote><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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.
</blockquote>
<blockQuote>
<IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [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.
</blockQuote>
<P><STRONG>
<IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Thanks to all of you, who have helped me by giving the technical hints on
setting a xwindow server.
</STRONG></P>
<P><STRONG>
I am very grateful to Mr. Dan Wilder for his writing on X server &amp; clients.
It has solved some of my confusion.
</STRONG></P>
<P><STRONG>
thanks a lot.
</STRONG></P>
<!-- end 1 -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>
<br>Copyright &copy; 2003
<br>Copying license <A HREF="">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 93 of <i>Linux Gazette</i>, August 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<SMALL><CENTER><H6 ALIGN="center">HTML script maintained by
<A HREF="mailto:star@starshine.org">Heather Stern</a> of
Starshine Technical Services,
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H6></SMALL></CENTER>
<HR>
<!--startcut ======================================================= -->
<P> <hr>
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
<p align="center">
<table width="100%" border="0"><tr>
<td align="right" valign="center"
><IMG ALT="" SRC="../../gx/navbar/left.jpg"
WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="middle" border="0"
><A HREF="../index.html"
><IMG SRC="../../gx/navbar/toc.jpg" align="middle"
ALT="[ Table Of Contents ]" border="0"></A
><A HREF="../lg_answer.html"
><IMG SRC="../../gx/dennis/answertoc.jpg" align="middle"
ALT="[ Answer Guy Current Index ]" border="0"></A></td>
<td align="center" valign="center"><A HREF="../lg_answer.html#greeting"><img align="middle"
src="../../gx/dennis/smily.gif" alt="greetings" border="0"></A> &nbsp;
<A HREF="../../tag/bios.html">Meet&nbsp;the&nbsp;Gang</A> &nbsp;
<A HREF="1.html">1</A> &nbsp;
<A HREF="2.html">2</A> &nbsp;
<A HREF="3.html">3</A> &nbsp;
<A HREF="4.html">4</A> &nbsp;
<A HREF="5.html">5</A> &nbsp;
<A HREF="6.html">6</A>
</td>
<td align="left" valign="center"><A HREF="../../tag/kb.html"
><IMG SRC="../../gx/dennis/answerpast.jpg" align="middle"
ALT="[ Index of Past Answers ]" border="0"></A
><IMG ALT="" SRC="../../gx/navbar/right.jpg" align="middle"
WIDTH="14" HEIGHT="45" BORDER="0"></td></tr></table>
</p>
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
<!--endcut ========================================================= -->
<P> <hr>
<!--startcut ======================================================= -->
<CENTER>
<!-- *** BEGIN navbar *** -->
<!-- *** END navbar *** -->
</CENTER>
</p>
<!--endcut ========================================================= -->
<!--startcut ======================================================= -->
</BODY></HTML>
<!--endcut ========================================================= -->