LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-27-2007, 11:34 AM   #1
pjz
Member
 
Registered: Sep 2003
Posts: 71

Rep: Reputation: 15
Question X server won't connect


Hi-

I have two computers. Computer A runs Red Hat 9.0, Computer B runs Fedora 4. These two computers are connected via ethernet.

I log in from Computer B to Computer A via ssh(). Over on Computer B, I'm sure to type "xhost +", and the response assures me I am able to connect to remote hosts. Likewise, within my ssh session, I am also sure to type "export DISPLAY=<port IP addr>:0.0" before starting anything.

I would like to edit a file on Computer A with Emacs, so I invoke emacs on Computer A from within my ssh session hosted by Computer B. I get the following error message:

emacs: Cannot connect to X server <port IP addr>:0.0

I'm thinking it's one of three things:

a. Security/firewall settings
b. Different versions of X-windows in the two distros
c. Something I just am not seeing

Anyone out there have any ideas? Tried looking through "similar threads", nothing really matches there. Will try looking to see if the versions of X are incompatible. Meanwhile, if someone can think of something I could try, I'd sure appreciated hearing about that idea....

cheers
pjz
 
Old 05-28-2007, 10:38 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,214

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
I have used this several times to run stuff from my laptop to my desktop. There is a how-to under Tutorials - Networking on this board. I found it a little confusing at first. Is is important to run the commands from the correct location, and get ip addresses correct. So, here is how I do it.

My desktop ( client ) is named sluggy with ip address of 192.168.1.21. Mandriva 2006.

My laptop ( server ) is named presto with ip address of 192.168.1.22 Ubuntu 6.06 LTS.

On the client, ( it will receive and display the remote program output ) I run the command,

'xhost +192.168.1.22' ( without the quotes ). I get a response that 192.168.1.22 is added.

Now I ssh to the server, and supply the password. BTW it is possible to set up keys, and not need to bother with the password thing, not required, but if you are going to use it a lot, worth the time.

On the ssh session on the server I run the command 'export DISPLAY=192.168.1.21:0.0' ( no quotes ) and press enter. Make sure there are no error messages. Then start the application, through the ssh session on the server ( remote machine ). It takes a few seconds, and the app shows up on your current desktop on the client.

If this will not work for you, it is most probably a firewall issue. I'm doing it on a home lan, both machines are behind a firewall, and neither has a firewall running. My x servers are not at the same level, I don't believe they need to be.

Hope this helps...
 
Old 05-28-2007, 11:36 AM   #3
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Sorry, but 'ssh -X' (without any xhost settings and $DISPLAY exporting) is a better way to do so: traffic is encrypted and everything goes through ssh channel (it means firewall doesn't block it any more than ssh'ed console output).

Edit: are you sure DISPLAY is :0.0, not :0 ?
 
Old 05-29-2007, 09:34 AM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,214

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
Raskin,

Thank-you for the input. The thing I like about linux is I learn something every day. I tried your method, it worked like a charm.

So for clarity, here is what I did...

Code:
ssh -X presto
and supplied the password for my user. Got connected, and just typed the name of the GUI program I want to start. In my case I ran xfce4-mixer and then xmms as a test. Both worked as expected. ( presto is the name of the server machine, I have an entry for it in /etc/hosts ).
 
Old 05-29-2007, 03:43 PM   #5
pjz
Member
 
Registered: Sep 2003
Posts: 71

Original Poster
Rep: Reputation: 15
Raskin-

I have checked and am sure DISPLAY is :0.0 and not simply :0.

I will attempt to fire up ssh -X and, without fooling with either the DISPLAY environment variable, nor xhost, try emacs. Will simply try as in successful Camorri example, and we'll see.

Will let you know how this goes......
pjz

Camorri-

thanks for the backup. I appreciate.
 
Old 05-30-2007, 10:14 AM   #6
pjz
Member
 
Registered: Sep 2003
Posts: 71

Original Poster
Rep: Reputation: 15
Raskin-

Works perfectly. Thanks very much for your help. I will be sure to pass this one along.

cheers
pjz
 
Old 07-19-2007, 03:12 PM   #7
rakeshj
Member
 
Registered: Jun 2007
Posts: 44

Rep: Reputation: 15
Dear Camorri,

I tried to locate the HOW TO referred by you earlier in Networking Tutorials but could not find it. Here is the list of all tutorials under networking. Can you please suggest me which tutorial you were
refering to. Sorry for trouble. Thanking you.

Best regards, RAKESH

****** LIST OF TUTORIALS UNDER NETWORKING *******************

Networking Category
(Slackware) Installing Linksys WMP54G with NDISWRAPPER-11
A simplified view of MPMs in Apache
Apache + SSL Howto
Basic Samba Network File Sharing
Belkin F5D6001 ver 3. wireless pci adapter using ndiswrapper for Slackware 10.0
Belkin F5D7000 USA Wireless Card in Linux: Complete Guide
Building a Slackware Wireless Access Point
Comcast and KMail - HOWTO
Configure BIND DNS to Answer Active Directory Queries
Configuring Dynamic Domain Name System (DDNS) Server
Connecting to XBox Live through a linux computer connected to a wireless LAN
CUPS server with WinXP clients (SuSE 9.1)
DHCP DNS & Firewall with NetBSD
DHCP Server Howto
DNS
Down-and-dirty Samba is UP --- NOW
Easy intel wireless install
Easy NFS
File sharing with OS X using Ubuntu 5.04
Forward ports via an SSH tunnel with auto reconnect (using key pair authentication)
From beginning to end: ProFTPD
Guide to NdisWrapper for MN-720 MN-730 Microsoft Wireless Cards in SusE 9.x
How I Setup Apache2-2.0.58, PHP-5.1.4 and MySql-5.0.22 on Slackware 10.2
How to get Broadcom 43xx Wireless (AirForce54g) card to work (proven in Ubuntu Dappe Drake)
How to list all your USERs..
How to Simply Add a NAS (Network Storage) using Konqueror and Samba
How to: Simple Installation of Madwifi in Fedora Core 4 (for Atheros chipped cards)
HOW TO: SUSE Linux Enterprise Desktop SLED10 LDAP / Kerberos Authentication to Active Directory / Windows Server 2003 R2
HOW TO: SUSE Linux Enterprise Desktop SLED10 LDAP / Kerberos Authentication to Active Directory / Windows Server 2003 R2
HOW TO: Unmounting a NFS mount on a server when the mounted server has gone down, causing the applications thread to hang up.
HOW-TO install the Broadcom bcm43xx Driver in Debian Linux and enable WPA Encryption
HOWTO Setup a Secure Relaying Email Server
HOWTO wirless working on Thinkpad R40e with Belkin Wireless G notebook card
Install ipw2200 on Sony VAIO VGN-A217M &amp; Debian unstable
Install rt2500 WLAN driver in Fedora
Installing a HomePNA 2.0 Home Phoneline Network for Knoppix and Slackware
Installing the Cisco VPN Client
Intel Pro Wireless 2200 + Slackware
Internet access and SuSe 9.1
IPv6 deployment
Konqueror ad blocker
Linksys Ver4 - Using NDISWrapper
Linux Router
Linux Wireles LAN
Multi Processing Module in Apache
NDISwrapper for RTL8180 mini-HOWTO
Ndiswrapper in Fedora Core 5
ndiswrapper on Debian Sarge without having to compile anything
NdisWrapper: The Ultimate Guide
NdiswrapperHowToforSuSE9+
Netgear MA111 USB Wireless Howto
Netgear WG511 v3 Made in China with WPA on Ubuntu 6.06 LTS (Dapper)
Netgear WG511 with WPA on SuSE 10.0
Newbie's Guide to Small Home LAN
ORINOCO MONITOR and KISMET HOWTO
Playstation ICS for online gaming
PPP dial-up over Bluetooth Cell-Phone
PPTP VPN on Slackware How-to
Public key authentication with ssh
quick and easy way to get internet connection sharing
Realtek8180 Driver Install HOWTO
Samba - up and running NOW
Sendmail SMTP AUTH Howto
Setting up 'Network Information Service'
Setting Up a Network Printer using CUPS
Setting up Broadcom wireless networking under Slackware 11
Setting up DNS in Small Subnets
Spanning Multiple DSLs
ssh w/ gtk programs (host-client display export)
Ubuntu Guide To Installing Wireless Cards (CARDS: PCMCIA RT2500 54mbit, Siemens Gigaset 108 USB Adapter).
Using rsync to mirror data between servers
Using Windows Directories for Default Apache 2 Web Site
Verizon Cell Phone Internet
Virtual Webhosting on Linux for support of php+mysql+jsp+servlets
VNC Server/Client Quickstart
WiFi-Radar in Slackware
YUM FC4 Centralized Server
Zaurus USB-network how-to
 
Old 07-19-2007, 06:57 PM   #8
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,214

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
rekeshj,

It has been a while, and I think this is the one I refered to.

http://www.linuxquestions.org/linux/...display_export

Hope this helps.
 
Old 08-05-2007, 03:00 AM   #9
rakeshj
Member
 
Registered: Jun 2007
Posts: 44

Rep: Reputation: 15
Thanks for the feedbacks.

I tried : ssh -X server-name

It works perfect. Now I execute the X-application on server-name server & get the
output on my Xubuntu server.

Thanks again. Best regards, RAKESH
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql Server error Can't connect to local MySQL server through socket sridhar11 Debian 10 07-26-2011 12:55 PM
trying to connect to server 2003 domain server in slack 11 bladerunner12120 Slackware 2 04-02-2007 01:02 PM
Unix-connect: can't connect to server jrdioko Linux - Software 1 01-08-2006 04:56 PM
Suddenly unable to connect to my web server and my ftp server. HELP! Silly22 Linux - Software 4 05-23-2004 04:42 PM
Is samba required to connect to a Windows Advanced server from RedHat 8.0 server? NemesisStar Linux - Hardware 1 10-20-2003 12:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration