You are not logged in.

#1 2023-12-03 23:30:20

Kazaflow
Member
Registered: 2023-12-03
Posts: 2

[SOLVED] Unable to start X11VNC as systemd service

Hey, so I have switched recently to Arch Linux from Windows 10 and wanted to set up X11VNC in a way that I could just turn on my PC before leaving to remote into it later the day.
I looked in the wiki and put together this command:

 /usr/bin/x11vnc -display :0 -no6 -rfbport 5901 -auth $(/usr/bin/sudo find /var/run/sddm/ -type f) -rfbauth /home/kazaflow/.vnc/passwd -loop

It works as I wanted when I run it myself in the terminal. But when I tried to follow this to have it run as a service I ran into the issue that it didn't run if I put it into ExecStart in the override file.
I also tried to this trick but both didn't work, and starting/restarting the service seems to time out if I'm reading what journalctl -xeu x11vnc.service returns.
However doing this (followed the xsetup step under 1.2.17 in the X11VNC entry in the wiki) worked after a restart of the system, until I disconnected, after which it refused to reconnect.

Can anyone tell me what I am doing wrong here? Does it have to do with permissions or something? Do I have to specify it to run as root (though if I understand it correctly it does that by default)?

EDIT: I will mark the post as solved since I technically have a way to start X11VNC at startup and keep the VNC server alive.

Last edited by Kazaflow (2023-12-12 07:30:04)

Offline

#2 2023-12-04 07:02:37

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] Unable to start X11VNC as systemd service

Note: your "doing this" link is broken.

Your command block uses a shell feature ("$()", command substitution) so you'll need to either call it via `/bin/sh -c` or put it in a script and call the script in the ExecStart line.

Offline

#3 2023-12-04 16:27:47

Kazaflow
Member
Registered: 2023-12-03
Posts: 2

Re: [SOLVED] Unable to start X11VNC as systemd service

I tried what you suggested, and it still didn't seem to be able to get it running `systemctl start` still just hung, but in the journal it showed this now every time it was starting:

Dez 04 16:43:13 archlinux sudo[3097]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/find /var/run/sddm/ -type f
Dez 04 16:43:13 archlinux sudo[3097]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Dez 04 16:43:13 archlinux sudo[3097]: pam_unix(sudo:session): session closed for user root

Could me not having a root password set cause this? (I have my user as sudo)

Besides that, I found out why `/usr/bin/x11vnc -auth /var/run/sddm/* -display :0 >/dev/null 2>&1 &`  (the thing under "doing this") only ran once I forgot the -loop and -forever flags.
Now I got it working though by putting:

usr/bin/x11vnc -display :0 -no6 -rfbport 5901 -auth $(/usr/bin/sudo find /var/run/sddm/ -type f) -rfbauth /home/kazaflow/.vnc/passwd -loop -forever >/dev/null 2>&1 &

into Xsetup and it works flawless as far as I am aware, is it fine like that? Or is there some reason I should still try making it a service?

Offline

Board footer

Powered by FluxBB