LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 01-22-2013, 08:47 AM   #1
chaditya
LQ Newbie
 
Registered: Jan 2013
Posts: 3

Rep: Reputation: Disabled
Problem using X Windows Server from X Client


Hi,

I have started the X Windows server on my PC (running Windows 7). I'm trying to run the X Client (TCP Mon GUI Program) from Linux server.

I'm following the below steps:
1) export DISPLAY=IPAddress:0.0
2) Logging in as "su"
3) Executing the script.

The problem is when I try to execute the above steps I'm getting the below error:

Xlib: connection to "xxx.xx.xx.xx:0.0" refused by server
Xlib: No protocol specified

java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:89)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.Toolkit$2.run(Toolkit.java:834)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826)
at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:126)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1556)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:130)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1591)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:541)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:581)
at org.apache.ws.commons.tcpmon.TCPMon.setupLookAndFeel(TCPMon.java:138)
at org.apache.ws.commons.tcpmon.TCPMon.main(TCPMon.java:159)


Please help.

Aditya
 
Old 01-22-2013, 09:09 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
On your linux server, before launching the X window, once invoke:-
Code:
xhost +<hostname/ip-windows-system>
Also while login, are you using X-forwarding or not? And what's in your script. Once invoke it in debug mode as:-
Code:
#!/bin/bash
set -xv
(Rest part of script)

Last edited by shivaa; 01-23-2013 at 07:44 AM. Reason: Silly typo rectified :)
 
1 members found this post helpful.
Old 01-22-2013, 09:20 AM   #3
chaditya
LQ Newbie
 
Registered: Jan 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shivaa View Post
On your linux server, before launching the X window, once invoke:-
Code:
xhost +<hostname/ip-windows-system>
Also while login, are you using X-forwarding or not? And what's in your script. Once invoke it in bedug mode as:-
Code:
#!/bin/bash
set -xv
(Rest part of script)
When I execute the xhost +hostname, I'm getting below error:

xhost: unable to open display ""
 
Old 01-22-2013, 09:27 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
You have to set display of remote machine (is that a Windows machine?) where you want to launch this X-window, not your local Linux server's display.

Connect to remote machine, and (if it's Unix based), invoke:
Code:
~$ echo $DISPLAY
(some_output)
~$ DISPLAY=(some_output); export DISPLAY
 
1 members found this post helpful.
Old 01-22-2013, 07:51 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
The most common scenario when running an X client is that the X server is on the workstation which has the user console. That means either the X server is on the same host as the X client, or that the user has logged into the X client host from a workstation that is running the X server. I will assume the latter since there are two OS's involved.
The easiest (also the best & most secure) way to accomplish your objective is to log into the X client linux host with an SSH client that can do X tunneling. When doing so, it will automatically set up the correct $DISPLAY variable on the X client host, and will silently route all X traffic to the X server on your local host. For Windows SSH clients, putty seems to be the weapon of choice for most people, as I understand it. SSH under Cygwin will also work, and there are a number of others.
If you were doing this from another Linux shell, the ssh command would look like
Code:
ssh -X you@your.xserver.host
The method of manually setting $DISPLAY on the X client host may not work at all unless the X server is configured to accept remote TCP connections. Using the X tunnel method, the X traffic is seen by the X server as local, since the local ssh client is what makes the X connection.

--- rod.
 
1 members found this post helpful.
  


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
problem connecting to nfs server on debian from a client running on windows xp pro mf93 Linux - Networking 5 11-22-2009 07:25 PM
fax transfer problem between Hylafax server in Linux and C# client of windows asifjavaidy2k Linux - Software 0 02-09-2007 07:32 AM
windows vnc client and linux vnc server problem tungaw2001 Linux - Software 8 06-17-2006 01:06 AM
can not connect to my pureftp server from Linux client, but i can from windows client bonito SUSE / openSUSE 5 03-16-2005 10:45 PM


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