I have installed x11vnc on ubuntu 15.10. Based on:
Remmina cannot perform VNC remote desktop session before user logs in
I have created a new file: /etc/init/x11vnc.conf on MYSERVER containing:
start on login-session-start
script
x11vnc -display :0 -auth /var/run/lightdm/root/:0 -loop -forever -safer -shared -ultrafilexfer -bg -o /var/log/x11vnc.log -rfbauth /home/moore/.vnc/passwd -rfbport 5903 -http -users moore -nowireframe
end script
I have now rebooted MYSERVER and am trying to RDP to it from another ubuntu machine using Remmina:
But I just get:
I also tried following this guide:
http://seb.so/vnc-from-boot-without-logging-in-ubuntu-lubuntu-xubuntu-and-mint-lmde/
same result.
UPDATE:
As suggested below I have now tried to run:
x11vnc -display :0 -auth /var/run/lightdm/root/:0 -loop -forever -safer -shared -ultrafilexfer -bg -o /var/log/x11vnc.log -rfbauth /home/moore/.vnc/passwd -rfbport 5903 -http -users moore -nowireframe
from a terminal where I first SSH'ed to the server. It gave me this error:
...disabling -bg in -loop mode error opening logfile: /var/log/x11vnc.log open: Permission denied
But if I then do it as root from the same terminal it now works! But why does it not do that automatically when the machine is rebooted?
Notice when I did the small manual test above as root the file /var/log/x11vnc.log was created so it now exists with the following permissions:
-rw-r--r-- 1 root root 12640 Feb 19 00:26 x11vnc.log
But it still fails to start automatically on boot. It seems that whatever user is running the script on boot is NOT root.
UPDATE2:
The updated below answer solved the problem - that addresses the issue in Ubuntu 15.10.

