4

I've got a work Linux I can login to remotely via ssh and ssh -Y.

One application I'd like to use uses GLFW. Before the pandemic, I could work remotely just fine as there was a user logged in locally (me).

Now, I needed to reboot the machine and although I can ssh in, no user ever logged in since reboot. As such, my application won't start. I get:

Cannot initialize GLFW library

as the application tries to open a display. (I don't care about this display, the app produces output files I can access remotely)

I tried exporting the display with export DISPLAY=[my ip address]:0 and got xterm to work. But this is of no use, because my app requires something OpenGL:

what():  GLFW error: GLX: Forward compatibility requested but GLX_ARB_create_context_profile is unavailable

So, what I'm asking:

Over ssh (-Y), how can I login a user as if it was sitting in front of the machine ? I assume there's some part of X startup that is missing.

In case this is useful:

4.15.0-91-generic #92~16.04.1-Ubuntu SMP Fri Feb 28 14:57:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

1 Answer 1

2
+100

Here is a solution to open a local X desktop for the superuser from a remote ssh connection. I hope it will be useful since I cannot manage to make it run for a regular user.

1. Log on your machine with ssh

2. Allow anybody to open a local X11 session on the console

You have to edit /etc/X11/Xwrapper.config and change

allowed_users=console

to

allowed_users=anybody

3. Start the session (sudo)

sudo startx

The X11 session starts (as superuser) and you can see normal X11 session messages on your ssh session.

startx doesn't exit until the X11 session exits. If startx exits with error messages, something went wrong.

It usually fails for a regular user

On some systems, you can just use startx ( or startx -- vt[number] to force the virtual console used) but usually it fails.

It seems to be related to access rights to (at least) :

  • /dev/tty[number]
  • /dev/dri/card0
  • /dev/fb0

Those right should be set by some mechanism and forcing them with chown makes some improvements but not doesn't solve the issue.

I was not able to find the difference between the system where startx works for the regular user and the systems where it doesn't. They all run ubuntu eoan and as far as I know, the configurations are identical. Only the hardwares are different, especially the video cards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.