4

I am controlling my PI through my PC (wich is running Windows 7) using Putty to type in commands and tightvnc viewer to access the GUI.

I can launch programs with the TightVNC viewer GUI or TightVNC viewer LXterminal. However if I try to launch them on the command line with the putty shell I get an error.

Eg. if I type: midori I will get: Midori - cannot open display

I have read up about X, etc... but can't figure out what to do.

(When I type: echo $DISPLAY, I get a blank line, in case this is any help).

3 Answers 3

10

To access an UNIX server from a Windows client, my preferred combination is PuTTY + Xming. Xming is easy to install, lightweight, fast, stable, and works pretty well overall.

The procedure (also explained here):

  • Enable the X11 forwarding option in PuTTY (Configuration > Connection > SSH > X11 > Enable X11 forwarding)
  • Start Xming on your Windows machine: ...\Xming\Xming.exe :0 -clipboard -multiwindow
  • Connect to your Raspberry PI with PuTTY
  • Launch any X application from your PuTTY ssh console

The application should appear on it's own window (if you set the -multiwindow Xming command-line option), and seamlessly integrate onto the host.

The nice thing is that it's rather lightweight, you do not need to run a full-blown X desktop on the Raspberry. With a decent network connection between the client and the host you do not feel any lag. And remember that client and host are swapped from their usual understanding according to X11 conventions!

Note 1: I don't know anything about TightVNC, but simply activating X11 forwarding in PuTTY should be enough to make that work with any X server on your Windows machine. But again, Xming rocks!

Note 2: There is even a documentation on using PuTTY on Xming website.

2
  • +1 for mentioning Xming. Looks really good. I have been using Cygwin X for same purpose. Will give Xming a try. Commented Sep 3, 2013 at 3:33
  • Thanks. If you only need a X server, indeed Xming is really better. Cygwin is a full blown Unix compatibility layer for Windows, and you end up using a small percentage of the system, even if you install the bare minimum for X. Commented Sep 3, 2013 at 7:34
2

You can use SSH's X11 forwarding capabilities.

X11 forwarding needs to be enabled on both the client side and the server side.

On the server side, X11Forwarding yes must specified in /etc/ssh/sshd_config. Note that the default is no forwarding (some distributions turn it on in their default /etc/ssh/sshd_config), and that the user cannot override this setting.

On the client side, the -X (capital X) option to ssh enables X11 forwarding, and you can make this the default (for all connections or for a specific conection) with ForwardX11 yes in ~/.ssh/config.

Then try to connect from client to server with -X or -Y option.

ssh -Y user@rpi-server

And run your command: midori

Source : https://unix.stackexchange.com/questions/12755/how-to-forward-x-over-ssh-from-ubuntu-machine

2
0

It sounds like you want the X applications to run and display on the Pi (which is the usual way to do things). In that case you don't want to do any X-Forwarding or run an additional X client. You just have to let the ssh session know you intend to use the Pi's display.

After ssh'ing in to the pi (eg. using Putty), run:

export DISPLAY=:0.0

From then on, any GUI application you execute will use the Pi's display and you'll be able to see it in your VNC session.

I used this answer for reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.