LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-19-2004, 03:02 PM   #1
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
how to make X.org listen for incomming connections ?


im running an uptodate Gentoo system with xorg-x11 version 6.7 (soon to be 6.8)

anyways. to get a graphical environment to startup by default, i added the KDM init script to my runlevel.

after a normal login i run "xhost +ip_address" to allow remote connections from a university Solaris machine.. i also allow that ip address in my firewall.. and i set the correct DISPLAY variable on the remote machine...

however, attempting to run a graphical program fails with a cannot connect error.

also, "netstat -l" does not show Xorg to be listening on any ports...

HOWEVER... if i drop into command line mode by stopping X.. and startup Xorg with the command "xinit" netstat then shows that xorg IS listeining on 6000, and my remote graphical programs work fine...

The problem is, when i start Xorg with Xinit, it goes straight into KDE... no KDM login manager.

How to i get my Xserver to listen for incomming connections AND launch KDM graphical loggin manager by default ?

thanks.
 
Old 10-19-2004, 06:13 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Enable XDMCP in your KDM configuration and then restart it. There is a XDMCP HOWTO in case you're interested in reading up on it.

Personally, I just use ssh -X user@host and launch graphical programs that way (although admittedly I don't get the whole desktop). Works for me anyway.

Håkan
 
Old 10-20-2004, 07:56 AM   #3
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Original Poster
Rep: Reputation: 47
i dont want a graphical loggin... thats too slow.
i just want to run a single graphical prgram remotely.
 
Old 10-20-2004, 08:43 AM   #4
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
If that's the case, the ssh route should be your easiest and most secure choice. On the server edit /etc/ssh/sshd_conf and set X11Forwarding to yes. Restart the sshd service and use ssh -X username@hostname to connect to it. Simply type the name of the program and it should display on your local desktop.


Håkan
 
Old 10-20-2004, 10:38 AM   #5
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Original Poster
Rep: Reputation: 47
i get the error message "Gtk-WARNING **: cannot open display: ********.homelinux.net:0"
which is the same error message i get from ssh'ing into the server, then setting the display variable.

the reason for this error is that X is NOT LISTENING FOR INCOMMING CONNECTIONS when i Allow X to start in the usual manor (with the kdm init script)

however X dies listen whan i stary it with the command "xinit"

is this somthing to do with X not running in daemon mode or somthing ?

to repeat my origoanl question... how do i set X to listen for incomming network connections ?

i already know how to loggin remotely in command line via ssh.

Thanx for the reply, but it doesnt seem to be the answer i needed... any other surgestions ?

here is the script i use to launch my graphical environment locally. (normally i use the system as is... i only do remote graphical logins occasionally.)

Code:
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2
# $Header: /home/cvsroot/gentoo-x86/x11-base/xfree/files/4.3.99.8/xdm.start,v 1.1 

# Martin Schlemmer
# aka Azarah
# 04 March 2002


# Start X Font Server before X
depend() {
	use xfs hotplug
}

setup_dm() {
	source /etc/profile.env
	export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}"

	local MY_XDM="$(echo ${DISPLAYMANAGER} | awk '{ print tolower($1) }')"
	case "${MY_XDM}" in
		kdm|kde|kde2|kde3)
			EXE="$(which kdm)"
			;;
		entrance*)
			EXE="$(which entranced)"
			;;
		gdm|gnome)
			EXE=/usr/bin/gdm
			;;
		wdm)
			EXE=/usr/bin/wdm
			;;
		*)
			EXE=
			for x in /usr/bin /usr/X11R6/bin
			do
				# Fix #65586, where MY_XDM is empty so EXE=somedir
				[ -x "${x}/${MY_XDM}" -a -f "${x}/${MY_XDM}" ] \
					&& EXE="${x}/${MY_XDM}"
			done
			[ -z "${EXE}" ] && EXE="/usr/X11R6/bin/xdm"
			;;
	esac

	test ! -x "${EXE}" && EXE=/usr/X11R6/bin/xdm

	SERVICE="${EXE##*/}"
}

start() {
	setup_dm
	
	ebegin "Setting up ${SERVICE}"
	#save the prefered DM
	save_options "service" "${EXE}"
	#tell init to run /etc/X11/startDM.sh after current
	#runlevel is finished (should *not* be in the "boot"
	#                      runlevel).
	/sbin/telinit a &>/dev/null
	eend 0
}

stop() {
	local retval=0
	local curvt="$(fgconsole)"
	local myexe="$(get_options "service")"
	local myservice="${myexe##*/}"
	
	ebegin "Stopping ${myservice}"
	rm -f ${svcdir}/options/xdm/service
	
	if [ "$(ps -A | grep -e "${myservice}")" ]
	then
		start-stop-daemon --stop --quiet \
			--exe ${myexe} &>/dev/null
		
		retval=$?
	else
		retval=1
	fi
	
	#switch back to original vt
	chvt "${curvt}" &>/dev/null
	eend ${retval} "Error stopping ${myservice}."
	
	return ${retval}
}


# vim:ts=4
Basically, it just reads my environment variables (wich are set to run KDM as the login manager) then makes sure the dependency's are running (XFS) then rus KDM.

kdm seems to be starting the X server with an option than prevents it listening (usually listens on poer 6000)

starting the server myself with "xinit" makes the server listen, but bypasses the graphical login... which is essential for the non computer literate users.


Last edited by qwijibow; 10-20-2004 at 10:44 AM.
 
Old 10-20-2004, 02:10 PM   #6
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
Check your sshd_config file and make sure you have it set (on your amchine) to use local X.

If you do not have it set to run local x, then it will try to run off of the remote machines X, which if it is not running.. will not work
 
Old 10-20-2004, 02:38 PM   #7
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Original Poster
Rep: Reputation: 47
tried that......
i apreciate you guys replying to my thread.. but you are anwering the question you want me to ask.. not the question im actually asking.

the question ladys and gentlemen.... HOW to i start X Locally... logged in locally, ignoreing the network all together, actually sat infront of the machine locally...
in such a way that the X server ALSO listens to incomming connections to port 6000.

if i startx with the command "xinit" then yes.. X listens for incomming connections and remote logins work... because when they try to connect... X picks up the connection.

however... this is not accespabe because it bypasses the graphical login manager KDM.

but then i start X by running KDM, and allowing KDM to start x... it starts it in such a way that it does not listen for incomming connections...

so....... to summarise...





========================================================================================
IGNORE SSH......i have that sorted.

here are 2 methods for starting X....
Method 1: KDM init script
Method 2: login command line, run command xinit.

now here are the Pro's and Cons of each method...
Method1: PRO: i get graphical login manager
Method1:LCON: X doesnt listen for remote connections on port 6000

Method2:PRO: X does listen to incomming connections.
Method2:CON: this bypasses the graphicalloggin manager.... needed by non computer literate users.

I need the PRO's from method 1 and method 2 at the same time....
SIMPLY PUT.... i want a graphical login manager.. and i want X to listen on port 6000 for incomming connections....

Please dont explain to me how remote graphical logins work... i understand this... this is working right now this instant...
im using mozilla browser running on a machine at university while in using my keyboard and mouse at home... its working....

the problem... is that doing this meant i had to loggin via command line and start X manually..... (and NO LOGIN MANAGER)
the prblem at its most basic level... how do u set x to listen to remote connections on port 6000 ? (or any port... i dont care)

is this more clear ?
 
Old 10-20-2004, 06:31 PM   #8
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
Thumbs up

Quote:
Originally posted by qwijibow
tried that......
i apreciate you guys replying to my thread.. but you are anwering the question you want me to ask.. not the question im actually asking.

the question ladys and gentlemen.... HOW to i start X Locally... logged in locally, ignoreing the network all together, actually sat infront of the machine locally...
in such a way that the X server ALSO listens to incomming connections to port 6000.

if i startx with the command "xinit" then yes.. X listens for incomming connections and remote logins work... because when they try to connect... X picks up the connection.

however... this is not accespabe because it bypasses the graphical login manager KDM.

but then i start X by running KDM, and allowing KDM to start x... it starts it in such a way that it does not listen for incomming connections...

so....... to summarise...





========================================================================================
IGNORE SSH......i have that sorted.

here are 2 methods for starting X....
Method 1: KDM init script
Method 2: login command line, run command xinit.

now here are the Pro's and Cons of each method...
Method1: PRO: i get graphical login manager
Method1:LCON: X doesnt listen for remote connections on port 6000

Method2:PRO: X does listen to incomming connections.
Method2:CON: this bypasses the graphicalloggin manager.... needed by non computer literate users.

I need the PRO's from method 1 and method 2 at the same time....
SIMPLY PUT.... i want a graphical login manager.. and i want X to listen on port 6000 for incomming connections....

Please dont explain to me how remote graphical logins work... i understand this... this is working right now this instant...
im using mozilla browser running on a machine at university while in using my keyboard and mouse at home... its working....

the problem... is that doing this meant i had to loggin via command line and start X manually..... (and NO LOGIN MANAGER)
the prblem at its most basic level... how do u set x to listen to remote connections on port 6000 ? (or any port... i dont care)

is this more clear ?
This is more clear, I have never used KDM's graphical manager, but just to clarify, when you say it does not allow connections is this becaus eyou need to type in xhost +IPADDRESS ? Or does it just not allow incoming connections at all when you boot with this method?

If it is just because you need to type in xhost +ipaddress this can easily be added to:

a. the .xsesssions file so it runs when the user logs on,

or
b. Add it to the startup script for KDM or the init script?

Let me know if this is not what you are looking for...

Thanks
Trey
 
Old 10-20-2004, 07:03 PM   #9
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Original Poster
Rep: Reputation: 47
like i said...... the connection is not working because netstat -l shows that the X server IS NOT LISTENING FOR INCOMMING connections.

i know all about allowing hosts with the xhost command, and logging in via ssh and setting the DISPLAY variable, and allowing the connection through iptables.
like i said... when the X server is started by the login manager "KDM" x isnt listening for network connections.

its got nothing to do will allowing the connection.... or other security.. X just is not LISTENING.

you do understand what i mean by listening right ?
bofore a TCP connection is established, a server needs to listen on a port for connection requests... for example, http servers listen to port 80... ftp server listen to port 21... and X servers listen to port 6000.

so............
What is KDM doing to stop X from listening ? and how do i recify the problem ?
 
Old 10-21-2004, 10:49 AM   #10
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
Well, I have searched the net, but I cannot find anything about where to enable kdm to listen for remote X connections, I know that GDM there is an options setup that will enable it or disable with a check box. So I would imagine the same for KDe, but I can find nothing about.. I have found one article but it seems to pertain mainly to XDCMP and an old version of KDM.. but maybe it will help you locate the answer....

http://www.owlriver.com/tips/gdm-setup/remotexkdm.html
 
Old 10-21-2004, 08:24 PM   #11
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Original Poster
Rep: Reputation: 47
ohhh dear... im running out of ways to explain this....
i dont want KDM to listen for remote connections....

i want X.. the graphical server (X.org) to listen for incomming connections....
i JUST want to use KDM as a LOCAL graphical login program.

and i already searched the net.. thats why im asking the question here....

so...
I Want X to listen on Port 6000 for remote applications to connect to.
I want to login to my local machine graphically.
netstat only reports that X is listening on port 6000 when i login by cmmand line.

when i loggin by command line, x is started with the command "xinit"
when i loggin graphically, x is started by the kdm init script.

this has mothing to do with XDCMP, nothing to do with me frewall or xhost list.
nothing to do with KDM apart from the fact i want to use it...

this is PURE Xorg and how to make it listen on port 6000 when it only does so after a command line login ?

does anyone understand ? any ideas ?

the link you gave me is about KDE... the remote machine doesnt even run KDE... its a SOlaris Machine... but it has some graphical programs i need to run from my linux machine.

i dont want to run a whole desktop remotely.. just a single application, whilst KDE is running. (and after having logged in graphically)

simple as that.

Last edited by qwijibow; 10-21-2004 at 08:26 PM.
 
Old 10-22-2004, 11:12 AM   #12
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Original Poster
Rep: Reputation: 47
still not found a solution.... but i installed GDM.
GDM has an option about wether or not to make X listen for incomming connections.
 
Old 10-23-2004, 08:08 PM   #13
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
Quote:
Originally posted by qwijibow
ohhh dear... im running out of ways to explain this....
i dont want KDM to listen for remote connections....

i want X.. the graphical server (X.org) to listen for incomming connections....
i JUST want to use KDM as a LOCAL graphical login program.

and i already searched the net.. thats why im asking the question here....

so...
I Want X to listen on Port 6000 for remote applications to connect to.
I want to login to my local machine graphically.
netstat only reports that X is listening on port 6000 when i login by cmmand line.

when i loggin by command line, x is started with the command "xinit"
when i loggin graphically, x is started by the kdm init script.

this has mothing to do with XDCMP, nothing to do with me frewall or xhost list.
nothing to do with KDM apart from the fact i want to use it...

this is PURE Xorg and how to make it listen on port 6000 when it only does so after a command line login ?

does anyone understand ? any ideas ?

the link you gave me is about KDE... the remote machine doesnt even run KDE... its a SOlaris Machine... but it has some graphical programs i need to run from my linux machine.

i dont want to run a whole desktop remotely.. just a single application, whilst KDE is running. (and after having logged in graphically)

simple as that.
I understand what you are saying & asking, But I was unable to find (as your were unable to do as well) an option to allow what your are looking for with KDM... That being why i mentioned that GDM has this option you are looking for.

Quote:
Originally posted by qwijibow
still not found a solution.... but i installed GDM.
GDM has an option about wether or not to make X listen for incomming connections.
Glad you found a solution...
 
Old 10-23-2004, 09:50 PM   #14
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Original Poster
Rep: Reputation: 47
lol.. this isnt quite the end

one thing ive noticed about kde....
when you run kde as a normal user, you do not get a shutdown option in the main menu.
however when you run kde from KDM as root (but logged in as user) then kde runs with the privilages to do a shutdown...

GDM does not seem to run kde with the priivilages to shutdown.
i need to logout each time, then shutdown from GDM...

any more ideas ?
 
Old 10-24-2004, 09:44 AM   #15
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
Quote:
Originally posted by qwijibow
lol.. this isnt quite the end

one thing ive noticed about kde....
when you run kde as a normal user, you do not get a shutdown option in the main menu.
however when you run kde from KDM as root (but logged in as user) then kde runs with the privilages to do a shutdown...

GDM does not seem to run kde with the priivilages to shutdown.
i need to logout each time, then shutdown from GDM...

any more ideas ?
This option is also available in gdm setup tool, run gdmsetup on the security tab, there is an checkbox for "show actions..." just check that box then a normal user will have the shut down logout option from the "logout" menu.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What kind of music do you listen to when surfing linuxquestions.org forums? t3gah General 32 10-14-2005 04:41 PM
Can i make my X server to listen only for ssh requests and my X client to use shh ??? alekoos Linux - Security 2 05-06-2004 05:11 PM
How to make a program to listen on a Particular port palanisaravanan Linux - General 4 04-14-2004 06:43 PM
a program to listen+accept incomming connection+echo packets ? qwijibow Linux - Software 0 03-01-2004 09:10 PM
using 2 ISDN connections to make one fast one zarnok Linux - Networking 0 09-07-2001 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:14 PM.

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