6

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.

5
  • I can't find the sshd_config file in my rp - you mean /etc/ssh/sshd_config ? Jan 7, 2019 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) Jan 7, 2019 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 [email protected]
    – Seamus
    Jan 7, 2019 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, 2019 at 18:38
  • If you're trying to run firefox, it's likely doing its own thing instead of forwarding. Try "firefox --no-xshm" or "firefox --no-remote --no-xshm" to run it. May 4, 2023 at 11:53

1 Answer 1

4

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.

2
  • 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, 2019 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. Jan 13, 2019 at 12:27

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.