help: newbie xterm problem

help: newbie xterm problem

Post by fran » Fri, 14 Feb 2003 15:24:16



I am having a problem running "xterm" from the command line.  (ultimately I
want to run xterm from a remote computer with ssh, but first things first, I
can't even get it to run locally).

As I understand things "xterm" at command line should start an Xterminal and
"xclock" should start xterm with clock.

What I have:
Two machines: RH7.1 and RH8.0 both using bash environment
I can start KDE or Gnome fine with "startx" from command line
I can start a classic xterm with "xinit" from command line
I cannot get "xterm" to start.

What I've done so far:
"xterm" ( or xclock or xanything ) gets me an error message
"xterm Xt error: Can't open display: "

OK,  I try to set the DISPLAY variable to :0 like "export DISPLAY=:0"
Now I get error message   "xterm Xt error: Can't open display:0"

I've also tried setting DISPLAY to
:0.0
localhost:0.0
localhost:0
:1.0
192.168.1.100:0    (current IP assigned by DHCP)

also tried "xterm -display :0"

I've read the man pages and several online resources and can't get past
setting the DISPLAY variable.  Am I missing something other than some brain
cells?

Thanks in advance to anyone that helps me.
F

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/28/2003

 
 
 

help: newbie xterm problem

Post by Russel » Fri, 14 Feb 2003 16:43:34



> I am having a problem running "xterm" from the command line.  (ultimately I
> want to run xterm from a remote computer with ssh, but first things first, I
> can't even get it to run locally).

> As I understand things "xterm" at command line should start an Xterminal and
> "xclock" should start xterm with clock.

> What I have:
> Two machines: RH7.1 and RH8.0 both using bash environment
> I can start KDE or Gnome fine with "startx" from command line
> I can start a classic xterm with "xinit" from command line
> I cannot get "xterm" to start.

> What I've done so far:
> "xterm" ( or xclock or xanything ) gets me an error message
> "xterm Xt error: Can't open display: "

It looks like you're trying to start xterm from console (non X) mode.
AFAIK, it doesn't work like that. You need X running first, then start
xterm within X or .Xsession.

 
 
 

help: newbie xterm problem

Post by Wayne Thro » Fri, 14 Feb 2003 16:53:15



:: As I understand things "xterm" at command line should start an
:: Xterminal and "xclock" should start xterm with clock.


: It looks like you're trying to start xterm from console (non X) mode.

More fundamental: given the discussion and list of things attempted
in the original post, I think there's a basic misconception involved.
This is perhaps due to the basic naming infelicity involved in
the fact that an Xterminal and xterm are only vaguely related;
they certainly aren't the same thing, nor does either of them
directly start the other.

Let's start from the bottom.  You have the X server, the executable
often actually called "X", or at least a wrapper around the executable
is called "X".  The server is rarely started by itself; it is usually
started by the command "startx", or possibly xinit.  Another common way
it gets started is by xdm, the display manager, which then puts up a
GUI login prompt.  Starting the server is what creates the display; until
you've done it, you'll get the "can't open display: :0" message.  Note
well: setting the DISPLAY variable doesn't start the server, it merely
tells X apps which server they should be displaying on.

( Note: some people think the X server is the client, and all the apps
  are servers.  That's not true; the X server offers access to the
  display, keyboard, and mouse hardware as a service; the apps are
  all clients of this service. )

Now.  In linux, you can simply say "startx" from the command line,
and it'll start the server, and start a few initial applications,
including the window manager (note: the window manager is "just"
another X application).  Given linux's virtual terminals and they
way they work, you can also say "xdm" from a command line as root,
and you'll get a GUI login window.

The "few initial applications" that get started are usually started
by running a user-supplied shell script, $HOME/.xsession or $HOME/.xinitrc,
depending on exactly how it gets started... (I like to link both of those to
the same file, so I don't have to wonder which one I'll get).

Now, once the server is started, you can start applications from anywhere
(modulo permissions) by setting DISPLAY, or using the -display command line
option for those apps (ie, most of them) that recognize it.  But mostly,
you don't have to think about it, because startx sets the DISPLAY
for you when it starts the initial applications, and anything started
by those initial apps will inherit that setting, and so on.  And when you
do start apps like xterm and xclock, things are simple: xterm creates
a "dumb(ish) terminal" emulation, normally running a shell, and xclock
starts a clock display.

:: (ultimately I want to run xterm from a remote computer with ssh, but
:: first things first, I can't even get it to run locally)

Here you must avoid trying to tell ssh what to do, X-wise.
Ssh understands X, and takes care of all the details; the most
common problems are trying to do things ssh has already done.

So.  From a dead standing start at the non-X text console, you type
"xstart".  That'll start the server.  You'll get a KDE or GNOME desktop,
or maybe you'll get something simpler, but the next stage is to start an
xterm, or equivalent.  In KDE, for example, you can normally just click
on the picture of the CRT with a seashell in front of it, and you'll get
an xterm-like KDE app running with a shell reading commands (oh, aren't
icons so cute).  Sometimes, you'll already have an xterm running.  It
all depends on which apps your .xinitrc or .xsession decides to start.

OK, now you've got a dumb-CRT-like window you can type commands into.
Just type "ssh -X remotehost".  You'll get a command shell on the
remote host.  Then simply start more apps from that shell, and they'll
run remotely and display locally.

Hope this helps.


 
 
 

help: newbie xterm problem

Post by fran » Fri, 14 Feb 2003 17:21:24


OK Russell,

I think you have my answer.

I exported DISPLAY and started X from the console, then xterm and I did get
xterm on terminal 7.

I might not be doing this right though.  When I started X, I wasn't returned
to a prompt so I had to open and login to another terminal on F2 to call
xterm, then that terminal didn't return me to a prompt either.  After I
canceled both processes with ctrl c
I noticed that X was still alive and well on F7.

Is there some way to have X already running on F7 before I even login?

If you know, great and if not, thanks for the helpful reply and I'll crack a
book to find the rest.

Franz



> > I am having a problem running "xterm" from the command line.
(ultimately I
> > want to run xterm from a remote computer with ssh, but first things
first, I
> > can't even get it to run locally).

> > As I understand things "xterm" at command line should start an Xterminal
and
> > "xclock" should start xterm with clock.

> > What I have:
> > Two machines: RH7.1 and RH8.0 both using bash environment
> > I can start KDE or Gnome fine with "startx" from command line
> > I can start a classic xterm with "xinit" from command line
> > I cannot get "xterm" to start.

> > What I've done so far:
> > "xterm" ( or xclock or xanything ) gets me an error message
> > "xterm Xt error: Can't open display: "

> It looks like you're trying to start xterm from console (non X) mode.
> AFAIK, it doesn't work like that. You need X running first, then start
> xterm within X or .Xsession.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 
 
 

help: newbie xterm problem

Post by Russel » Fri, 14 Feb 2003 17:52:58



> OK Russell,

> I think you have my answer.

> I exported DISPLAY and started X from the console, then xterm and I did get
> xterm on terminal 7.

> I might not be doing this right though.  When I started X, I wasn't returned
> to a prompt so I had to open and login to another terminal on F2 to call
> xterm, then that terminal didn't return me to a prompt either.  After I
> canceled both processes with ctrl c
> I noticed that X was still alive and well on F7.

> Is there some way to have X already running on F7 before I even login?

> If you know, great and if not, thanks for the helpful reply and I'll crack a
> book to find the rest.

Why do you need an xterm? Maybe you could just start "myxterm"
(a script you write) that does startx and opens an xterm to full-screen without
a window manager or desktop. All you can use in it is text which is what a
normal console term does.
 
 
 

help: newbie xterm problem

Post by s. keeli » Mon, 24 Feb 2003 10:05:22






> > > I am having a problem running "xterm" from the command line.
> (ultimately I
> > > want to run xterm from a remote computer with ssh, but first things
> first, I
> > > can't even get it to run locally).

> > It looks like you're trying to start xterm from console (non X) mode.

Please don't top-post (see my .sig).

Quote:> I exported DISPLAY and started X from the console, then xterm and I did get
> xterm on terminal 7.

> I might not be doing this right though.  When I started X, I wasn't returned
> to a prompt so I had to open and login to another terminal on F2 to call

To get back your prompt, you have to "background" the command by
appending "&" to the command line:

   xterm -ls &

Quote:> Is there some way to have X already running on F7 before I even login?

The correct way is to either run startx, or let xdm/kdm/gdm manage X
Window logins.  If startx, you'll immediately be dumped into an X
Window session.  If one of the *dm's, you'll be presented with a login
screen.  At that point, X is already up and running.

You can configure your X session (have programs start up
automatically) by configuring various files relating to various
functions of the running session.  Eg., if you're using fvwm window
manager, configuration of fvwm is in your ~/.fvwmrc file.  If Motif,
~/.mwmrc, etc.

Other things that may help are ~/.xsession, ~/.Xdefaults or ~/.Xresources

Quote:> If you know, great and if not, thanks for the helpful reply and I'll crack a
> book to find the rest.

That might be wise.  Easier might be running a modern distribution
that does all this for you, but learning how it all works through
experience is good.

--
Any technology distinguishable from magic is insufficiently advanced.
(*) Give up Spammers; I use procmail.      www.spots.ab.ca/~keeling
- -  http://learn.to/quote (Deutch)       http://quote.6x.to (Eng.)

 
 
 

1. help: newbie xterm problem

I am having a problem running "xterm" from the command line.  (ultimately I
want to run xterm from a remote computer with ssh, but first things first).
As I understand things "xterm" at command line should start an Xterminal and
"xclock" should start xterm with clock.

What I have:
Two machines: RH7.1 and RH8.0 both using bash environment
I can start KDE fine with "startx" from command line
I can start a classic xterm with "xinit" from command line

What I've done so far:
"xterm" ( or xclock or xanything ) gets me an error message
"xterm Xt error: Can't open display: "

OK,  I try to set the DISPLAY variable to :0 like "export DISPLAY=:0"
Now I get error message   "xterm Xt error: Can't open display:0"

I've also tried setting DISPLAY to
:0.0
localhost:0.0
localhost:0
:1.0
192.168.1.100:0    (current IP assigned by DHCP)

also tried "xterm -display :0"

I've read the man pages and several online resources and can't get past
setting the DISPLAY variable.  Am I missing something other than some brain
cells?

Thanks in advance to anyone that helps me.
F

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003

2. MiroCrystal24S/VLB help setup in X

3. Help a newbie.. can't start xterm

4. Help in configure of termcap

5. Newbie, error starting xterm in Xwindow with setuid problem

6. HELP! I cannot boot to linux.

7. Newbie - problem with xterm

8. Firewall problems using ipchains

9. Please Help (Xterm problems with RedHat Linux 6.2)

10. xterm printing problem - please help

11. Problem - I can only run one xterm! Help?

12. help: echo problem with xterm-rsh-telnet

13. Help! (Xterm problem)