how to make X.org listen for incomming connections ?
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ?
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.
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.
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.
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)
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...
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 ?
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....
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)
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.
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...
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.