1

I'm trying to launch a gui over ssh, but I get the error

Gtk-WARNING **: cannot open display: :0.0
  1. I start the remote machine via wakeonlan
  2. It sits at Ubuntu's login screen
  3. I connect via ssh to the remote machine
  4. DISPLAY=:0 someprogram & fails do to the error above

However, if I login on the remote machine and get past the login screen, all ssh gui commands now work.

So how do I login remotely?

Some more background:

I'm attempting to wake my desktop computer from my laptop. I then try to launch spotify on my desktop, since it's connected to the speakers in my room. If I can get spotify to run on my desktop, I can then launch spotify on my laptop and control it from my laptop. The issue is that spotify needs to be running on both, and the gui for spotify on the desktop won't run until I'm logged in.

Let me know if any more information is needed. For now I simply need to walk over to my desktop and log in which is no issue, but ideally I'd be able to do this all from my laptop.

muru
  • 197,895
  • 55
  • 485
  • 740
  • You need to start an X server under you user (which happens when you login via GUI) before you can start GUI apps on it. So use VNC to login over SSH, or setup autologin. – muru Feb 06 '17 at 01:32
  • @DavidFoerster From my understanding, X11 forwarding renders the gui for the program being ran on the server on the local computer. I want it to render on the server. I think muru might have pointed out some good options to get this working, which I need to test on my next free weeknight. – JesseBuesking Feb 06 '17 at 17:22
  • @muru So autologin just bypasses login credentials when the "server" is started up? If so that approach seems too insecure for my liking. I'll attempt to get the vnc method in the link working on my next free weeknight. I already have vnc running via remmina, but from what I recall I tried it and it wouldn't connect, but maybe the approach in the answer you linked to will resolve the issue. – JesseBuesking Feb 06 '17 at 17:24
  • You're right. My first idea was that it would make more sense to control the application from the SSH client via X forwarding but that won't help if you want to leave the application running and accessible from different sources (like you'd want to do a music player). I'm retracting my close vote. – David Foerster Feb 06 '17 at 18:38
  • @JesseBuesking if you used the "sharing" options to setup VNC, that requires you to be logged in as well. – muru Feb 06 '17 at 22:55
  • @DavidFoerster no worries, and thank you for the comments any way! – JesseBuesking Feb 07 '17 at 15:20

0 Answers0