You don't need that. Can be done without it.
https://askubuntu.com/questions/4531...-is-plugged-in
I used this to run Kodi inside an LXD container on my headless server. Works great. X11VNC and away you go.
Systemd service to restart x11vnc after you exit it. I use for above purpose, rather I did until I changed to another service + script to stream audio out of the container to a remote pulse server. Change user & group as needed.
Code:
[Unit]
Description = Start and keep X11VNC server running
[Service]
User = kodi
Group = kodi
Type = simple
ExecStart = /usr/bin/x11vnc -display :0
Restart = always
[Install]
WantedBy = multi-user.target
In regards to VNC starting on boot you need something for it to connect to. In my container I have LightDM set to autologin to my kodi user on openbox, which autostarts Kodi. Using lightdm have it autologin to your user and that is it. The above service will keep the vnc server running.
Bookmarks