nbdd0121 / wsld

WSL Daemon - Stable X11 connection and time synchronisation for WSL2
Apache License 2.0
299 stars 26 forks source link

How to run automatically without root? #13

Open davidhsv opened 3 years ago

davidhsv commented 3 years ago

When running wsld using the instructions on the doc, it show this error:

Failed to listen: Operation not permitted (os error 1)

If I run the command with sudo wsld, everything works fine.

nbdd0121 commented 3 years ago

If you are using time synchronisation, then you need to grant wsld cap_sys_time capability so it can adjust system time for you. You can add the cap with sudo setcap cap_sys_time+eip <PATH to wsld>.

davidvieiratrustly commented 3 years ago

Already did that, but still get the Failed to listen: Operation not permitted (os error 1) error.

Only works with a do a sudo wsld. That makes me unable to run in the startup.

nbdd0121 commented 3 years ago

Could you check if you have enough permission to create files in /tmp/.X11-unix then?

If you only reason to not use sudo is startup script, you can configure sudo to not require password to run wsld, or use setuid. You can follow instructions in https://unix.stackexchange.com/questions/18830/how-to-run-a-specific-program-as-root-without-a-password-prompt.