3

I have phrased my question very carefully. After much research and trial and error, I am able to have x11vnc start at boot as a system service by using this command line in my service file:

ExecStart=/usr/bin/x11vnc -auth /run/user/121/gdm/Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared

I figured out as many others have that the auth guess argument doesn't work in 17.10. I also figured out that 121 is the number for the user 'gdm' that owns the greeter X session, and that is where my Xauthority file resides. Checking xorg processes via ssh:

user@foo:~$ ps -ax |grep xorg
886 tty1     Sl+    0:00 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/121/gdm/Xauthority -background none -noreset -keeptty -verbose 3

Okay, so I can connect via vnc client and I see the greeter and login, but logging in yields a plain black screen with an active mouse pointer. Looking again at xorg processes:

user@foo:~$ ps -ax |grep xorg
886 tty1     Sl+    0:00 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/121/gdm/Xauthority -background none -noreset -keeptty -verbose 3
1384 tty2     Sl+    0:00 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3

I see that there is a new X session owned by the user that logged in (me!), and using the Xauthority file in that location. The problem seems to be that the VNC client is stuck at the original X session for the greeter owned by 'gdm'. How can I coax the vnc client to follow to the new X session without opening a second instance of the client? Surely it is possible to log in and use the desktop manager graphical interface with x11vnc and a vnc client, no? Thanks very kindly!

0

I do not have the same use case as you but it is similar and it might give some hints for the resolution of your problem if it is not yet solved. In fact I am remotely connecting from a smartphone using a console through SSH and a VNC client. My computer running x11vnc is currently under Ubuntu 18.04.2 LTS.

  1. When the greeter is displayed, I run:

    sudo x11vnc -safer -localhost -once -display :0 -auth /run/user/125/gdm/Xauthority (... other options)
    
  2. Then I log in through a VNC client. Then as for you, I see a plain black screen. I then kill the running x11vnc.

  3. Then I manually run (1000 is the number of the user logging in):

    x11vnc -safer -localhost -once -display :1 -auth /run/user/1000/gdm/Xauthority (... other options)
    
  4. I can then see my desktop (with my applications, ...) on my smartphone through my VNC client. I can then do remotely anything as if I were sitting in front of my computer using the keyboard and the mouse.

I think that the conclusion for you is that you need to run a second x11vnc with a different value for the -auth option. I think you can configure this as a "login" script which is executed directly after a given user logs in.

Note 1: as a side remark, please note that the -display option expects first :0 then :1, this made me lose a lot of time!

Note 2: for you 121 is the number for the user 'gdm', for me it is 125 but I found this through your question so thanks for that.

Note 3: I know that the question is more than 1 year old but since the question itself helped me I wanted to try to help in return as much as I can.

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.