6

I am on xubuntu 14.04.04, and have successfully managed to get a VNC server up and running with SSH tunneling and such. However, I'm experiencing an issue with the VNC server, x11vnc 0.9.13. Currently, I have the following command execute on start up:

x11vnc -shared -forever -bg -auth guess

The -auth guess part uses x11vnc -findauth to automatically find the correct XAUTHORITY file, which on my system appears to be /var/run/lightdm/root/:0.

Here is the issue I am experiencing: the VNC setup works as expected until the lock screen appears (either when I manually lock the desktop, or an inactivity timeout occurs). When the lock screen appears, the VNC server displays the contents of the desktop just before the timeout occurs, a sort of still-frame or snapshot, and all input from my VNC client is ignored. I am unable to unlock it and return to my desktop from within the VNC client; I must use the remote system's keyboard and monitor. After it has been unlocked non-remotely, the VNC works as expected, until the screen lock appears again.

A few things I should mention:

  • I am able to select my user account and login from the account login screen without any issues over VNC, but when the desktop is locked, the issue occurs and I cannot unlock it.
  • The command sudo x11vnc -findauth returns XAUTHORITY=/var/run/lightdm/root/:0 only while I'm on the initial login screen after I first boot up. After I login, the same command returns XAUTHORITY=, whether I'm on my desktop or the screen is locked.
2
  • You could try to run x11vnc on gdm/lightdm: askubuntu.com/questions/25189/…
    – Takkat
    Commented Mar 26, 2016 at 10:36
  • @Takkat Looks like my current configuration is already pretty similar to the answer you gave in the question you linked. I'll update my question with some more info on what I have tried and what my issue is.
    – drdrez
    Commented Mar 26, 2016 at 15:10

3 Answers 3

5

light-locker switches to :1 when locking, so that explains why the vnc server running on :0 only sees a black screen.

The workaround is simply to start another vnc server at :1, connect to it, enter password, and go back to the original vnc connection at :0

x11vnc -auth /var/run/lightdm/root/\:1 -display :1
3
  • This worked for me, but only once I remembered to forward the port for the extra VNC server through the SSH tunnel I'm using (port 5901 in my case).
    – JRI
    Commented May 4, 2021 at 18:08
  • Thanks for the explanation and the workaround! It works and makes sense. Commented Mar 16, 2022 at 12:17
  • This isn't working for me in 22.10 and I'm certainly puzzled as to why since i can see the DISPLAY change on vt8 and I can start the vnc server on :1. My client, however, can't seem to pick anything up (even though it picks up the server fine on :0) Commented Dec 31, 2022 at 7:34
3

Looks like theres a bug from 2014 which covers this:

https://bugs.launchpad.net/ubuntu/+source/light-locker/+bug/1287171

I ended up removing light-locker and installing xscreensaver, and now I no longer have any vnc issues.

0

The only thing which worked in my case is to (install and) use xscreensaver instead of xfce's Lock Screen option. Note that xscreensaver also allows to set a password after the screensaver became effective, giving you a similar level of security.

You must log in to answer this question.

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