X11 forwarding doesn't work

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat X11 forwarding doesn't work
# 1  
Old 08-09-2017
X11 forwarding doesn't work

hi,

I'm trying to run a bash script that starts GUI. Though it says application started when I run this bash script doesn't show up any GUI. Here is what I've tried so far and please let me know if I'm missing something with the X11 set up here.

Code:
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.9 (Santiago)

rpm -qa | grep xorg-x11-xauth
xorg-x11-xauth-1.0.9-1.el6.x86_64

cat /etc/hosts|grep 127.0.0.1
127.0.0.1  localhost localhost.localdomain

cat /etc/ssh/sshd_config|grep X11
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

cat /etc/ssh/ssh_config|grep X11
ForwardX11 yes

Also enabled X11 forward in putty session and set Xdisplay location :0.0

However when I try xclock this is what I see..
Code:
$xclock
Error: Can't open display: localhost:11.0


Last edited by Scrutinizer; 08-09-2017 at 05:16 PM.. Reason: code tags
# 2  
Old 08-13-2017
Hello,

Can anyone help me fixing this problem?
# 3  
Old 08-14-2017
You probably need to set the DISPLAY variable pointing to the host with the display you want xclock to show up at.

On this host you may also need to issue xhost to allow the host originating the xclock to display the clock window there.

I hope this helps.

bakunin
# 4  
Old 08-14-2017
Are you sitting at a Windows desktop?
If yes, did you install an X-server on it, like Xming or Cygwin/X or ...?
The (insecure) xhost-allow and manual DISPLAY setting should not be necessary if there is the (much safer) ssh X-forwarding enabled.
# 5  
Old 08-16-2017
I'm not doing any SSH here. I'm trying to run a script on the local host machine itself. Just opened a putty session , enabled X11 forwarding by setting the X display location as
Code:
:0.0

and trying to run a script that should open a GUI. I have also set below lines in /etc/hosts file but no luck yet
Code:
127.0.0.1           localhost localhost.localdomain
::1                     localhost localhost.localdomain

Code:
xclock
Error: Can't open display: localhost:10.0

# 6  
Old 08-16-2017
On a local host, what do you need putty for? putty, amongst other features, does an ssh connect / session.
On the local server, is there an X-server running? How does xclock convert display :0.0 to :10.0?
# 7  
Old 08-24-2017
You might have to go for xming. This is easy one.
As i understand you correct, you are opening a putty session and triggering a script.
Im assuming, you are using a windows desktop where this putty tool is available for you and the port 22 to the host you are connecting is allowed to this windows desktop.

You might need to install xming in this windows desktop in that case.

Download link :
Xming X Server for Windows download | SourceForge.net

Installing and configuring :
http://www.geo.mtu.edu/geoschem/docs/putty_install.html

Once you are done,
-> Start your xserver in your desktop
-> Click Xlaunch - next - next -next - done
-> Open putty
-> Provide the SSH informations ( Display parameter as localhost:<xserver display parameter> and allow x11 forwarding )

and trigger your script and it should work.


Please make sure .Xauthority file is getting created in your home dir
You may need to install other packages like,
xauth
xterm

I will provide you some commands for required packages and it defnitely works

Code:
yum -y install xauth* xorg-x11-server-Xorg* xorg-x11-server-utils* xorg-x11-drv* xorg-x11-glamor* xorg-x11-xinit* xorg-x11-drivers* xterm xclock xeyes firefox

This User Gave Thanks to jayadeava For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

X11 forwarding issues

Unable to get X11 activated on my login even after Unix admin has enabled it (2 Replies)
Discussion started by: tomsayer1977
2 Replies

2. IP Networking

Force SSH session without/disabling X11 forwarding.

I would like to disable X11 session forcefully. I have tried the following things: 1. Setting appropriate DISPLAY variable in the /etc/environment file to be "0.0" 2. I have tried setting the sshd_config parameter X11Forwarding to be "no" This session communication is happening by exchanging... (2 Replies)
Discussion started by: vaibhavvsk
2 Replies

3. Red Hat

X11 forwarding through a tunnel

Is it possible to launch an X11 application and have it use an X11 server on the other side of a bastion host? Specifically, here's my setup: my laptop ------------- bastion -------------- remote host I have putty installed on my laptop. The bastion is rhel 6.5 and the remote host is... (1 Reply)
Discussion started by: tsreyb
1 Replies

4. UNIX for Dummies Questions & Answers

Problem with X11 Forwarding

Hello. I installed a Debian box, and its installed remotely. I need to boot up iceweasel from there to do a quick test. I log on using: ssh root@<IP> -X I have modified the /etc/ssh/sshd_config file, and added the X11Forwarding yes flag And yet I still get: Error: cannot open... (10 Replies)
Discussion started by: dynelight
10 Replies

5. UNIX for Dummies Questions & Answers

X11 forwarding does not work after networking change

Hi all I'm having an issue with X11 Forwarding I have a VM set up on my computer which I usually "ssh -X" to over a home network (192.168.1.*). Client 192.168.1.100 Server 192.168.1.103 This worked perfectly fine for X11 forwarding. However I am not at home now (and have no access to... (2 Replies)
Discussion started by: grahambo2005
2 Replies

6. HP-UX

'X11 forwarding' SSHD assigns already used port

Hi, We've been facing a strange issue. Clients use X11 forwarding via SSH on HP server and sometimes the same DISPLAY is assigned to two (maybe more) sessions. As a result, some users can't open their applications, and some have their windows redirected to somebody else. It looks as if sshd... (1 Reply)
Discussion started by: piooooter
1 Replies

7. Red Hat

X11 forwarding problem between 2 RHEL4 machines with SSH

X11 forwarding problem between 2 RHEL4 machines with SSH Already configured the following on both machines under /etc/ssh Under sshd_config: UsePAM no AllowTcpForwarding yes Under ssh_config: ForwardAgent yes ForwardX11 yes ForwardX11Trusted yes ----------------------------- Using... (1 Reply)
Discussion started by: panggou
1 Replies

8. UNIX for Dummies Questions & Answers

X11 forwarding not working

Hi, I am using Putty, enabled SSH X11 forwarding and entered the X11 display location as "localhost:0". However I encountered the following error: ------------------------------------ # xclock & 2941 # X connection to localhost:10.0 broken (explicit kill or server shutdown). + Exit 1... (4 Replies)
Discussion started by: panggou
4 Replies

9. Debian

X11 Forwarding Problem

I have 2 Debian boxes. In my ssh.com client and my putty client, I have X11 fowarding turned on for both boxes. When I connect one, I can xterm with no problem back to my pc. On the other, I keep getting: xterm Xt error: Can't open display: xterm: DISPLAY is not set On both... (3 Replies)
Discussion started by: natter
3 Replies

10. OS X (Apple)

ssh forwarding to X11

Hi, I have issues with running graphical interfaces on my computer being remotely logged into a network via the -X option of ssh. My .cshrc shows DISPLAY=hostname:0 and I think there should be a different number instead of the 0. I changed the ssh_config file already to 'X11 forwarding yes', which... (0 Replies)
Discussion started by: ginese
0 Replies
Login or Register to Ask a Question