X forwarding over SSH


4 posts
by magicstix » Sun Jul 15, 2012 6:46 am
Hi all,
I've been using my Pi with archlinux and ssh'ing into it remotely (with ssh -X or ssh -Y for X11 forwarding), but I've been unable to get X forwarding to work so far. I have X running, and it's created a :0 display, but when I run a program with DISPLAY=:0 <program> it just sits there, sometimes giving a warning message.

For example, running emacs:
DISPLAY=:0 emacs

Gives:
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.


But after that nothing happens. I don't get an emacs window, and if I ctrl C it I get:
(emacs:1747) GConf-WARNING ** : Got disconnected from DBus.

Are the programs trying to pop up on the actual Pi display instead of my local machine? If so, what's the fix?
Posts: 12
Joined: Sat Jul 14, 2012 5:33 pm
by joan » Sun Jul 15, 2012 7:31 am
What happens if you enter the command?

ssh -X raspberry-name-or-address xeyes

Does

xhost +

on your local machine make any difference?
User avatar
Posts: 5185
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by magicstix » Sun Jul 15, 2012 7:52 am
Nevermind, I figured it out. sshd wasn't configured correctly.

For those having the same problem:
In /etc/ssh/sshd_config
make sure X11ForwardingEnable and X11UseLocalhost are set to yes.
Posts: 12
Joined: Sat Jul 14, 2012 5:33 pm
by hunterpi » Sat Sep 15, 2012 12:19 am
I use cygwin how terminal X Window
you make sure execute Cygwin-X -> XWin Server program, then login with ssh:
# ssh -Y root@192.168.1.xxx

then run any X program, for example the visual debuger (ddd):
# ddd

The main window of ddd appears in MSWindows.
Posts: 6
Joined: Fri Sep 14, 2012 11:22 pm