Solved

Run X from Red Hat 3

Posted on 2006-11-17
13
1,862 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
ID: 17970755
You need to use X server on windows machine, and use ssh -X, and not export DISPLAY
0
 

Author Comment

by:xoxomos
ID: 17981267
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
ID: 17985553
You will have to run XWin.exe on the windows machine from Cygwin. Download from http://x.cygwin.com/ 
0
 

Author Comment

by:xoxomos
ID: 17990173
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
ID: 17991946
ssh -X does tunnel X protocol over SSH session. Even if ssh server rejects it does export DISPLAY for you.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:xoxomos
ID: 17999653
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
ID: 17999721
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
ID: 18013944
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
ID: 18097351
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
ID: 18100167
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
ID: 18105568
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

896 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

13 Experts available now in Live!

Get 1:1 Help Now