2

I want to connect to a server via ssh and log in (remotely) a user in X11 (gdm).

A little context:
I need to install a wine application in 30 computers, but wine require X11, there is nobody loged there, so wine does not work properly. I want to remotely login in display=:0.0 a user so this user receive the window (it only start and close), there i need to ()neThere is no one logged on there. I need to start a graphical app there (wine installer) but I cannot because it needs a display with X11 (to open a wineconsole).

Resumen:
Is it posible to log a user remotely on X11

My config: every computer have fedora 10 and gnome.


Clarification:
I do not want to do X-forwarding, I want to show the window on the remote computer, not mine. I want to log the user on the remote computer. If I go (fisicali) to the computer, the user should be logged on.


Update: I asked to gdm developers, but I had no answers... I'm starting to think there is no way. The only option I can think is to config autologin, restart gdm, and get the config normal again (all by script) But I have to read a lot for that and is not so important, I prefer to log in manualy 30 times.

3
  • You'd probably have to kill gdm and fire up an X server on the remote machine. Either gdm owns the display or will fight you constantly for it.
    – msw
    Jun 9, 2010 at 22:33
  • If I kill gdm it restart automaticaly... and how I do that (without gdm and with a logged user)?
    – eloyesp
    Jun 9, 2010 at 22:57
  • > I want to show the window on the remote computer, not mine There is no reason to want that. You can log in remotely while displaying locally, this is what the answers are driving at.
    – Tobu
    Jun 11, 2010 at 12:36

6 Answers 6

5

I don't believe it's possible to remotely control GDM on the console. Gnome's builtin VNC server (vino) doesn't start until the user logs in, so it doesn't run with GDM. There are ways to get GDM on a VNC server, but those will be separate displays from the console.

You've already identified the alternative: script setting GDM to autologin, then restart GDM, then perform your installation, then reset the GDM settings to undo the autologin, then restart GDM again.

  • restart GDM:
    • on Ubuntu or other systems with Upstart-enabled GDM, run initctl restart gdm
    • on SysV-init systems, run /etc/init.d/gdm restart
    • don't forget sudo or su if needed

  • GDM autologin: add these lines to the [daemon] section of your /etc/gdm/custom.conf or /etc/gdm/gdm.conf (depending on your distribution). username cannot be root.

    AutomaticLoginEnable=true
    AutomaticLogin=username
    
1

You can do this using vnc. You can also tunnel it through your ssh session.

http://www.vanemery.com/Linux/VNC/vnc-over-ssh.html

2
  • Yes, I can, but I want to use the console, and if possible not to type password (I am logged as root on the remote computer).
    – eloyesp
    Jun 10, 2010 at 13:07
  • Beware that now in 2023 GDM mostly uses Wayland and not xorg any longer. For VNC to work (and it does), you first have to disable Wayland in gdm. Sep 13, 2023 at 11:13
0

Assuming there's nobody using the display on the remote computer, why can't you simply log in remotely, set the display var, and start your program?

3
  • I get an error (cannot open display)...
    – eloyesp
    Jun 9, 2010 at 23:01
  • Sounds like someone else is logged in.
    – chris
    Jun 10, 2010 at 11:58
  • I think that gdm is logged in only, there is no one else.
    – eloyesp
    Jun 11, 2010 at 12:25
0

As I see there is no such option in gdm, and is possible the workaround of quack quixote, but it is possible to do it in kdm: using sockets

0

You should be able to start a second X server on a different virtual terminal, and set the DISPLAY variable to point at it. The xinit or startx utilities are probably the easiest way of doing this, and man Xorg will tell you what server arguments to use (eg vt08 and :1). You will probably need to use sudo to run it. The xinit man page has some examples that may be useful.

2
  • yes, this sound no easy, but could help to install software while other user is using the computer. Now I preffer using autologin...
    – eloyesp
    Jul 9, 2010 at 19:57
  • Actually, the second virtual terminal would be displayed on the screen, so someone sitting at the computer would see your install and would have their work interrupted. The only benefit would be a more controlled environment, ie not having all of GNOME or KDE running, just whatever you choose to run, which would be the program running under WINE and maybe a lightweight window manager like metacity. Jul 11, 2010 at 0:29
0

Have a look at NoMachine NX (www.nomachine.com). It works over ssh but speed on slow connections is much better than plain old x-forwarding and you don't lose the x session if the network goes down. You can connect to the remote machine, run your app and then "disconnect" thus leaving the x session active. On the next reconnect you are prompted if you want to reconnect to the currently active session. There is also a completely free clone/fork/whatsoever called freeNX, but I've never tried it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .