I have a Raspberry pi that I have been accessing through SSH, but now I need to run a python program on it that has a GUI. I'm not sure how to do this through SSH. Usually I get to my raspi's desktop gui by typing startx. Is there anything I can do like this over ssh?
Thanks!
An IP address is required to get access to Raspberry Pi over Secure Socket Shell ( SSH ). (SSH is a network protocol that provides the administrator with a secure way to access a remote computer. SSH service is not enabled by default in Raspberry Pi. To enable SSH, access command line using sudo raspi-config command).
After establishing the connection by clicking “Open” a new window appears. Here you should insert your username and password. The Raspbian Wheezy/Jessie default login is user “ pi ” with password “ raspberry “.
It is a remote login protocol that used Port 22 by default. In the older version of Raspbian, the ssh was enabled by default but after the November 2016 release of Raspbian, the ssh server was disabled by default and it needs to be enabled manually.
How to run GUI application via SSH SSH is normally used for remote access and administration where tasks are done from the CLI (Command Line Interface), using command line tools. SSH can forward the display or GUI from the SSH server to the client, enabling running X11/X or graphical apps from within an SSH session.
The approach mentioned by kjprice just displays the applications you started on the remote host. If you want to see a complete dektop, you could either create a new Xserver or use Xephyr to nest a Xserver in the one you are currently using.
Well first create a new nested Xserver:
user@host $ Xephyr :1 -screen 800x600 &
A window called "Xephyr on :1" should spawn. Ssh into the remote host an forward the display to the created display:
user@host $ DISPLAY=:1 ssh -Y username@remotehost
Now start a session on the remotehost, in my case LXDE:
user@remotehost $ lxsession
You should now see the desktop in Xephyr. hf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With