launch x11vnc on bootup
I found this thread which shows a similar task of setting up x11vnc
as a Systemd service. The thread is titled: Index» Newbie Corner» how to enable x11vnc at startup using systemd ?.
From a comment in that thread
-
Create the file:
/etc/systemd/system/x11vnc.service
[Unit] Description=VNC Server for X11 Requires=display-manager.service After=display-manager.service [Service] Type=forking ExecStart=/usr/bin/x11vnc -norc -forever -shared -bg -rfbauth /etc/x11vnc.pass -allow 192.168.1. -autoport 5900 -o /var/log/x11vnc.log
-
Create the file:
/etc/systemd/system/graphical.target
# This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Graphical Interface Documentation=man:systemd.special(7) Requires=multi-user.target After=multi-user.target Conflicts=rescue.target Wants=display-manager.service Wants=x11vnc.service AllowIsolate=yes [Install] Alias=default.target
-
Enable Systemd service
$ sudo systemctl enable graphical.target
This should create a link like this:
/etc/systemd/system/default.target -> /etc/systemd/system/graphical.target
Reboot
Related videos on Youtube
zeena
Updated on September 18, 2022Comments
-
zeena over 1 year
I am using archlinux version 3.10.27-1-ARCH on my remote PC and I would like it to launch x11vnc server on successful bootup. Though i can start the x11vnc server manually, I am having trouble starting it up automatically. The configuration of
/etc/systemd/system/x11vnc.service
is as follows
[Unit] Description=VNC Server for X11 Requires=graphical.target After=graphical.target [Service] ExecStart=/usr/bin/x11vnc -display :0 -nopw
The status of the service using command:systemctl status x11vnc
x11vnc.service - VNC Server for X11 Loaded: loaded (/etc/systemd/system/x11vnc.service; enabled) Active: inactive (dead)
And the dBus output of command:dmesg|grep x11vnc
[ 5.467201] systemd[1]: Found dependency on x11vnc.service/start [ 5.467285] systemd[1]: Breaking ordering cycle by deleting job x11vnc.service/start [ 5.467335] systemd[1]: Job x11vnc.service/start deleted to break ordering cycle starting with graphical.target/start
I do feel from the
dmesg
output there is a cyclic dependency, but I am not able to understand what. -
zeena over 10 yearsThanks for your answer. Though I did see the link earlier during my google searches, I did not try it for some reason. I edited my
x11vnc.service
with yours as starting point, and now the x11vnc server starts up automatically on bootup -
slm over 10 years@zeena - That wonderful news, glad this resolved your issue, thanks for the Q!