2

For the headless raspberry pi (rp), I tried to connect from my windows PC to Raspberry pi via mobaxterm and ssh. I can connect via ssh (ssh pi@ but I can't display to my local display(ssh -X pi@. I appreciate if someone can guide me which applications/file should I check and configure. I set the ssh_config to allow X11 forwarding. I can't find the sshd_config file in my rp.

  • I can't find the sshd_config file in my rp - you mean /etc/ssh/sshd_config ? – Jaromanda X Jan 7 at 22:10
  • I set the ssh_config to allow X11 forwarding you did that on the PC, because that's where you set that option, not on the pi (I'm assuming your PC is a Windows PC) – Jaromanda X Jan 7 at 22:12
  • I can't help much as I use a Mac with XQuartz for X, but my ssh command looks like this: ssh -Y pi@raspberrypi3b.local – Seamus Jan 7 at 23:53
  • Please login to your pi using ssh and check whether X11 forwarding is enabled on the pi by running the following command: grep X11 /etc/ssh/sshd_config – epposan Jan 8 at 18:38
2

In order to forward X display to your machine you need following:

  • enable X forwarding on sshd on RPi (/etc/ssh/sshd_config: X11Forwarding yes)
  • configure ssh client on your machine to enable X forwarding and point it to X server (for example 127.0.0.1:0)
  • install Xserver on your machine (for example Xming) and run it
  • log in via ssh to RPi
  • start X application on RPi

I recommend Putty as ssh client.When logged in you can check value of $DISPLAY variable:

$echo $DISPLAY
localhost:10.0

Here is some more info if you have problems configuring setup.

  • the information you provide is correct and helpful in general, however the OP indicates that he already has an xserver and an ssh client running (mobaxterm) but seems to have other (configuration related?) problems – epposan Jan 12 at 6:13
  • @epposan I misssed mobaxterm part. Sorry. I have no experience working with this client - maybe someone else ... I'll leave this answer until someone comes up with something better. – Mariusz Zieliński Jan 13 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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