Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 04-08-2009, 03:51 PM   #1
Registered: Jun 2003
Location: Virginia
Distribution: Slackware 10.1
Posts: 180

Rep: Reputation: 30
Export DISPLAY Back to FreeNX Server [CentOS 5.3]


I set up FreeNX on one of my Linux boxes today running CentOS 5.3. I am using NX Client for Windows to connect to this machine. For the most part, everything seems to be running nicely and surprisingly fast.

However, when I connect to the FreeNX server, then ssh to another server, I cannot export my DISPLAY back to the FreeNX server. Is there a way to get this to work? I have confirmed that if I'm physically at the box, I can ssh and export my DISPLAY back without an issue, it only seems to be when I'm connected to FreeNX.

Example of what I've tried:

[on FreeNX server]
(The title bar describes this session as chryzmo@servername:1000)
$ xhost +
access control disabled, clients can connect from any host
$ echo $DISPLAY 

$ssh secondbox
chryzmo@secondbox's password: 
$ export DISPLAY=
$ xterm
(There is a 5-10 second pause here)
xterm Xt error: Can't open display:
Does anyone know if there is a way to export your DISPLAY back to a FreeNX server?

Old 04-09-2009, 09:19 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Don't use xhost if you have ssh. It is very insecure. Instead use ssh forwarding instead.

When you open the connection do "ssh -x host" instead of just "ssh host". This sets the DISPLAY to vi a special value on localhost and that value is then used to push the X traffic back over your ssh connection (which is secure).

Also make sure you aren't setting DISPLAY value in your bashrc, bashprofile etc... as it will override the DISPLAY the ssh forwarding is trying to use. With this you no longer need to use xhost on server to allow traffic as X never sees that the traffic is going anywhere but to the local server.

Type "man ssh" for more details.

Also note that this setting only applies for the user you logged in as. If you su to another user (e.g. "su -" to become root) the new user doesn't inherit. You just need to manually set DISPLAY for new user to same as original then set variable XAUTHORITY=<homedir_of_original_user>/.Xauthority. For any user other than root you'd also have to change permissions of the .Xauthority file as only the original user can read it.
Old 04-09-2009, 09:57 AM   #3
Registered: Jun 2003
Location: Virginia
Distribution: Slackware 10.1
Posts: 180

Original Poster
Rep: Reputation: 30
Thank you for your response. Normally I would not use xhost +, I was just getting frustrated that I could not get this working. I was attempting to limit possible causes of the issue.

It turns out that in /etc/nxserver/node.conf there is a line:
change this to

Then restart the freenx-server and X forwarding should work. My problem was assuming that because it was commented out, there was a different default.


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
What is the difference between DISPLAY= and export DISPLAY=?? john test Linux - Newbie 4 09-01-2008 06:41 PM
Problem with Starting FreeNX. Followed Guide. Centos. Dont think GNOME is running. CrewXp Linux - Software 5 08-14-2007 02:04 AM
Installing FreeNX on Centos, quick question. CrewXp Linux - Software 5 08-13-2007 01:04 PM
how to export the display bruse Linux - Networking 18 05-03-2005 09:13 PM
kino 0.7.5 won't export back to camcorder tvphil Linux - Software 0 04-14-2005 09:48 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:47 AM.

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