Starting GUI program over SSH in wayland (Ubuntu 17.10)
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.
Related videos on Youtube
Pretorious
Updated on September 18, 2022Comments
-
Pretorious over 1 year
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 upgedit
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.
-
Charles Green about 6 yearsThe 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 about 6 yearsPlease see https://askubuntu.com/a/975098/283721
-
Pretorious about 6 yearsVery much agreed the lowest friction solution is to disable Wayland.
-
Charles Green about 6 yearsI would have marked the question as a duplicate, but what you asked really was quite different.
-
Pretorious about 6 yearsHowever 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.
-
Charles Green about 6 yearsEh - 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/
-
dobey about 6 yearsYou 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.
-
Pretorious about 6 yearsEdited 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.
-
-
sudodus over 4 yearsYes, X11 is old tech, but still more convenient for the end user compared to Wayland ;-)