9

I have not found this exact question but I could be using incorrect terms. In Ubuntu 16.04 I was able to start graphical applications over SSH by first running:

export DISPLAY=0.0

then any graphical program will open when launched in the same SSH session.

For example nohup sudo -u $LOCALUSER gedit & will open up gedit for the local user to use.

I am aware that the switch from the aging X11 to Wayland is the reason this no longer works.

What would be the current way to do this in 17.10/Wayland? Most of my workstations are managed remotely for local operators with limited access. A one liner solution for this would be desirable. We cannot do any complicated modifications from the initial install. The lack of information makes me think this is not possible in the default install, and requires system modification. Is a "one liner" on a default system possible to allow launching of GUI applications via SSH?

If not possible, we can wait until this update is made before upgrading.

Yaron
  • 12,828
  • 7
  • 42
  • 55
Pretorious
  • 91
  • 1
  • 4
  • 5
    The easiest way to do this would be to disable the Wayland session, and force X11 (which will be the default in 18.04) – Charles Green Feb 13 '18 at 21:18
  • Please see [https://askubuntu.com/a/975098/283721](https://askubuntu.com/a/975098/283721) – Charles Green Feb 13 '18 at 21:19
  • Very much agreed the lowest friction solution is to disable Wayland. – Pretorious Feb 13 '18 at 21:30
  • I would have marked the question as a duplicate, but what you asked really was quite different. – Charles Green Feb 13 '18 at 21:32
  • However another team on the project is very excited about Wayland (not sure why), so I have been asked to make this happen /without/ disabling it. I understand this is an odd request and maybe outside of the scope of Wayland... or maybe my understanding of what it is has been incorrect. – Pretorious Feb 13 '18 at 21:33
  • 1
    Eh - I cannot say, obviously. I have been told Wayland is 'faster lighter betterer and will butter the bread' but the reality seems to be that the tools people use to run their computers are not quite present in the Ubuntu implementation of Wayland, yet. [https://insights.ubuntu.com/2018/01/26/bionic-beaver-18-04-lts-to-use-xorg-by-default/](https://insights.ubuntu.com/2018/01/26/bionic-beaver-18-04-lts-to-use-xorg-by-default/) – Charles Green Feb 13 '18 at 21:36
  • You wish to start the GUI applications _locally_ on the system you're connecting to, rather than forward the application to your display over ssh? (It's not quite clear in reading your question which you want exactly). Also, 17.04 (you mentioned it in the body of your question, and tagged with it, but title says 17.10), is end of life, and you shouldn't be using it. – dobey Feb 13 '18 at 21:45
  • Edited to 17.10 and for clarity. Yep, I want to open it locally on the machine I am connecting to. At current I use "nohup sudo - u $LOCALUSER $COMMAND &" to ensure the operator has access to the application. There are probably better way to do this, but I am at the whim of other people. – Pretorious Feb 13 '18 at 23:57

2 Answers2

5

X11 is way old tech at this point. To do this with wayland, check in a GNOME Terminal window:

$ echo $DISPLAY $XAUTHORITY
:0 /run/user/1000/gdm/Xauthority

In the ssh session, define those two values:

XAUTHORITY=/run/user/1000/gdm/Xauthority DISPLAY=:0 gedit

Verified to work on Ubuntu 19.04.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
Harald Rudell
  • 181
  • 1
  • 3
0

It works with Wayland on Ubuntu 23.04

Francisco Costa
  • 236
  • 4
  • 13
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/1292457) – zx485 Jul 17 '23 at 19:51