Thursday, October 4, 2018

startup - Have x11vnc automatically start in Ubuntu 16.04 server without someone first logging in at the server physically

What I would like to do is automatically start x11vnc as a service. Then lets say when the server restarts for some reason, I would remotely login to the remote ubuntu 16.04 server, without anybody logging in physically to the computer at first. Any clues how this can be done?



The page at https://help.ubuntu.com/community/VNC/Servers#x11vnc says that x11vnc can be started while your computer is still showing a login screen. I think this is exactly my requirement.



When I run "x11vnc -findauth" I get the result XAUTHORITY=/run/user/1000/gdm/Xauthority.



FYI: I made it as a system service with this content



[Unit]
Description=Start x11vnc at startup.

After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth /run/user/1000/gdm/Xauthority -display :1 -forever -loop -noxdamage -repeat -rfbauth /home/mms2/.vnc/passwd -rfbport 5900 -shared

[Install]
WantedBy=multi-user.target



It works fine when any user has first logged into the system. But if no user has logged in first, I see this error in the log file:



Oct 16 19:45:19 ubuntu x11vnc[1486]: Starting with x11vnc 0.9.9 you can have it try to guess by using:
Oct 16 19:45:19 ubuntu x11vnc[1486]: -auth guess
Oct 16 19:45:19 ubuntu x11vnc[1486]: (see also the x11vnc -findauth option.)
Oct 16 19:45:19 ubuntu x11vnc[1486]: Only root will have read permission for the file, and so x11vnc must be run
Oct 16 19:45:19 ubuntu x11vnc[1486]: as root (or copy it). The random characters in the filenames will of course
Oct 16 19:45:19 ubuntu x11vnc[1486]: change and the directory the cookie file resides in is system dependent.
Oct 16 19:45:19 ubuntu x11vnc[1486]: See also: http://www.karlrunge.com/x11vnc/faq.html
Oct 16 19:45:19 ubuntu x11vnc[1486]: --- x11vnc loop: sleeping 2000 ms ---

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...