LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2009, 01:37 PM   #1
simplified
Member
 
Registered: May 2007
Location: London, UK
Distribution: Kubuntu 9.04 x64 / Ubuntu Server 9.04 x64
Posts: 50

Rep: Reputation: 15
XWindows issues over SSH


Hi All

I'm currently running a headless CentOS server (5.2) with Ubuntu 8.10 as my desktop. All runs ace

I do however need to get the xwindows application 'system-config-nfs' running so that I can mount my files via NFS (rather than SMB). When I attempt to run this (after ssh'ing into the CentOS Box using 'ssh -X <IP>') I get the error:

Code:
system-config-nfs requires a currently running X server.
On my Ubuntu box I've checked to see if it's listening on tcp/6000 by using the following command:

Code:
$ netstat -tan | grep 6000
... which (as the error in the ssh session to the CentOS box suggests) isn't listening. Grr!

I've also made sure that $DISPLAY is set to the following (note that 192.168.1.4 is the IP of the Ubuntu box), i.e.

Code:
$ DISPLAY=192.168.1.4:0.0
...but I don't suppose that this makes a lot of difference if the X Server isn't running on the Ubuntu Box. It's also worth noting that I can run this from my XP Laptop (it's a work one, not my choice!) using XMing so sshd is configured OK... Any ideas?

TIA, Ollie
 
Old 03-28-2009, 03:29 PM   #2
vindoan
LQ Newbie
 
Registered: Mar 2009
Posts: 23

Rep: Reputation: 17
When you SSH into your server, are you allowing X11 Forwarding?

Different SSH client behaves differently, so you'll have to set in on your SSH client. For example, when I'm using the Cygwin SSH client in the Cygwin xterm, on a Windows machine to SSH to a server, I use the -Y option to allow X11 Forwarding.

Code:
ssh -Y login@server
On the server check a few things. In /etc/sshd/sshd_config file, check that X11Forwarding is set to yes.

Code:
X11Forwarding yes
Then run the xhost command to add your remote host.

Code:
xhost +<your_remote_host_name_or_ip>
Now run an X11 program, like xclock to test.
 
Old 03-30-2009, 08:07 AM   #3
simplified
Member
 
Registered: May 2007
Location: London, UK
Distribution: Kubuntu 9.04 x64 / Ubuntu Server 9.04 x64
Posts: 50

Original Poster
Rep: Reputation: 15
Hi

Thanks for that... here's the story so far...

Quote:
When you SSH into your server, are you allowing X11 Forwarding?
Yep!

Quote:
Different SSH client behaves differently, so you'll have to set in on your SSH client. For example, when I'm using the Cygwin SSH client in the Cygwin xterm, on a Windows machine to SSH to a server, I use the -Y option to allow X11 Forwarding.
... I have been using the following:

Code:
$ ssh -X 192.168.1.6
... rather than that -Y. As mine didn't work, I thought that I'd try it your way :-) and when I enter:

Code:
$ xhost +192.168.1.4
I get this error:

Code:
xhost:  unable to open display ""
Quote:
On the server check a few things. In /etc/sshd/sshd_config file, check that X11Forwarding is set to yes.
... this is already set. Like I say, I can connect from my XP Laptop :-)


Just so you're aware, I'm trying to display X windows on an Ubuntu Workstation from a CentOS5.2 Server.

I appreciate you looking at this one... any more ideas? TIA, OL
 
Old 03-30-2009, 09:57 AM   #4
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 297

Rep: Reputation: 62
Have you actually got an X Server running on the Ubuntu Box? Your first message seem to indicate that you have not i.e.
"if the X Server isn't running on the Ubuntu Box"
 
Old 03-31-2009, 05:49 AM   #5
simplified
Member
 
Registered: May 2007
Location: London, UK
Distribution: Kubuntu 9.04 x64 / Ubuntu Server 9.04 x64
Posts: 50

Original Poster
Rep: Reputation: 15
Quote:
Have you actually got an X Server running on the Ubuntu Box? Your first message seem to indicate that you have not i.e.
"if the X Server isn't running on the Ubuntu Box"
Thanks for the response. This is what's confusing me... I am trying to connect from my Ubunutu Machine from within Gnome, so as far as I can tell from forums this is running. I've looked at the runlevel of my machine and the command reports back that I'm running at runlevel 2... would this make a difference?

I'm a bit new to Ubuntu and I can't seem to find my /etc/inittab file either which is a bit of a worry...

Sorry to be such a numpty

Cheers, OL
 
Old 03-31-2009, 10:27 AM   #6
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 297

Rep: Reputation: 62
Run level 2 generally does not start your X server. However if Gnome is running then youe X server is running.
 
Old 03-31-2009, 10:40 AM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
A few points:

/etc/inittab is indeed gone, but if you create it, I believe it is supposed to be honoured.

runlevel 2 is what the 'buntus use for the GUI

You don't need a GUI, or X to set up NFS - here's a link to a guide for ubuntu
http://mybeni.rootzilla.de/mybeNi/20..._ubuntu_linux/
other distros will be pretty much the same
 
Old 04-01-2009, 10:06 AM   #8
simplified
Member
 
Registered: May 2007
Location: London, UK
Distribution: Kubuntu 9.04 x64 / Ubuntu Server 9.04 x64
Posts: 50

Original Poster
Rep: Reputation: 15
Quote:
Run level 2 generally does not start your X server. However if Gnome is running then youe X server is running.
Thanks - this is what I thought. However, I'm a little confused as to why the remote system cannot make a connection back to me; perhaps this is to do with the configuration of my X Server as the machine doesn't seem to be listening on tcp/6000. Do you have any ideas how to make a change to the X Server configuration in order to make it listen on this port?

Thanks, OL
 
Old 04-01-2009, 10:09 AM   #9
simplified
Member
 
Registered: May 2007
Location: London, UK
Distribution: Kubuntu 9.04 x64 / Ubuntu Server 9.04 x64
Posts: 50

Original Poster
Rep: Reputation: 15
Quote:
A few points:

/etc/inittab is indeed gone, but if you create it, I believe it is supposed to be honoured.

runlevel 2 is what the 'buntus use for the GUI

You don't need a GUI, or X to set up NFS - here's a link to a guide for ubuntu
http://mybeni.rootzilla.de/mybeNi/20..._ubuntu_linux/
other distros will be pretty much the same
Hi Tredegar... thanks for the pointer but it was really a more generic question; I'm happy to be able to set this up via bash in SSH but really wanted to resolve my issues with X so that I can use other GUI's in the future as well. I appreciate the input though :-)
 
Old 04-01-2009, 12:25 PM   #10
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
....but really wanted to resolve my issues with X so that I can use other GUI's in the future as well.
I use vnc for this. It works beautifully.
I have the following packages installed:
xvnc4viewer
vnc4-common
vnc4server


vncserver is a symlink to /usr/bin/tightvncserver and
vncviewer is a symlink to /usr/bin/xtightvncviewer (that's just the way the 'buntus happen to do it).

I start a KDE session on display :1 with vnc on my server when it boots.
I get root to start the server in my username with this line in /etc/rc.local just before the final exit 0
Code:
# Start vnc server for tred on display :1
su - tred -c "cd /home/tred/ && vncserver :1 -geometry 1024x768 -depth 24" 2>/dev/null &
in /home/tred/.vnc/xstartup I have just this one line:
Code:
startkde &
You should replace startkde & with gnome-session & or whatever you need to start your GUI of choice.

I can then connect to it with vncviewer servername:1
If I just close the vncviewer window, rather than logout, the KDE session stays running on the server ready for me to reconnect to it at any time.

I only use this on my firewalled (from the big bad web) LAN.
If I wanted access from outside my LAN, I'd tunnel the vnc connection through ssh
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ssh solaris xwindows simquest Linux - Software 1 07-10-2009 01:08 PM
XWindows over SSH w33k Linux - Networking 2 08-23-2004 09:58 AM
xwindows in ssh session ravneetsoin Linux - Software 2 08-12-2004 05:59 PM
Xwindows over SSH gauge73 Linux - Networking 27 04-26-2003 12:36 PM
Severe Issues with Xwindows...... maaand Linux - Software 1 09-08-2001 01:45 AM


All times are GMT -5. The time now is 09:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration