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.
There are only three things I can think of that might be preventing you from connecting:
I also use x11vnc server on my computer, but the difference is that only the localhost can access it. I also run an SSH server, that way I have a way more secure connection, and once a user ssh to your computer, they can connect to the VNC server as a localhost.
I hope this helps
EDIT
After trableshooting, the problem is that Ubuntu 15.10 doesn't have upstart so x11vnc will never run on boot. Instead, you have to create a service and make it available at boot. Here's what to do:
Insert this into the file:
Then you can start the service with:
And to make the service start on boot:
This solution was previously posted by babelmonk here