1

I have a raspberry-pi. I have it set up so I can ssh into it with putty from my windows machine. I have codeblocks installed on the raspberry-pi. I would like to be able to open and display the codeblocks ide on my windows machine from the pi. I have xterm(-v 278) installed on my pi and Xming installed on my windows machine.

On my windows machine open Xlauch to start Xming I leave the default values but I disable access control. Then on my windows machine I open putty to ssh into my pi, with X forwarding enabled for this session. Once logged in on the pi I type

$ export DISPLAY="<windows_machine_ip>:0.0

$ xterm DISPLAY

than I get the message xterm: No absolute path found for shell: DISPLAY

I am really confused why I am getting this message. Does anyone know a fix or can explain what I am doing wrong. Thanks in advance.

Elena
  • 77
  • 2
  • 9

1 Answers1

1

You do not need to put the argument DISPLAY after xterm like that. It is enough to have the environment variable DISPLAY set and exported (as you have in your first command).

The synopsis of xterm is:

xterm [-toolkitoption ...] [-option ...] [shell]

So, when you type this:

xterm DISPLAY

it is interpreting the word DISPLAY as the name of the shell you want to use - thus the error message No absolute path found for shell: DISPLAY.

In short, all you had to type was this:

$ export DISPLAY="<windows_machine_ip>:0.0
$ xterm &

I recommend putting the '&' on the end, as that starts xterm in the background and returns your original shell so you can enter more commands if desired.

Since you are using PuTTY, an even easier way is to use it's built in X11 forwarding.

Configure Putty for X11 Forwarding

Under Connection->SSH->X11, tick 'enable X11 forwarding' before you start your session. After this, as soon as the connection is open, just type xterm &, or any other X command.

Note that when using SSH X11 Forwarding, you do not need to set the DISPLAY variable. It will automatically be set on login, to a value such as localhost:10.0. This means that the sshd daemon is pretending to be an X server with display #10, whereas in reality it is forwarding all connections through to your local PC where they reach the real X server.

harmic
  • 28,606
  • 5
  • 67
  • 91
  • I was already enabling X11 forwarding in putty. I changed my second cmd to "xterm&" and I still get an error. It says "xterm: Xt error: Can't open display: – Elena Jun 23 '14 at 12:32
  • If using ssh X11 forwarding, you do not manually set the DISPLAY variable. It will be set automatically by the sshd login process. You can confirm this by executing `echo $DISPLAY` immediately after logging in. It will be `localhost:10.0` or something like that. – harmic Jun 23 '14 at 12:35
  • Ok, I confirmed that immediately after logging in the cmd **echo $DISPLAY** returns **localhost:10.0**... – Elena Jun 23 '14 at 12:42
  • Right, so assuming you have Xming running on the windows machine, then just run xterm. If it still does not start then I would suspect Xming is not set up properly. – harmic Jun 23 '14 at 12:52