Solved

Run X from Red Hat 3

Posted on 2006-11-17
13
1,861 Views
Last Modified: 2013-12-27
I'm at a windows machine running Cygwin.  I want to display a machine running Red Hat 3.
I have
 1.  xhost + Red-Hat-machine
 2. ssh -l user Red-Hat-machine
3.  export DISPLAY=windows-ip:0.0
4. /usr/X11R6/bin/twm

but nothing happens.  What do i need to do to have the display showing on windows?
0
Comment
Question by:xoxomos
  • 6
  • 2
  • 2
  • +1
13 Comments
 
LVL 61

Expert Comment

by:gheist
Comment Utility
You need to use X server on windows machine, and use ssh -X, and not export DISPLAY
0
 

Author Comment

by:xoxomos
Comment Utility
I need to run export DISPLAY on the Red Hat machine otherwise it would not know where to display would it?
0
 
LVL 58

Accepted Solution

by:
amit_g earned 84 total points
Comment Utility
You will have to run XWin.exe on the windows machine from Cygwin. Download from http://x.cygwin.com/
0
 

Author Comment

by:xoxomos
Comment Utility
Yes, i have cygwin and i've been trying using xinit.

xinit
xhost + linux box
ssh -l user-a linuxboxipaddress
After the ssh to the linux box, i export
export DISPLAY=windowipaddress:0.0
twm &


I'll try XWin.exe to see if that gets it.
0
 
LVL 61

Assisted Solution

by:gheist
gheist earned 83 total points
Comment Utility
ssh -X does tunnel X protocol over SSH session. Even if ssh server rejects it does export DISPLAY for you.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:xoxomos
Comment Utility
when i try XWin.exe in the cygwin environment, i get a just grayish screen.  I can move the mouse around, but cannot enter anything from keyboard.
0
 

Author Comment

by:xoxomos
Comment Utility
xinit
here i get a window where i can key in:
xhost + linux box
ssh -X -l user-a linuxboxipaddress
After the ssh to the linux box, i export
export DISPLAY=windowipaddress:0.0
twm &

After the twm &. a green strip appears across the top of the ssh window, but none of the RedHat GUI appears.
0
 
LVL 20

Expert Comment

by:Gns
Comment Utility
Well, Tabbed Window Manager (twm) isn't exactly the most "visible" of window managers:-). And if there already is a window manager... it won't run.
Try running a "gnome-session" instead;-). And make sure you don't have a local window manager.... Why not work by modifying the stock startx*.sh script that comes with Cygwin?

Both amit and Andrew are correct though. Either using the magic of ssh -X, or just setting the DISPLAY on the remote, you'll need have X running first, and without a window manager (since you want to start that from the remote "server")... Easiest is to do this with ssh -X, since then you already trust the host (localhost), so don't need use any pesky "xhost + ..." or "export DISPLAY=..." ... which is kind of nice:-).

The only distro I know of that really make sure that all "supported" window managers have more or less the same menu built... is Mandriva (this is a very nice thing, since that means you'll not be particularly limted when using the less graphical window managers like twm or icewm:-). On most others, twm is ... not that nice:-). Click on the background (left, middle, right) to get the menus defined...

-- Glenn
0
 

Author Comment

by:xoxomos
Comment Utility
Maybe twm being 'less graphical' is the issue and my expectations were too high.
I use much the same setup of Cygwin on XP when I ssh to a Solaris box and export DISPLAY to the Cygwin machine.
On Solaris I use dtwm instead of twm and the results are as expected as I get the full Solaris graphics whereas when I use dtwm from Solaris.
0
 
LVL 20

Assisted Solution

by:Gns
Gns earned 83 total points
Comment Utility
Likely... Or, as said, you already have a "local" window manager running (and there can only be one;-) which prevent twm from running... Would likely produce a bit of error output though, so perhaps (provided you don't get that) you are right:).

Did you try the alternate method? It could eb as easy as just executing
XWin.exe &
in the cygwin bash window, then executing
export DISPLAY=:0
ssh -X -l user-a linuxboxipaddress

When on the linuxbox, the DISPLAY should already be set, so for goodness sake... don't override that.
echo $DISPLAY
should reveal something like localhost:10 ... and that is the "tunnel endpoint" you should be using.
If it is set, do
gnome-session&
... and be done;)

If it is unset, this is likely due to
1) DISPLAY not being set on the windoze box, preventing ssh -X ... from detecting it
2) sshd_conf (likely in /etc/ssh/) not allowing X11 forwarding ... Just set
X11Forwarding yes
and restart sshd, if it isn't aet already.
3) ssh_conf (on the cygwin enabled windoze machine) not allowing X11 forwarding... you should have something like
Host *
  ForwardX11 yes
  ForwardX11Trusted yes
set, if you want it by default (IIRC if this is "no", ssh -X is the override for ForwardX11, and ssh -Y is the ForwardX11Trusted one, so ... no matter... Don't change those:-).

Make sure DISPLAY gets set correctly on the remote, either by "ssh -X ..." or "ssh -Y ....", use "gnome-session"... and all your problems should be alleviated:-)

Cheers
-- Glenn
0
 

Author Comment

by:xoxomos
Comment Utility
Hooray, they're moving this database from linux onto Solaris and it's a lot simpler to hook up Cygwin and Solaris.
Thanks everybody
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now