# Problem with X:  can someone please help? [SOLVED]

## cfgold

Hello.

I am having great difficulty with a remote server whenever I try to ssh into it.  Here's the setup:

We have a server, call it myserver, on which we run a bunch of programs.  I would like to be able to ssh into myserver and run the programs with:

ssh me@myserver (or ssh -l me myserver)

I can do that from my nieghbor's machine -- which runs the same version of red hat as the server (enterprise 3.0, methinks) -- and everything works just fine.  However, when I do that from my desktop (gentoo 2005.0), I get a bunch of errors.  For example, here's what happens when I try to run either CHEMKIN or dsmj (two programs I use frequently)

```

$ chemkin

Now launching Chemkin(R) User Interface; this may take a few seconds

Program initialization succeeded. Log file is /home/lachance/chemkin/logs/chemkin_20050510_0348.log

Exception in thread "main" java.lang.NoClassDefFoundError

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Class.java:140)

        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)

        at java.awt.Font.initializeFont(Font.java:309)

        at java.awt.Font.<init>(Font.java:345)

        at javax.swing.plaf.metal.DefaultMetalTheme$FontDelegate.getFont(DefaultMetalTheme.java:195)

        at javax.swing.plaf.metal.DefaultMetalTheme.getFont(DefaultMetalTheme.java:153)

        at javax.swing.plaf.metal.DefaultMetalTheme.getControlTextFont(DefaultMetalTheme.java:129)

        at javax.swing.plaf.metal.MetalLookAndFeel$FontActiveValue.createValue(MetalLookAndFeel.java:1399)

        at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:196)

        at javax.swing.UIDefaults.get(UIDefaults.java:126)

        at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)

        at javax.swing.UIDefaults.getFont(UIDefaults.java:346)

        at javax.swing.UIManager.getFont(UIManager.java:491)

        at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:89)

        at javax.swing.plaf.basic.BasicButtonUI.installDefaults(BasicButtonUI.java:124)

        at javax.swing.plaf.metal.MetalButtonUI.installDefaults(MetalButtonUI.java:53)

        at javax.swing.plaf.basic.BasicButtonUI.installUI(BasicButtonUI.java:60)        at javax.swing.JComponent.setUI(JComponent.java:449)

        at javax.swing.AbstractButton.setUI(AbstractButton.java:1594)

        at javax.swing.JButton.updateUI(JButton.java:119)

        at javax.swing.AbstractButton.init(AbstractButton.java:1930)

        at javax.swing.JButton.<init>(JButton.java:109)

        at javax.swing.JButton.<init>(JButton.java:64)

        at javax.swing.plaf.basic.BasicArrowButton.<init>(BasicArrowButton.java:40)

        at javax.swing.plaf.basic.BasicArrowButton.<init>(BasicArrowButton.java:50)

        at javax.swing.plaf.metal.MetalScrollButton.<init>(MetalScrollButton.java:46)

        at javax.swing.plaf.metal.MetalScrollBarUI.createIncreaseButton(MetalScrollBarUI.java:124)

        at javax.swing.plaf.basic.BasicScrollBarUI.installDefaults(BasicScrollBarUI.java:140)

        at javax.swing.plaf.metal.MetalScrollBarUI.installDefaults(MetalScrollBarUI.java:74)

        at javax.swing.plaf.basic.BasicScrollBarUI.installUI(BasicScrollBarUI.java:102)

        at javax.swing.JComponent.setUI(JComponent.java:449)

        at javax.swing.JScrollBar.setUI(JScrollBar.java:185)

        at javax.swing.JScrollBar.updateUI(JScrollBar.java:205)

        at javax.swing.JScrollBar.<init>(JScrollBar.java:139)

        at javax.swing.JScrollBar.<init>(JScrollBar.java:154)

        at javax.swing.JScrollPane$ScrollBar.<init>(JScrollPane.java:674)

        at javax.swing.JScrollPane.createVerticalScrollBar(JScrollPane.java:819)        at javax.swing.JScrollPane.<init>(JScrollPane.java:261)

        at javax.swing.JScrollPane.<init>(JScrollPane.java:313)

        at com.chemkin.gui.ReactorsPalette.<init>(ReactorsPalette.java:57)

        at com.chemkin.gui.ReactorsPalette.getInstance(ReactorsPalette.java:63)

        at com.chemkin.Chemkin.main(Chemkin.java:75)

$

```

and

```

$ dsmj &

Exception in thread "main" java.awt.HeadlessException:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

        at java.applet.Applet.<init>(Applet.java:44)

        at javax.swing.JApplet.<init>(JApplet.java:101)

        at COM.ibm.storage.adsm.cadmin.clientgui.DDsmApplet.<init>(DDsmApplet.java:320)

        at COM.ibm.storage.adsm.cadmin.clientgui.DDsmApplet.main(DDsmApplet.java:682)

```

So something with java is not happy, right? Also, I was thinking that X may be the problem, I try to login using:  ssh -X me@myserver.  When I try the same two commands, I no longer get the error messages.  Instead, the programs begin to load, but I cannot use them.  Basically, it loads the window, but everything is completely gray.  All the usual prgram buttons and whatnot are missing.

Note that this behavior is not peculiar to these two programs.  The behavior is consistent for just about any program, but I chose these two because I was using them this morning.

Can someone please help?  I really need to be able to run these programs over the server.

THANKS!!!

CFGLast edited by cfgold on Wed May 11, 2005 1:47 pm; edited 1 time in total

----------

## Eagle-Eye

Maybe the program needs a trusted X11-forwarding, 

```
ssh -X -Y me@myserver
```

----------

## cfgold

Ha!  Yep, that seems to work!

Is there any way that I can avoid having to type the -X -Y?  Is there some way to make that the default?

Many thanks!

CFG

----------

## Eagle-Eye

Edit your ~/.ssh/config:

```
Host *

  Compression yes

  ForwardX11 yes

# ForwardX11Trusted yes

  Protocol 2

  KeepAlive yes

  Cipher blowfish

```

but it should be used with caution, see the manual page of ssh...

 *Quote:*   

>      -X      Enables X11 forwarding.  This can also be specified on a per-host
> 
>              basis in a configuration file.
> 
>              X11 forwarding should be enabled with caution.  Users with the
> ...

 

----------

## cfgold

Great.  Thanks for the tip.  I'll just stay in the habit of typing -X -Y for now.

Thanks again for your speedy help, too.

Cheers,

CFG

----------

