arc19
Posts: 18
Joined: Mon Jul 08, 2019 1:59 pm

GUI from Pi to ssh

Tue Jul 30, 2019 12:28 pm

Hi All!

I've created a GUI and saved it in my raspberry pi files. I have ssh connected to my mac laptop and wanted to open the GUI from my terminal on my laptop. I can open and execute any other code but the GUI's are not working on the laptop (although they work perfectly on the pi). The error that I continue to get is "no display name and no $DISPLAY environment variable." After helplessly scouring through the internet, I haven't been able to get rid of this problem. The GUI i'm trying to display is just a couple enter fields for the user to put in specifications of the experiment. Does anyone know how to get the GUI to show up on my laptop?

Thanks!

klricks
Posts: 6615
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: GUI from Pi to ssh

Tue Jul 30, 2019 12:52 pm

arc19 wrote:
Tue Jul 30, 2019 12:28 pm
..... Does anyone know how to get the GUI to show up on my laptop?...
Use VNC instead of SSH.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

arc19
Posts: 18
Joined: Mon Jul 08, 2019 1:59 pm

Re: GUI from Pi to ssh

Tue Jul 30, 2019 1:26 pm

Thanks for your suggestion! VNC is working well but I read that ssh is much more secure than vnc (since I am connecting through the internet). Does anyone know how to fix the problem and still use ssh?

Thanks!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24133
Joined: Sat Jul 30, 2011 7:41 pm

Re: GUI from Pi to ssh

Tue Jul 30, 2019 1:51 pm

Look up "ssh -X" for X forwarding. You need an X client on the machine.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Andyroo

Re: GUI from Pi to ssh

Tue Jul 30, 2019 2:34 pm

arc19 wrote:
Tue Jul 30, 2019 1:26 pm
Thanks for your suggestion! VNC is working well but I read that ssh is much more secure than vnc (since I am connecting through the internet). Does anyone know how to fix the problem and still use ssh?

Thanks!
You could still use VNC - link via the Real VNC website to your Pi as that’s via HTTPS and the link from there to the Pi is encrypted.

Failing that, put a VPN on the Pi

It’s worth trying the -X option in Terminal - it worked in Leopard and I cannot remember seeing a note on it be removed - I’m miles from a Mac at the mo though so cannot try it for you :roll:

Or use ZOC https://www.emtec.com/zoc/features.html though it’s not cheap at €80

DarrenHill
Posts: 234
Joined: Fri Oct 03, 2014 3:03 pm

Re: GUI from Pi to ssh

Tue Jul 30, 2019 3:14 pm

Maybe look at a text-based UI solution like Whiptail, rather than something truly graphical?

Depending on exactly what you need the (G)UI to do and look like, and of course what you're actually running in the first place.

fbe
Posts: 540
Joined: Thu Aug 17, 2017 9:08 pm

Re: GUI from Pi to ssh

Tue Jul 30, 2019 5:01 pm

jamesh wrote:
Tue Jul 30, 2019 1:51 pm
Look up "ssh -X" for X forwarding. You need an X client on the machine.
The GUI programm on the Raspberry Pi is the X client. You need an X server on the notebook that provides a display.

User avatar
scruss
Posts: 2617
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: GUI from Pi to ssh

Tue Jul 30, 2019 5:09 pm

And that X server for Mac OS is XQuartz. It used to ship with the OS, but now it's a separate thing.

The important (and annoying) thing about X on Mac OS is that the cut and paste keys are Ctrl-X,C,V, and not ⌘. Also running a X with a single button mouse is somewhat trying.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

Return to “Networking and servers”