<p><b>Q-43:</b>
<font color="#007f00">
How can I run <b>x11vnc</b> as a "service" that is always available?
</font>
</p>
<p>Is anyone using X11VNC to run a headless Mythbox? how do I get it to startup after reboot and without having to login as a user??</p>This is from the website but I'm not fluid enough to understand how to implement it? any would be appreciated.
<br><br>Thanks,<br><p style="font-style: italic;"><br></p><p style="font-style: italic;">
There are a number of ways to do this. The primary thing you need to
decide is whether you want <b>x11vnc</b> to connect to the X session on
the machine 1) regardless of who (or if anyone) has the X session, or 2)
only if a certain user has the X session. Because X sessions are
protected by X permissions (MIT-MAGIC-COOKIE files <code>XAUTHORITY</code>
and <code>$HOME/.Xauthority</code>) the automatically started
<b>x11vnc</b> will of course need to have sufficient permissions to
connect to the X display.
</p><p style="font-style: italic;">
Here are some ideas:
</p><ul style="font-style: italic;"><li>Use the description under "Continuously" in the
        <a href="http://karlrunge.com/x11vnc/#display-manager-continuously">FAQ on <b>x11vnc</b> and Display Managers</a></li><li>Use the description in the
        <a href="http://karlrunge.com/x11vnc/#faq-inetd">FAQ on <b>x11vnc</b> and <code>inetd(1)</code></a></li><li>Start <b>x11vnc</b> from your <code>$HOME/.xsession</code> (or
        <code>$HOME/.xinitrc</code>)</li><li>Although less reliable, see the <a href="http://karlrunge.com/x11vnc/#x11vnc_loop">x11vnc_loop</a>
        <code>rc.local</code> hack below.
</li></ul><span style="font-style: italic;">
The display manager scheme will not be specific to which user has the X
session unless a test is specifically put into the display startup
script (often named </span><code style="font-style: italic;">Xsetup</code><span style="font-style: italic;">). The </span><code style="font-style: italic;">inetd(1)</code><span style="font-style: italic;"> scheme may or
may not be specific to which user has the X session (and it may not be able
to do all users via the </span><code style="font-style: italic;">XAUTHORITY</code><span style="font-style: italic;"> permission issues).
</span><p style="font-style: italic;">
The <code>$HOME/.xsession</code> scheme is obviously is specific to a
particular user. If you do not know what a
<code>$HOME/.xsession</code> script is or how to use one, perhaps your
desktop has a "session startup commands" configuration option. The
command to be run in the <code>.xsession</code> or
<code>.xinitrc</code> file may look like this:
</p><pre style="font-style: italic;">x11vnc -logfile $HOME/.x11vnc.log -rfbauth $HOME/.vnc/passwd -forever -bg<br></pre><span style="font-style: italic;">
plus any other options you desire.</span>